import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Hashtable;
import java.util.List;
import java.util.Scanner;
private String databaseName;
+ boolean searchAlignment = true;
+
+ Hashtable sequencesHash;
+
/**
* Constructor for the JackhmmerThread
*
try
{
- File seqFile = FileUtils.createTempFile("seq", ".fa");
+ File seqFile = FileUtils.createTempFile("seq", ".sto");
File hitsAlignmentFile = FileUtils.createTempFile("hitAlignment",
".sto");
File searchOutputFile = FileUtils.createTempFile("searchOutput",
".txt");
- exportSequence(seq, seqFile.getAbsoluteFile());
+ exportStockholm(new SequenceI[] { seq }, seqFile.getAbsoluteFile(),
+ null);
boolean ran = runCommand(searchOutputFile, hitsAlignmentFile,
seqFile);
String seqScoreCutoff = null;
String domScoreCutoff = null;
databaseName = "Alignment";
- boolean searchAlignment = false;
if (params != null)
{
{
String name = arg.getName();
- if (MessageManager.getString("action.search").equals(name))
- {
- searchAlignment = arg.getValue().equals(
- MessageManager.getString(JackHMMER.THIS_ALIGNMENT_KEY));
- }
- else if (MessageManager.getString(DATABASE_KEY).equals(name))
- {
- dbPath = arg.getValue();
- int pos = dbPath.lastIndexOf(File.separator);
- databaseName = dbPath.substring(pos + 1);
- databaseFile = new File(dbPath);
- }
- else if (MessageManager.getString(REPORTING_CUTOFF_KEY)
+ if (MessageManager.getString(REPORTING_CUTOFF_KEY)
.equals(name))
{
- if (CUTOFF_EVALUE.equals(arg.getValue()))
+ if (MessageManager.getString(CUTOFF_EVALUE)
+ .equals(arg.getValue()))
{
useEvalueCutoff = true;
}
- else if (CUTOFF_SCORE.equals(arg.getValue()))
+ else if (MessageManager.getString(CUTOFF_SCORE)
+ .equals(arg.getValue()))
{
useScoreCutoff = true;
}
databaseName = dbPath.substring(pos + 1);
databaseFile = new File(dbPath);
}
+ searchAlignment = false;
}
}
}
* no external database specified for search, so
* export current alignment as 'database' to search
*/
- databaseFile = FileUtils.createTempFile("database", ".fa");
+ databaseFile = FileUtils.createTempFile("database", ".sto");
AlignmentI al = af.getViewport().getAlignment();
AlignmentI copy = new Alignment(al);
+
deleteHmmSequences(copy);
- exportFasta(copy, databaseFile);
+
+ sequencesHash = stashSequences(copy.getSequencesArray());
+
+ exportStockholm(copy.getSequencesArray(), databaseFile, null);
}
args.add(getFilePath(seqFile, true));
inputAlignmentTemp.getAbsolutePath(), DataSourceType.FILE));
seqs = file.getSeqsAsArray();
+ if (searchAlignment)
+ {
+ recoverSequences(sequencesHash, seqs);
+ }
+
readTable(searchOutputFile);
int seqCount = Math.min(seqs.length, seqsToReturn);
annot.setEValue(dEValue);
double dBitScore = Double.parseDouble(bitScore);
- annot.setEValue(dBitScore);
+ annot.setBitScore(dBitScore);
annot.setSequenceRef(seq);
seq.addAlignmentAnnotation(annot);
+
} catch (NumberFormatException e)
{
System.err.println("Error parsing " + label + " from " + eValue