BufferedWriter wt = new BufferedWriter(new FileWriter(detailFile));
Classifier aClassifier = factory.createClassifier();
TaxonTree root = null;
SequenceReader parser = null;
Sequence pSeq = null;
int count = 0;
try {
parser = new SequenceReader(inStream1);
while((pSeq = parser.readNextSequence()) != null) {
try {
ClassificationResult result = aClassifier.classify(pSeq);
root = reconstructTree(result, root, SAMPLE1);
wt.write(ClassificationResultFormatter.getOutput(result, format));
} catch (ShortSequenceException e) {
System.out.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
parser = new SequenceReader(inStream2);
while((pSeq = parser.readNextSequence()) != null) {
try {
ClassificationResult result = aClassifier.classify(pSeq);
root = reconstructTree(result, root, SAMPLE2);
wt.write(ClassificationResultFormatter.getOutput(result, format));
} catch (ShortSequenceException e) {
System.out.println(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
} finally {
parser.close();
wt.close();
}
if (root != null) {
// change the assignment count for the taxa based on the confidence cutoff value