label.load_features_annotations = Load Features/Annotations...
label.load_vcf = Load SNP variants from plain text or indexed VCF data
label.load_vcf_file = Load VCF File
+label.searching_vcf = Loading VCF variants...
+label.added_vcf = Added {0} VCF variants to {1} sequence(s)
label.export_features = Export Features...
label.export_annotations = Export Annotations...
label.to_upper_case = To Upper Case
label.overview = Overview
label.reset_to_defaults = Reset to defaults
label.oview_calc = Recalculating overview...
-label.feature_details = Feature details
\ No newline at end of file
+label.feature_details = Feature details
import jalview.io.gff.SequenceOntologyI;
import jalview.util.MapList;
import jalview.util.MappingUtils;
+import jalview.util.MessageManager;
import java.io.IOException;
import java.util.HashMap;
}
/**
- * Loads VCF on to an alignment - provided it can be related to one or more
- * sequence's chromosomal coordinates.
+ * Starts a new thread to query and load VCF variant data on to the alignment
* <p>
* This method is not thread safe - concurrent threads should use separate
* instances of this class.
*
* @param filePath
- * @param status
+ * @param gui
*/
- public void loadVCF(String filePath, AlignViewControllerGuiI status)
+ public void loadVCF(final String filePath,
+ final AlignViewControllerGuiI gui)
{
- VCFReader reader = null;
+ if (gui != null)
+ {
+ gui.setStatus(MessageManager.getString("label.searching_vcf"));
+ }
+
+ new Thread()
+ {
+
+ @Override
+ public void run()
+ {
+ VCFLoader.this.doLoad(filePath, gui);
+ }
+
+ }.start();
+ }
+ /**
+ * Loads VCF on to an alignment - provided it can be related to one or more
+ * sequence's chromosomal coordinates.
+ *
+ * @param filePath
+ * @param gui
+ */
+ protected void doLoad(String filePath, AlignViewControllerGuiI gui)
+ {
+ VCFReader reader = null;
try
{
// long start = System.currentTimeMillis();
transferAddedFeatures(seq);
}
}
- // long elapsed = System.currentTimeMillis() - start;
- String msg = String.format("Added %d VCF variants to %d sequence(s)",
- varCount, seqCount);
- if (status != null)
+ if (gui != null)
{
- status.setStatus(msg);
+ // long elapsed = System.currentTimeMillis() - start;
+ String msg = MessageManager.formatMessage("label.added_vcf",
+ varCount, seqCount);
+ gui.setStatus(msg);
+ gui.getFeatureSettingsUI().discoverAllFeatureData();
}
} catch (Throwable e)
{
System.err.println("Error processing VCF: " + e.getMessage());
e.printStackTrace();
+ if (gui != null)
+ {
+ gui.setStatus("Error occurred - see console for details");
+ }
} finally
{
if (reader != null)