From b4643d75fb09207306e83fa1fee277cc2fd089c5 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Tue, 9 May 2023 11:19:37 +0100 Subject: [PATCH] JAL-629 Add --seqid for non-subval use, make arg value naming more consistent in docs --- .../help/html/features/clarguments-ng-summary.html | 59 +++-- help/help/html/features/clarguments-ng.html | 246 -------------------- src/jalview/bin/Commands.java | 31 ++- src/jalview/bin/argparser/Arg.java | 4 +- 4 files changed, 62 insertions(+), 278 deletions(-) diff --git a/help/help/html/features/clarguments-ng-summary.html b/help/help/html/features/clarguments-ng-summary.html index a85dc24..ef766b1 100644 --- a/help/help/html/features/clarguments-ng-summary.html +++ b/help/help/html/features/clarguments-ng-summary.html @@ -30,7 +30,7 @@ --open filename/URL ... - Opens one or more alignment files in new alignment windows. + Opens one or more alignment files filename or URLs URL in new alignment windows. Examples. @@ -51,10 +51,10 @@ --append filename/URL ... - Appends one or more alignment files to an open alignment window (or opens a new alignment if none already open). + Appends one or more alignment files filename or URLs URL to the open alignment window (or opens a new alignment if none already open). - colour=colourscheme, + colour=name, title=title, features=featurefile, annotations=annotationfile, @@ -70,15 +70,15 @@ - --title "title" - Specifies the title for the open alignment window. + --title "string"" + Specifies the title for the open alignment window as string. ✓ - --colour colourscheme - Applies the given colour scheme to the open alignment window. Valid values are: + --colour name + Applies the colour scheme name to the open alignment window. Valid values for nameare: clustal, blosum62, pc-identity, @@ -106,7 +106,7 @@ --features filename/URL - Add a feature file to the open alignment. + Add a feature file filename or URL URL to the open alignment. ✓ @@ -115,7 +115,7 @@ --tree filename/URL - Add a tree file to the open alignment. + Add a tree file filename or URL URL to the open alignment. ✓ @@ -130,25 +130,32 @@ --annotations filename/URL - Add an annotations file to the open alignment. + Add an annotations file filename or URL URL to the open alignment. ✓ - + --showannotations / --noshowannotations Enforces showing (or not showing) alignment annotations. ✓ - + + + --wrap / --nowrap + Enforces wrapped (or not wrapped) alignment formatting. + + ✓ + + --structure filename/URL - Load a structure file attached to a sequence in the open alignment. + Load a structure file filename or URL URL associated with a sequence in the open alignment. The sequence to be associated with can be specified with a following --seqid argument, or the subval modifier seqid=ID can be used. A subval INDEX can also be used to specify the INDEX-th sequence in the open alignment. - seqid=sequenceid or sequence index, + seqid=sequenceid or INDEX, paefile=paefilename, tempfac=temperature factor type, ssannotations, @@ -157,19 +164,27 @@ ✓ - - + + + + --seqid ID + Specify the sequence name for the preceding --structure to be associated with. + + ✓ + + + --paematrix filename - Add a PAE file to the preceding --structure + Add a PAE json matrix file filename to the preceding --structure. ✓ - + - --tempfac temperature factor type - Set the type of temperature factor. Possible values are + --tempfac name + Set the type of temperature factor. Possible values for name are default, plddt @@ -179,8 +194,8 @@ - --structureviewer structure viewer - Set the structure viewer to use to open the 3d structure file specified in previous --structure. Possible values are: + --structureviewer name + Set the structure viewer to use to open the 3d structure file specified in previous --structure to name. Possible values of name are:
none,
diff --git a/help/help/html/features/clarguments-ng.html b/help/help/html/features/clarguments-ng.html index dbef941..a6c91fe 100644 --- a/help/help/html/features/clarguments-ng.html +++ b/help/help/html/features/clarguments-ng.html @@ -321,251 +321,5 @@ - -

- Jalview processes arguments on the command line sequentially. If - you would like to pass a 'JVL' file containing - memory settings or any other launch - parameters, then include it at the beginning of the command line to - ensure they are processed before any remaining arguments. -
- Typical command line execution follows the following pattern: -

-  jalview -open <Alignment File/URL> [additional import arguments] [export arguments]
-  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-nodisplay
Run Jalview without - User Interface. (automatically disables questionnaire, version - and usage stats checks)
-nowebservicediscovery
Do not query configured servers to - discover web services (Since 2.11.2.0)
-open FILE/URL
Specify the alignment file to - open or process by providing additional arguments.
-props FILE/URL
Use the given Jalview properties - file instead of users default.
-setprop PROPERTY=value
(JalviewJS ONLY) sets the given - property to the given value
-features FILE/URL
-

- Use the given file to add sequence features to an alignment. - See Features - File (Known as Groups file prior to 2.08) description. -

