Skip to content

Commit 63c637b

Browse files
committed
Fixed bugs in the CrossValidate and Reprocess
1 parent 9dd8a14 commit 63c637b

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/edu/msu/cme/rdp/classifier/train/validation/crossvalidate/CrossValidate.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public ArrayList<HashMap> runTest(File tax_file, File source_file, File out_file
6969
DecisionMaker dm = new DecisionMaker(factory);
7070
// get all the genus node list
7171
HashMap<String, HierarchyTree> genusNodeMap = new HashMap<String, HierarchyTree>();
72-
factory.getRoot().getNodeMap(Taxonomy.GENUS, genusNodeMap);
72+
factory.getRoot().getNodeMap(factory.getLowestRank(), genusNodeMap);
7373
if (genusNodeMap.isEmpty()) {
7474
throw new IllegalArgumentException("\nThere is no node in GENUS level!");
7575
}
@@ -115,7 +115,7 @@ public ArrayList<HashMap> runTest(File tax_file, File source_file, File out_file
115115
}
116116

117117
List result = dm.getBestClasspath( wordIterator, genusNodeMap, useSeed, min_bootstrap_words);
118-
118+
119119
//xxx
120120
ValidClassificationResultFacade resultFacade = new ValidClassificationResultFacade(pSeq, result);
121121

src/edu/msu/cme/rdp/classifier/utils/ClassifierSequence.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ public ClassifierSequence(String seqName, String desc, String seqString) throws
3636
* Fetches every overlapping word from the sequence string, changes each
3737
* word to integer format and saves in an array.
3838
*/
39-
GoodWordIterator iterator = new GoodWordIterator(this.getSeqString());
40-
this.wordIndexArr = iterator.getWordArr();
41-
this.goodWordCount = wordIndexArr.length;
39+
// Note when user provide the classification result, we don't get the sequence string
40+
if ( !this.getSeqString().isEmpty()){
41+
GoodWordIterator iterator = new GoodWordIterator(this.getSeqString());
42+
this.wordIndexArr = iterator.getWordArr();
43+
this.goodWordCount = wordIndexArr.length;
44+
}
4245
}
4346

4447
/**

src/edu/msu/cme/rdp/multicompare/Reprocess.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ public static void main(String [] args) throws Exception {
140140
}
141141
gene = line.getOptionValue(CmdOptions.GENE_SHORT_OPT).toLowerCase();
142142

143-
if (!gene.equals(ClassifierFactory.RRNA_16S_GENE) && !gene.equals(ClassifierFactory.FUNGALLSU_GENE)) {
143+
if (!gene.equals(ClassifierFactory.RRNA_16S_GENE) && !gene.equals(ClassifierFactory.FUNGALLSU_GENE)
144+
&& !gene.equals(ClassifierFactory.FUNGALITS_warcup_GENE) && !gene.equals(ClassifierFactory.FUNGALITS_unite_GENE) ) {
144145
throw new IllegalArgumentException(gene + " is NOT valid, only allows " + ClassifierFactory.RRNA_16S_GENE
145146
+ ", " + ClassifierFactory.FUNGALLSU_GENE + ", " + ClassifierFactory.FUNGALITS_warcup_GENE + " and " + ClassifierFactory.FUNGALITS_unite_GENE);
146147
}

0 commit comments

Comments
 (0)