label.dom_score_desc = The score threshold for returned domains.
label.not_enough_sequences = There are not enough sequences to run {0}
label.add_database = Add Database
+label.this_alignment = This alignment
warn.file_not_exists = File does not exist
warn.invalid_format = This is not a valid database file format. The current supported formats are Fasta, Stockholm and Pfam.
label.database_for_hmmsearch = The database hmmsearch will search through.
\ No newline at end of file
if (names != null && !names.isEmpty())
{
Collection<String> databases = new ArrayList<>();
- databases.add("This Alignment");
+ databases.add(MessageManager.getString("label.this_alignment"));
Scanner nameScanner = new Scanner(names);
if (nameScanner.hasNext())
nameScanner.close();
args.add(new Option(MessageManager.getString("label.database"),
MessageManager.getString("label.database_for_hmmsearch"),
- true, "This Alignment", "This Alignment", databases, null));
+ true, MessageManager.getString("label.this_alignment"),
+ MessageManager.getString("label.this_alignment"), databases,
+ null));
}
args.add(new BooleanOption(
MessageManager.getString("label.auto_align_seqs"),
import java.io.File;
import java.io.IOException;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
inputAlignmentTemp.deleteOnExit();
inputTableTemp = File.createTempFile("buffer", ".sto");
inputTableTemp.deleteOnExit();
- databaseFile = new File("D:/Thomas/uniref50.fasta");
}
/**
*/
private boolean runCommand() throws IOException, InterruptedException
{
+ Boolean dbFound = false;
+ String dbPath = "";
File file = new File(cmds.HMMERFOLDER + "/hmmsearch");
if (!file.canExecute())
{
break;
case "Trim Non-Matching Termini":
trim = true;
-
+ break;
+ case "Database":
+ dbFound = true;
+ dbPath = arg.getValue();
+ if (!MessageManager.getString("label.this_alignment")
+ .equals(dbPath))
+ {
+ databaseFile = new File(dbPath);
+ }
}
-
}
}
+ if (dbFound == false || MessageManager.getString("label.this_alignment")
+ .equals(dbPath))
+ {
+ AlignmentI alignment = af.getViewport().getAlignment();
+ AlignmentI copy = new Alignment(alignment);
+ copy.getHMMConsensusSequences(true);
+ StockholmFile stoFile = new StockholmFile(copy);
+ stoFile.setSeqs(copy.getSequencesArray());
+ String alignmentString = stoFile.print();
+ databaseFile = File.createTempFile("database", ".sto");
+ databaseFile.deleteOnExit();
+ PrintWriter writer = new PrintWriter(databaseFile);
+ writer.print(alignmentString);
+ writer.close();
+ }
+
command += hmmTemp.getAbsolutePath() + cmds.SPACE
+ databaseFile.getAbsolutePath();
return cmds.runCommand(command);
AlignmentI alignment = new Alignment(hmmAndSeqs);
AlignFrame frame = new AlignFrame(alignment, 1, 1);
frame.setSelectedHMMSequence(hmmSeq);
- frame.getViewport().initInformation();
List<ArgumentI> alignArgs = new ArrayList<>();
if (trim)
{