/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
+ "-eps FILE\tCreate EPS file FILE from alignment.\n"
+ "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
+ "-noquestionnaire\tTurn off questionnaire check.\n"
+ + "-nousagestats\tTurn off google analytics tracking for this session.\n"
+ "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
- + "-setprop PROPERTY=VALUE\tSet the given Jalview property, after all other properties files have been read\n\t (quote the 'PROPERTY=VALUE' pair to ensure spaces are passed in correctly)"
+// + "-setprop PROPERTY=VALUE\tSet the given Jalview property, after all other properties files have been read\n\t (quote the 'PROPERTY=VALUE' pair to ensure spaces are passed in correctly)"
+ "-dasserver nickname=URL\tAdd and enable a das server with given nickname (alphanumeric or underscores only) for retrieval of features for all alignments.\n"
+"\t\tSources that also support the sequence command may be specified by prepending the URL with sequence:\n"
+"\t\t e.g. sequence:http://localdas.somewhere.org/das/source)\n"
+ "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
+// + "-vdoc vamsas-document\tImport vamsas document into new session or join existing session with same URN\n"
+// + "-vses vamsas-session\tJoin session with given URN\n"
+ "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)\n"
+ "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
System.exit(0);
System.out.println("No files to open!");
System.exit(1);
}
-
+ String vamsasImport=aparser.getValue("vdoc"),vamsasSession=aparser.getValue("vsess");
+ if (vamsasImport!=null || vamsasSession!=null)
+ {
+ if (desktop==null || headless)
+ {
+ System.out.println("Headless vamsas sessions not yet supported. Sorry.");
+ System.exit(1);
+ }
+ // if we have a file, start a new session and import it.
+ boolean inSession = false;
+ if (vamsasImport!=null)
+ {
+ try {
+ inSession = desktop.vamsasImport(new File(vamsasImport));
+
+ } catch (Exception e)
+ {
+ System.err.println("Exeption when importing "+vamsasImport+" as a vamsas document.");
+ e.printStackTrace();
+ }
+ if (!inSession) {
+ System.err.println("Failed to import "+vamsasImport+" as a vamsas document.");
+ } else {
+ System.out.println("Imported Successfully into new session "+desktop.getVamsasApplication().getCurrentSession());
+ }
+ }
+ if (vamsasSession!=null) {
+ if (vamsasImport!=null) {
+ // close the newly imported session and import the Jalview specific remnants into the new session later on.
+ desktop.vamsasStop_actionPerformed(null);
+ }
+ // now join the new session
+ try {
+ if (desktop.joinVamsasSession(vamsasSession)) {
+ System.out.println("Successfully joined vamsas session "+vamsasSession);
+ } else {
+ System.err.println("WARNING: Failed to join vamsas session "+vamsasSession);
+ }
+ } catch (Exception e)
+ {
+ System.err.println("ERROR: Failed to join vamsas session "+vamsasSession);
+ e.printStackTrace();
+ }
+ if (vamsasImport!=null) {
+ // the Jalview specific remnants can now be imported into the new session at the user's leisure.
+ Cache.log.info("Skipping Push for import of data into existing vamsas session."); // TODO: enable this when debugged
+ // desktop.getVamsasApplication().push_update();
+ }
+ }
+ }
+ // Finally, deal with the remaining input data.
if (file != null)
{
System.out.println("Opening file: " + file);
// We'll only open the default file if the desktop is visible.
// And the user
// ////////////////////
- if (!headless && file == null
+ if (!headless && file == null && vamsasImport==null
&& jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
{
file = jalview.bin.Cache.getDefault("STARTUP_FILE",