label.invalid_folder = Invalid Folder
label.number_of_results = Number of Results to Return
label.auto_align_seqs = Automatically Align Fetched Sequences
+label.new_returned = new sequences returned
label.use_accessions = Return Accessions
+label.check_for_new_sequences = Return Number of New Sequences
label.seq_evalue = Sequence E-value Cut-off
+label.evalue = E-Value
label.seq_score = Sequence Score Threshold
label.dom_evalue = Domain E-value Cut-off
label.dom_score = Domain Score Threshold
label.number_of_results_desc = The maximum number of hmmsearch results to display
label.auto_align_seqs_desc = If true, all fetched sequences will be aligned to the hidden Markov model with which the search was performed
+label.check_for_new_sequences_desc = Display number of new sequences returned from hmmsearch compared to the previous alignment
label.use_accessions_desc = If true, the accession number of each sequence is returned, rather than that sequence's name
label.seq_e_value_desc = The E-value cutoff for returned sequences (hmmsearch -E)
label.seq_score_desc = The score threshold for returned sequences (hmmsearch -T)
MessageManager.getString(HMMSearch.TRIM_TERMINI_KEY),
MessageManager.getString("label.trim_termini_desc"), false,
false, true, null));
+ args.add(new BooleanOption(
+ MessageManager.getString(HMMSearch.RETURN_N_NEW_SEQ),
+ MessageManager.getString("label.check_for_new_sequences_desc"),
+ false, false, false, null));
/*
* 'Parameters'
String thisAlignment = MessageManager
.getString(HMMSearch.THIS_ALIGNMENT_KEY);
String database = MessageManager.getString("label.database");
- args.add(new RadioChoiceParameter(
- MessageManager.getString("action.search"), null,
- Arrays.asList(thisAlignment,
- database),
- thisAlignment));
args.add(new FileParameter(database, "", false, "", ""));
args.add(new IntegerParameter(
MessageManager.getString(HMMSearch.NUMBER_OF_RESULTS_KEY),
args.add(new LogarithmicParameter(
MessageManager.getString(HMMSearch.SEQ_EVALUE_KEY),
MessageManager.getString("label.seq_e_value_desc"), false, 1D,
- 1E-38, 10D));
+ 1E-100, 10D));
args.add(new LogarithmicParameter(
MessageManager.getString(HMMSearch.DOM_EVALUE_KEY),
MessageManager.getString("label.dom_e_value_desc"), false, 1D,
- 1E-38, 10D));
+ 1E-100, 10D));
args.add(
new DoubleParameter(
MessageManager.getString(HMMSearch.SEQ_SCORE_KEY),
// addChoiceOfDatabase(args);
- String thisAlignment = MessageManager
- .getString(JackHMMER.THIS_ALIGNMENT_KEY);
String database = MessageManager.getString("label.database");
- args.add(new RadioChoiceParameter(
- MessageManager.getString("action.search"), null,
- Arrays.asList(thisAlignment, database), thisAlignment));
args.add(new FileParameter(database, "", false, "", ""));
args.add(new RadioChoiceParameter(
MessageManager.getString(JackHMMER.REPORTING_CUTOFF_KEY), null,
- Arrays.asList(JackHMMER.CUTOFF_NONE, JackHMMER.CUTOFF_EVALUE,
- JackHMMER.CUTOFF_SCORE),
- JackHMMER.CUTOFF_EVALUE));
+ Arrays.asList(MessageManager.getString(JackHMMER.CUTOFF_NONE),
+ MessageManager.getString(JackHMMER.CUTOFF_EVALUE),
+ MessageManager.getString(JackHMMER.CUTOFF_SCORE)),
+ MessageManager.getString(JackHMMER.CUTOFF_EVALUE)));
args.add(new LogarithmicParameter(
MessageManager.getString(JackHMMER.SEQ_EVALUE_KEY),
MessageManager.getString("label.seq_e_value_desc"), false, 1D,
boolean trim = false;
+ boolean returnNoOfNewSeqs = false;
+
int seqsToReturn = Integer.MAX_VALUE;
+ boolean searchAlignment = true;
+
SequenceI[] seqs;
private String databaseName;
String seqScoreCutoff = null;
String domScoreCutoff = null;
databaseName = "Alignment";
- boolean searchAlignment = false;
if (params != null)
{
{
seqsToReturn = Integer.parseInt(arg.getValue());
}
- else if (MessageManager.getString("action.search").equals(name))
- {
- searchAlignment = arg.getValue().equals(
- MessageManager.getString(HMMSearch.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(AUTO_ALIGN_SEQS_KEY)
.equals(name))
{
databaseName = dbPath.substring(pos + 1);
databaseFile = new File(dbPath);
}
+ searchAlignment = false;
+ }
+ else if (MessageManager.getString(RETURN_N_NEW_SEQ).equals(name))
+ {
+ returnNoOfNewSeqs = true;
}
}
}
inputAlignmentTemp.getAbsolutePath(), DataSourceType.FILE));
seqs = file.getSeqsAsArray();
- recoverSequences(sequencesHash, seqs);
+ if (searchAlignment)
+ {
+ recoverSequences(sequencesHash, seqs);
+ }
// look for PP cons and ref seq in alignment only annotation
AlignmentAnnotation modelpos = null, ppcons = null;
}
}
}
+
if (realign)
{
realignResults(hmmAndSeqs);
+ hmmSeq.getName();
Desktop.addInternalFrame(alignFrame, ttl, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
+
+ int nNew = checkForNewSequences();
+ JvOptionPane.showMessageDialog(af.alignPanel, nNew + " "
+ + MessageManager.getString("label.new_returned"));
+
}
+
hmmTemp.delete();
inputAlignmentTemp.delete();
searchOutputFile.delete();
}
}
+ private int checkForNewSequences()
+ {
+ int nNew = seqs.length;
+
+ for (SequenceI resultSeq : seqs)
+ {
+ for (SequenceI aliSeq : alignment.getSequencesArray())
+ {
+ if (resultSeq.getName().equals(aliSeq.getName()))
+ {
+ nNew--;
+ }
+ }
+ }
+
+ return nNew;
+
+ }
+
/**
* Realigns the given sequences using hmmalign, to the HMM profile sequence
* which is the first in the array, and opens the results in a new frame
}
HmmerCommand hmmalign = new HMMAlign(frame, alignArgs);
hmmalign.run();
+
+ int nNew = checkForNewSequences();
+ JvOptionPane.showMessageDialog(frame.alignPanel,
+ nNew + " " + MessageManager.getString("label.new_returned"));
}
/**
static final String TRIM_TERMINI_KEY = "label.trim_termini";
+ static final String RETURN_N_NEW_SEQ = "label.check_for_new_sequences";
+
static final String REPORTING_CUTOFF_KEY = "label.reporting_cutoff";
- static final String CUTOFF_NONE = "None";
+ static final String CUTOFF_NONE = "label.default";
- static final String CUTOFF_SCORE = "Score";
+ static final String CUTOFF_SCORE = "label.score";
- static final String CUTOFF_EVALUE = "E-Value";
+ static final String CUTOFF_EVALUE = "label.evalue";
static final String SEQ_EVALUE_KEY = "label.seq_evalue";
private String databaseName;
+ boolean searchAlignment = true;
+
Hashtable sequencesHash;
/**
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;
}
}
}
inputAlignmentTemp.getAbsolutePath(), DataSourceType.FILE));
seqs = file.getSeqsAsArray();
- recoverSequences(sequencesHash, seqs);
+ if (searchAlignment)
+ {
+ recoverSequences(sequencesHash, seqs);
+ }
readTable(searchOutputFile);
annot.setSequenceRef(seq);
seq.addAlignmentAnnotation(annot);
+
} catch (NumberFormatException e)
{
System.err.println("Error parsing " + label + " from " + eValue