Package edu.msu.cme.rdp.classifier.rrnaclassifier

Examples of edu.msu.cme.rdp.classifier.rrnaclassifier.ClassificationParser


        ConcretRoot<MCTaxon> root = new ConcretRoot<MCTaxon>(new MCTaxon(sampleTreeRoot.getTaxid(), sampleTreeRoot.getName(), sampleTreeRoot.getRank()) );
        List<String> badSequences = new ArrayList();
        Map<String, Long> seqCountMap = new HashMap();

        for (MCSample sample : samples) {
            ClassificationParser parser = ((MCSampleResult) sample).getClassificationParser(classifierFactory);
            ClassificationResult result;

            while ((result = parser.next()) != null) {              
                processClassificationResult(result, sample, root, confidence, seqCountMap);
                List<RankAssignment> assignList = result.getAssignments();
                if ( printRank == null){
                    printRank = assignList.get(assignList.size() -1).getRank();
                }
                boolean match = false;
                if ( taxonFilter == null){
                    match = true;
                }else {
                    for ( RankAssignment assign: assignList){
                        if (taxonFilter.contains(assign.getBestClass().getName()) ){
                            match = true;
                            break;
                        }  
                    }
                }
                if ( match){
                    for ( RankAssignment assign: assignList){
                        if ( assign.getRank().equalsIgnoreCase(printRank) && assign.getConfidence() >= confidence ){
                            printClassificationResult(result, assign_out, format, confidence);
                            break;
                        }
                    }
                }
            }
            parser.close();
        }
        return new MultiClassifierResult(root, samples, badSequences, seqCountMap);
    }
View Full Code Here


        sample_resultFile = new File(classicationResultFile);
    }
   

    public ClassificationParser getClassificationParser(ClassifierFactory classifierFactory) throws FileNotFoundException{
        ClassificationParser parser = new ClassificationParser(sample_resultFile, classifierFactory);
        return parser;
    }
View Full Code Here

TOP

Related Classes of edu.msu.cme.rdp.classifier.rrnaclassifier.ClassificationParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.