- -
-
-colour COLOURSCHEME
-
Set the colourscheme for the alignment. This can be any - of the built-in colourschemes, a name of a predefined - colourscheme (defined in the Jalview properties file), or an - 'inline' colourscheme (see the applet's colour parameter for - more information).
-
-annotations FILE/URL
-
Add precalculated annotations to the alignment. See Annotation - File description. -
-
-no-annotation
-
Do not display annotation below the alignment. -
-
-tree FILE/URL
-
-
Load the given newick format tree file - onto the alignment
-
-
-questionnaire URL
-
-
Queries the given URL for information - about any Jalview user questionnaires
-
-
-noquestionnaire
-
-
Turn off questionnaire check
-
-
-nonews
-
-
- Disable check for Jalview - news on startup (not recommended other than for classroom / - demo usage) -
-
-
-nousagestats
-
-
Turn off google analytics usage tracking
-
-
-[no]sortbytree
-
-
Enable or disable automatic sorting of - associated view when a new tree is displayed
-
-
-groovy FILE/URL
-
-
Execute groovy script in FILE (where - FILE may be 'STDIN' to read from the standard input) after all - other arguments have been processed
-
-
-jabaws URL
-
-
Specify the URL of the preferred JABAWS - server
-
-
-fasta FILE
-
-
Create alignment file FILE in Fasta - format.
-
-clustal FILE
Create alignment file FILE in - Clustal format.
-msf FILE
Create alignment file FILE in MSF - format.
-pileup FILE
Create alignment file FILE in - Pileup format.
-pir FILE
Create alignment file FILE in PIR - format.
-pfam FILE
Create alignment file FILE in - PFAM format.
-blc FILE
Create alignment file FILE in BLC - format.
-json FILE
Create alignment file FILE in - JSON format.
-jalview FILE
Create alignment file FILE in - Jalview format.
-png FILE
Create PNG image FILE from - alignment.
-imgMap FILE
Create HTML file FILE with image - map of PNG image.
-eps FILE
Create EPS file FILE from - alignment.
-svg FILE
Create Scalable Vector Graphics - file FILE from alignment.
-biojsMSA FILE
Write an HTML page to display - the alignment with the - BioJS MSAviewer MSA -
-
-jvmmempc=PERCENT
Only available with standalone executable jar or jalview.bin.Launcher. - Limit maximum heap size (memory) to PERCENT% of total physical memory detected. - This defaults to 90 if total physical memory can be detected. - See Memory usage settings for Jalview for more details. -
-
-jvmmemmax=MAXMEMORY
Only available with standalone executable jar or jalview.bin.Launcher. - Limit maximum heap size (memory) to MAXMEMORY. MAXMEMORY can be specified in bytes, kilobytes(k), megabytes(m), - gigabytes(g) or if you're lucky enough, terabytes(t). - This defaults to 32g if total physical memory can be detected, or to 8g if total physical memory cannot be detected. - See Memory usage settings for Jalview for more details. -
-
diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index a0209fd..328c6e1 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -413,7 +413,7 @@ public class Commands { String val = av.getValue(); SubVals subVals = av.getSubVals(); - SequenceI seq = getSpecifiedSequence(af, subVals); + SequenceI seq = getSpecifiedSequence(af, avm, av); if (seq == null) { // Could not find sequence from subId, let's assume the first @@ -835,21 +835,34 @@ public class Commands return true; } - private SequenceI getSpecifiedSequence(AlignFrame af, SubVals subId) + private SequenceI getSpecifiedSequence(AlignFrame af, ArgValuesMap avm, + ArgValue av) { - if (subId == null) + SubVals subVals = av.getSubVals(); + ArgValue idAv = avm.getClosestNextArgValueOfArg(av, Arg.SEQID); + SequenceI seq = null; + if (subVals == null && idAv == null) return null; AlignmentI al = af.getCurrentView().getAlignment(); - if (subId.has("seqid")) + if (al == null) + return null; + if (subVals != null) { - return al.findName(subId.get("seqid")); + if (subVals.has("seqid")) + { + seq = al.findName(subVals.get("seqid")); + } + else if (-1 < subVals.getIndex() + && subVals.getIndex() < al.getSequences().size()) + { + seq = al.getSequenceAt(subVals.getIndex()); + } } - else if (-1 < subId.getIndex() - && subId.getIndex() < al.getSequences().size()) + else if (idAv != null) { - return al.getSequenceAt(subId.getIndex()); + seq = al.findName(idAv.getValue()); } - return null; + return seq; } // returns the first Arg value intended for the structure structFilename diff --git a/src/jalview/bin/argparser/Arg.java b/src/jalview/bin/argparser/Arg.java index 763a6f2..d77c075 100644 --- a/src/jalview/bin/argparser/Arg.java +++ b/src/jalview/bin/argparser/Arg.java @@ -17,7 +17,7 @@ public enum Arg TYPE, FORMAT, OVERWRITE, TEXTRENDERER, QUIT, CLOSE, DEBUG("d"), TRACE, QUIET("q"), ARGFILE, NEW, NPP("n++"), SUBSTITUTIONS, INITSUBSTITUTIONS, NIL, SPLASH, SETARGFILE, UNSETARGFILE, WEBSERVICEDISCOVERY, ALL, BACKUPS, - TESTOUTPUT; + TESTOUTPUT, SEQID; public static enum Opt { @@ -111,6 +111,8 @@ public enum Arg TITLE.setOptions(Opt.STRING, Opt.LINKED); PAEMATRIX.setOptions(Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS); + SEQID.setOptions(Opt.STRING, Opt.LINKED, Opt.MULTI, + Opt.ALLOWSUBSTITUTIONS); NOSTRUCTURE.setOptions(Opt.UNARY, Opt.LINKED); STRUCTURE.setOptions(Opt.STRING, Opt.LINKED, Opt.MULTI, Opt.ALLOWSUBSTITUTIONS); -- 1.7.10.2