Skip to content

Commit

Permalink
Fixed bugs in the CrossValidate and Reprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
wangqion committed Feb 20, 2015
1 parent 9dd8a14 commit 63c637b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ArrayList<HashMap> runTest(File tax_file, File source_file, File out_file
DecisionMaker dm = new DecisionMaker(factory);
// get all the genus node list
HashMap<String, HierarchyTree> genusNodeMap = new HashMap<String, HierarchyTree>();
factory.getRoot().getNodeMap(Taxonomy.GENUS, genusNodeMap);
factory.getRoot().getNodeMap(factory.getLowestRank(), genusNodeMap);
if (genusNodeMap.isEmpty()) {
throw new IllegalArgumentException("\nThere is no node in GENUS level!");
}
Expand Down Expand Up @@ -115,7 +115,7 @@ public ArrayList<HashMap> runTest(File tax_file, File source_file, File out_file
}

List result = dm.getBestClasspath( wordIterator, genusNodeMap, useSeed, min_bootstrap_words);

//xxx
ValidClassificationResultFacade resultFacade = new ValidClassificationResultFacade(pSeq, result);

Expand Down
9 changes: 6 additions & 3 deletions src/edu/msu/cme/rdp/classifier/utils/ClassifierSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ public ClassifierSequence(String seqName, String desc, String seqString) throws
* Fetches every overlapping word from the sequence string, changes each
* word to integer format and saves in an array.
*/
GoodWordIterator iterator = new GoodWordIterator(this.getSeqString());
this.wordIndexArr = iterator.getWordArr();
this.goodWordCount = wordIndexArr.length;
// Note when user provide the classification result, we don't get the sequence string
if ( !this.getSeqString().isEmpty()){
GoodWordIterator iterator = new GoodWordIterator(this.getSeqString());
this.wordIndexArr = iterator.getWordArr();
this.goodWordCount = wordIndexArr.length;
}
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/edu/msu/cme/rdp/multicompare/Reprocess.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public static void main(String [] args) throws Exception {
}
gene = line.getOptionValue(CmdOptions.GENE_SHORT_OPT).toLowerCase();

if (!gene.equals(ClassifierFactory.RRNA_16S_GENE) && !gene.equals(ClassifierFactory.FUNGALLSU_GENE)) {
if (!gene.equals(ClassifierFactory.RRNA_16S_GENE) && !gene.equals(ClassifierFactory.FUNGALLSU_GENE)
&& !gene.equals(ClassifierFactory.FUNGALITS_warcup_GENE) && !gene.equals(ClassifierFactory.FUNGALITS_unite_GENE) ) {
throw new IllegalArgumentException(gene + " is NOT valid, only allows " + ClassifierFactory.RRNA_16S_GENE
+ ", " + ClassifierFactory.FUNGALLSU_GENE + ", " + ClassifierFactory.FUNGALITS_warcup_GENE + " and " + ClassifierFactory.FUNGALITS_unite_GENE);
}
Expand Down

0 comments on commit 63c637b

Please sign in to comment.