label.blasting_for_unidentified_sequence = BLASTing for unidentified sequences
label.select_columns_containing = Select columns containing\r
label.select_columns_not_containing = Select columns that do not contain\r
-\r
+option.trim_retrieved_seqs = Trim retrieved sequences\r
+label.trim_retrieved_sequences = When the reference sequence is longer than the sequence that you are working with, only keep the relevant subsequences.\r
import java.util.Vector;
import javax.swing.JButton;
+import javax.swing.JCheckBoxMenuItem;
import javax.swing.JEditorPane;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
rfetch.setToolTipText(MessageManager.getString("label.retrieve_parse_sequence_database_records_alignment_or_selected_sequences"));\r
webService.add(rfetch);
+ final JCheckBoxMenuItem trimrs = new JCheckBoxMenuItem(MessageManager.getString("option.trim_retrieved_seqs"));
+ trimrs.setToolTipText(MessageManager.getString("label.trim_retrieved_sequences"));
+ trimrs.setSelected(Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true));
+ trimrs.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e) {
+ trimrs.setSelected(trimrs.isSelected());
+ Cache.setProperty("TRIM_FETCHED_DATASET_SEQS", Boolean.valueOf(trimrs.isSelected()).toString());
+ };
+ });
+ rfetch.add(trimrs);
JMenuItem fetchr = new JMenuItem(MessageManager.getString("label.standard_databases"));\r
fetchr.setToolTipText(MessageManager.getString("label.fetch_embl_uniprot"));\r
fetchr.addActionListener(new ActionListener()
private SequenceI[] alseqs;
+ /**
+ * when true - retrieved sequences will be trimmed to cover longest derived alignment sequence
+ */
+ private boolean trimDsSeqs=true;
+
public DBRefFetcher()
{
}
this.dataset = ds;
// TODO Jalview 2.5 lots of this code should be in the gui package!
sfetcher = jalview.gui.SequenceFetcher.getSequenceFetcherSingleton(af);
+ // set default behaviour for transferring excess sequence data to the dataset
+ trimDsSeqs = Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true);
if (sources == null)
{
// af.featureSettings_actionPerformed(null);
if (retrieved != null)
{
transferReferences(sdataset, dbsource.getDbSource(),
- retrieved);
+ retrieved,trimDsSeqs);
}
}
else
/**
* Verify local sequences in seqRefs against the retrieved sequence database
* records.
+ * @param trimDatasetSeqs
*
*/
void transferReferences(Vector sdataset, String dbSource,
- AlignmentI retrievedAl) // File
+ AlignmentI retrievedAl, boolean trimDatasetSeqs) // File
// file)
{
+ System.out.println("trimming ? "+trimDatasetSeqs);
if (retrievedAl == null || retrievedAl.getHeight() == 0)
{
return;