databaseFile = FileUtils.createTempFile("database", ".sto");
AlignmentI al = af.getViewport().getAlignment();
AlignmentI copy = new Alignment(al);
- List<SequenceI> hmms = copy.getHmmSequences();
- for (SequenceI hmmSeq : hmms)
- {
- copy.deleteSequence(hmmSeq);
- }
+ deleteHmmSequences(copy);
exportStockholm(copy.getSequencesArray(), databaseFile, null);
}
&& !"".equals(line))
{
SequenceI seq = seqs[index];
- AlignmentAnnotation pp = seq
- .getAlignmentAnnotations("", "Posterior Probability")
- .get(0);
Scanner scanner = new Scanner(line);
- String str = scanner.next();
- addScoreAnnotation(str, seq, "hmmsearch E-value",
- "Full sequence E-value", pp);
- str = scanner.next();
- addScoreAnnotation(str, seq, "hmmsearch Score",
- "Full sequence bit score", pp);
- seq.removeAlignmentAnnotation(pp);
+ String evalue = scanner.next();
+ String score = scanner.next();
+ addScoreAnnotations(evalue, score, seq);
scanner.close();
line = br.readLine();
index++;
br.close();
}
- /**
- * A helper method that adds one score-only (non-positional) annotation to a
- * sequence
- *
- * @param value
- * @param seq
- * @param label
- * @param description
- */
- protected void addScoreAnnotation(String value, SequenceI seq,
- String label, String description)
- {
- addScoreAnnotation(value, seq, label, description, null);
- }
- /**
- * A helper method that adds one score-only (non-positional) annotation to a
- * sequence
- *
- * @param value
- * @param seq
- * @param label
- * @param description
- * @param pp
- * existing posterior probability annotation - values copied to new
- * annotation row
- */
- protected void addScoreAnnotation(String value, SequenceI seq,
- String label, String description, AlignmentAnnotation pp)
+ protected void addScoreAnnotations(String eValue, String bitScore,
+ SequenceI seq)
{
+ String label = "Search Scores";
+ String description = "Full sequence bit score and E-Value";
+
try
{
- AlignmentAnnotation annot = null;
- if (pp == null)
- {
- new AlignmentAnnotation(label,
+ AlignmentAnnotation annot = new AlignmentAnnotation(label,
description, null);
- }
- else
- {
- annot = new AlignmentAnnotation(pp);
- annot.label = label;
- annot.description = description;
- }
+
+ annot.label = label;
+ annot.description = description;
+
annot.setCalcId(HMMSEARCH);
- double eValue = Double.parseDouble(value);
- annot.setScore(eValue);
+
+ double dEValue = Double.parseDouble(eValue);
+ annot.setEValue(dEValue);
+
+ double dBitScore = Double.parseDouble(bitScore);
+ annot.setBitScore(dBitScore);
+
annot.setSequenceRef(seq);
seq.addAlignmentAnnotation(annot);
} catch (NumberFormatException e)
{
- System.err.println("Error parsing " + label + " from " + value);
+ System.err.println("Error parsing " + label + " from " + eValue
+ + " & " + bitScore);
}
}