- args.add("-o");
- args.add(getFilePath(searchOutputFile));
- args.add("-A");
- args.add(getFilePath(hitsAlignmentFile));
-
- boolean dbFound = false;
- String dbPath = "";
- File databaseFile = null;
-
- if (params != null)
- {
- for (ArgumentI arg : params)
- {
- String name = arg.getName();
- if (MessageManager.getString("label.number_of_results")
- .equals(name))
- {
- seqsToReturn = Integer.parseInt(arg.getValue());
- }
- else if (MessageManager.getString("label.auto_align_seqs")
- .equals(name))
- {
- realign = true; // TODO: not used
- }
- else if (MessageManager.getString("label.use_accessions")
- .equals(name))
- {
- args.add("--acc");
- }
- else if (MessageManager.getString("label.seq_e_value").equals(name))
- {
- args.add("--incE");
- args.add(arg.getValue());
- }
- else if (MessageManager.getString("label.seq_score").equals(name))
- {
- args.add("-incT");
- args.add(arg.getValue());
- }
- else if (MessageManager.getString("label.dom_e_value_desc")
- .equals(name))
- {
- args.add("--incdomE");
- args.add(arg.getValue());
- }
- else if (MessageManager.getString("label.dom_score").equals(name))
- {
- args.add("--incdomT");
- args.add(arg.getValue());
- }
- else if (MessageManager.getString("label.trim_termini")
- .equals(name))
- {
- trim = true;
- }
- else if (MessageManager.getString("label.database").equals(name))
- {
- dbFound = true;
- dbPath = arg.getValue();
- if (!MessageManager.getString("label.this_alignment")
- .equals(dbPath))
- {
- databaseFile = new File(dbPath);
- }
- }
- }
- }
-
- if (!dbFound || MessageManager.getString("label.this_alignment")
- .equals(dbPath))
- {
- /*
- * no external database specified for search, so
- * export current alignment as 'database' to search,
- * excluding any HMM consensus sequences it contains
- */
- 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);
- }
- exportStockholm(copy.getSequencesArray(), databaseFile, null);
- // StockholmFile stoFile = new StockholmFile(copy);
- // stoFile.setSeqs(copy.getSequencesArray());
- // String alignmentString = stoFile.print();
- // PrintWriter writer = new PrintWriter(databaseFile);
- // writer.print(alignmentString);
- // writer.close();
- }
-
- args.add(getFilePath(hmmFile));
- args.add(getFilePath(databaseFile));