<classpathentry kind="lib" path="lib/VARNAv3-93.jar"/>
<classpathentry kind="lib" path="lib/jfreesvg-2.1.jar"/>
<classpathentry kind="lib" path="lib/quaqua-filechooser-only-8.0.jar"/>
+ <classpathentry kind="lib" path="lib/VAqua4.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
quaqua: v.8.0 (latest stable) by Randel S Hofer. LGPL and BSD Modified license: downloaded from http://www.randelshofer.ch/quaqua/
+vaqua: v4 (latest stable) by Alan Snyder et al. GPLv2 with Classpathe xception, also includes contributions from Quaqua: ownloaded from http://violetlib.org/vaqua/overview.html
+
lib/htsjdk-1.120-SNAPSHOT.jar: (currently not required for 2.10) built from maven master at https://github.com/samtools/htsjdk MIT License to Broad Institute
lib/biojava-core-4.1.0.jar LGPLv2.1 - latest license at https://github.com/biojava/biojava/blob/master/LICENSE
<mapID target="pdbmcviewer" url="html/features/pdbviewer.html"/>
<mapID target="pdbjmol" url="html/features/jmol.html"/>
<mapID target="chimera" url="html/features/chimera.html"/>
+ <mapID target="chimera.annotxfer" url="html/features/chimera.html#annotxfer"/>
<mapID target="varna" url="html/features/varna.html"/>
<mapID target="xsspannotation" url="html/features/xsspannotation.html"/>
<mapID target="preferences" url="html/features/preferences.html"/>
<tocitem text="Jalview Documentation" target="home" expand="true">
<tocitem text="What's new" target="new" expand="true">
<tocitem text="Latest Release Notes" target="release"/>
+ <tocitem text="Structure Chooser" target="pdbchooser"/>
+ <tocitem text="Chimera Annotation Exchange" target="chimera.annotxfer"/>
</tocitem>
<tocitem text="Editing Alignments" target="edit" />
structure in the alignment. The regions used to calculate
the superposition will be highlighted using the 'Cartoon'
rendering style, and the remaining data shown as a chain
- trace.<br/><br/>
+ trace.<br />
+ <br />
</em></li>
- <li><strong><a name="experimental">EXPERIMENTAL FEATURES</a></strong><br/>
- <em>
- These are only available if the <strong>Tools→Enable
- Experimental Features</strong> option is enabled. (Since Jalview 2.10.2)</em>
- <ul>
- <li><strong>Write Jalview features</strong><br /> <em>Selecting
- this option will create new residue attributes for any
- features currently visible in the associated alignment
- views, allowing those positions to be selected and
- analysed with via Chimera's 'Render by Attribute' tool
- (found in the Tools submenu called Structure Analysis).<br />
- <br />If you use this option, please remember to select
- the <em>Refresh Menus</em> option in Chimera's Render by
- Attribute dialog box in order to see the attributes
- derived from Jalview sequence features.
- </em><br />
- <a href="https://issues.jalview.org/browse/JAL-2295">View
- this function's issue in Jalview's bug tracker</a></li>
- <li><strong>Fetch Chimera Attributes</strong><br /> <em>This
- submenu lists available Chimera residue attributes that
- can be imported as Jalview features on associated
- sequences.<br />This is particularly useful for
- transferring quantitative positional annotation. For
- example, structure similarity for an alignment can be
- visualised by transferring the local RMSD attributes
- generated by Chimera's Match->Align tool onto aligned
- sequences and displayed with a <a
- href="featureschemes.html">Graduated feature colour
- scheme</a>.
- </em><a href="https://issues.jalview.org/browse/JAL-2296">View
- this function's issue in Jalview's bug tracker</a></li>
- </ul></li>
- <li><strong>Help<br>
+ <li><a name="annotxfer"><strong>Write Jalview
+ features</strong></a><br /> <em>Selecting this option will create
+ new residue attributes for any features currently visible in
+ the associated alignment views, allowing those positions to
+ be selected and analysed with via Chimera's 'Render by
+ Attribute' tool (found in the Tools submenu called Structure
+ Analysis).<br /> <br />If you use this option, please
+ remember to select the <em>Refresh Menus</em> option in
+ Chimera's Render by Attribute dialog box in order to see the
+ attributes derived from Jalview sequence features.
+ </em></li>
+ <li><strong>Fetch Chimera Attributes</strong><br /> <em>This
+ submenu lists available Chimera residue attributes that can
+ be imported as Jalview features on associated sequences.<br />This
+ is particularly useful for transferring quantitative
+ positional annotation. For example, structure similarity for
+ an alignment can be visualised by transferring the local
+ RMSD attributes generated by Chimera's Match->Align tool
+ onto aligned sequences and displayed with a <a
+ href="featureschemes.html">Graduated feature colour
+ scheme</a>. </li>
+ </ul></li>
+ <li><strong>Help<br>
</strong>
<ul>
<li><strong>Chimera Help<br>
</p> -->
<p>
<a name="align"><strong>Superposing structures based on
- their aligned sequences</strong></a><br> If several structures are
- available on the alignment, you may add additional structures to an
- existing Jmol view by selecting their entry in the appropriate
- pop-up menu. Jalview will ask you if you wish to add the structure
- to the existing alignment, and if you do, it will import and
- superimpose the new PDB file using the corresponding positions from
- the alignment. If the alignment is subsequently edited, you can use
- the <a href="#sAlign"><em>Jmol→Align</em></a> menu option from
- the menu bar of the structure view window to superpose the
- structures using the updated alignment.<br> <em>Sequence
+ their aligned sequences</strong></a><br> If several structures are shown
+ in a view, you can superimpose them using the corresponding
+ positions from the alignment via the <a href="#sAlign"><em>Jmol→Align</em></a>
+ menu option from the menu bar of the structure view window. <br> <em>Sequence
based structure superposition was added in Jalview 2.6</em>
</p>
<p>
and PDB file association (if available). The Jalview id/start-end
option is ignored if Modeller output is selected.
<p>
- <a name="editing"><strong>e"Editinge" Preferences tab</strong></a>
+ <a name="editing"><strong>"Editing" Preferences tab</strong></a>
</p>
<p>There are currently three options available which can be
selected / deselected.</p>
<body>
<p>
- <strong>Structure Chooser</strong>
+ <strong>Structure Chooser Dialog Box</strong>
</p>
<p>
- The Structure Chooser interface allows you to interactively select
- which PDB structures to view for the currently selected set of
+ The Structure Chooser allows you to select
+ 3D structures to view for the currently selected set of
sequences. It is opened by selecting the <strong>"3D
- Structure Data.."</strong> option from the Sequence ID panel's <a
+ Structure Data..."</strong> option from the Sequence ID panel's <a
href="../menus/popupMenu.html">pop-up menu</a>. The dialog
provides:
</p>
<p>
<strong>Selecting and Viewing Structures</strong>
</p>
+ <p>The drop-down menu offers different options for structure
+ discovery; the 'Cached' view is shown automatically if existing
+ structure data has been imported for the selected sequences, and if
+ none is available, the import PDB/mmCIF file options are shown.</p>
<p>
Once one or more structures have been selected, pressing the <strong>View</strong>
- button will import them into <a
+ or <strong>Add</strong> button will import them <a
href="viewingpdbs.html#afterviewbutton">a new or existing
- structure view</a>.
+ structure view</a>. When multiple views are available, use the
+ drop-down menu to pick the target viewer for the structures.
</p>
<p>
<strong>Automated discovery of structure data</strong>
criteria (e.g. worst quality rather than best).</p>
<p>
- <img src="schooser_main.png" style="width: 464px; height: 369px;">
+ <img src="schooser_main.png" style="width: 499px; height: 437px;">
<!-- <p><img src="schooser_config.png" style="width: 463px; height: 369px; ">
<p><img src="schooser_drop-down.png" style="width: 464px; height: 368px; ">
<p><img src="schooser_enter-id.png" style="width: 467px; height: 373px; ">
<p><img src="schooser_from-file.png" style="width: 468px; height: 370px; ">
<p><img src="schooser_cached.png"> -->
- <br>The screenshot above shows the Structure Chooser interface
- along with the meta-data of auto-discovered structures for the
- sample alignment. If no structures were
- auto-discovered, options for manually associating PDB records will be shown (see below).
- <p>
+ <br>The screenshot above shows the Structure Chooser displayed after
+ selecting all the sequences in the Jalview example project. If no
+ structures were auto-discovered, options for manually associating
+ PDB records will be shown (see below).<p>
<strong>Exploration of meta-data for available structures</strong>
</p>
<p>Information on each structure available is displayed in columns
Columns' tab and tick the columns which you want to see.</p>
<p>
<img src="schooser_enter-id.png"
- style="width: 464px; height: 369px;">
+ style="width: 464px; height: 173px;">
<br/>
<strong>Manual selection/association of PDB files with
Sequences</strong>
provided it is installed and can be launched by Jalview. The default
viewer can be configured in the <a href="preferences.html#structure">Structure
tab</a> in the <strong>Tools→Preferences</strong> dialog box.
+
<p>
Structure data imported into Jalview can also be processed to
display secondary structure and temperature factor annotation. See
for more information.
</p>
<p>
- <strong><a name="afterviewbutton">After pressing the
- 'View' button in the Structure Chooser</a></strong><br /> The behaviour of
- the 'View' button depends on the number of structures selected, and
- whether structure views already exist for the selected structures or
- aligned sequences.
+ <img src="schooser_viewbutton.png"
+ style="width: 465px; height: 81px" /><br/> <strong><a
+ name="afterviewbutton">Controlling where the new structures
+ will be shown</a></strong>
+ <br />The Structure Chooser offers several options
+ for viewing a structure. <br/><strong>New View</strong> will open a new
+ structure viewer for the selected structures, but if there are views
+ already open, you can select which one to use, and press the <strong>Add</strong>
+ button. Jalview can automatically superimpose new structures based
+ on the linked alignments - but if this is not desirable, simple
+ un-tick the <strong>Superpose Structures</strong> checkbox.
+
</p>
- <p>If multiple structures are selected, then Jalview will always
- create a new structure view. The selected structures will be
- imported into this view, and superposed with the matched positions
- from the aligned sequences. A message in the structure viewer's
- status bar will be shown if not enough aligned columns were
- available to perform a superposition.</p>
<p>
- If a <strong>single</strong> PDB structure is selected, one of the
- following will happen:
+ <em>Superposing structures</em><br/>Jalview superposes structures using
+ the visible portions of any associated sequence alignments. A
+ message in the structure viewer's status bar will be shown if not
+ enough aligned columns were available to perform a superposition.
</p>
-
- <ul>
- <li>If no structures are open, then an interactive display of
- the structure will be opened in a new window.</li>
-
- <li>If another structure is already shown for the current
- alignment, then you will be asked if you want to add and <a
- href="jmol.html#align"></a> to the structure in the existing view.
- (<em>new feature in Jalview 2.6</em>).
- </li>
-
- <li>If the structure is already shown, then you will be
- prompted to associate the sequence with an existing view of the
- selected structure. This is useful when working with multi-domain
- or multi-chain PDB files.</li>
-
- <li style="list-style: none">See the <a href="jmol.html">Jmol
- </a> and <a href="chimera.html">Chimera</a> PDB viewer help pages for
- more information about the display.
- </li>
- </ul>
-
+ <p>
+ See the <a href="jmol.html">Jmol
+ </a> and <a href="chimera.html">Chimera</a> help pages for
+ more information about their capabilities.</p>
+
<p>
<strong>Retrieving sequences from the PDB</strong><br>You can
the <a href="../features/groovy.html">Groovy Console</a> for
interactive scripting.
</em><strong><br></strong></li>
- <li><strong>Enable Experimental Features</strong> <em>Enable or disable <a href="../whatsNew.html#experimental">features still under development</a> in Jalview's user interface. This setting is remembered in your preferences.</em>
+ <!-- <li><strong>Enable Experimental Features</strong> <em>Enable or disable <a href="../whatsNew.html#experimental">features still under development</a> in Jalview's user interface. This setting is remembered in your preferences.</em> -->
</ul></li>
<li><strong>Vamsas</strong> <em>For more details, read the
<tr>
<td width="60" nowrap>
<div align="center">
- <strong><a name="Jalview.2.10.4">2.10.4</a><br /> <em>27/02/2018</em></strong>
+ <strong><a name="Jalview.2.10.4">2.10.4</a><br /> <em>8/05/2018</em></strong>
</div>
</td>
<td><div align="left">
<em></em>
<ul>
<li>
- <!-- JAL-984 -->Mouse cursor changes to indicate Sequence ID and annotation area margins can be click-dragged to adjust them.</li>
+ <!-- JAL-1847 JAL-2944 -->New Structure Chooser control
+ for disabling automatic superposition of multiple
+ structures and open structures in existing views
+ </li>
+ <li>
+ <!-- JAL-984 -->Mouse cursor changes to indicate Sequence
+ ID and annotation area margins can be click-dragged to
+ adjust them.
+ </li>
+ <li>
+ <!-- JAL-2885 -->Jalview uses HTTPS for Uniprot, Xfam and
+ Ensembl services
+ </li>
<li>
- <!-- JAL-2885 -->Jalview uses HTTPS for Uniprot, Xfam and Ensembl services
+ <!-- JAL-2759 -->Improved performance for large alignments
+ and lots of hidden columns
</li>
<li>
- <!-- JAL-2759 -->Improved performance for large alignments and lots of hidden columns
+ <!-- JAL-2593 -->Improved performance when rendering lots
+ of features (particularly when transparency is disabled)
</li>
</ul>
</div>
<td><div align="left">
<ul>
<li>
- <!-- JAL-2778 -->Slow redraw when Overview panel shown overlapping alignment panel
+ <!-- JAL-2899 -->Structure and Overview aren't updated
+ when Colour By Annotation threshold slider is adjusted
+ </li>
+ <li>
+ <!-- JAL-2778 -->Slow redraw when Overview panel shown
+ overlapping alignment panel
+ </li>
+ <li>
+ <!-- JAL-2929 -->overview doesn't show end of unpadded
+ sequence as gaps
+ </li>
+ <li>
+ <!-- JAL-2789, JAL-2893 -->Cross-reference handling improved: CDS not handled correctly if transcript has no UTR
+ </li>
+ <li>
+
+ </li>
+ <li>
+ <!-- JAL-2666 -->Linked scrolling via protein horizontal
+ scroll bar doesn't work for some CDS/Protein views
+ </li>
+ <li>
+ <!-- JAL-2930 -->Trackpad scrolling is broken on OSX on
+ Java 1.8u153 onwards and Java 1.9u4+.
+ </li>
+ <li>
+ <!-- JAL-2924 -->Tooltip shouldn't be displayed for empty
+ columns in annotation row
+ </li>
+ <li>
+ <!-- JAL-2913 -->Preferences panel's ID Width control is
+ honored in interactive and batch mode
+ </li>
+ <li>
+ <!-- JAL-2945 -->Linked sequence highlighting doesn't work
+ for structures added to existing Jmol view
+ </li>
+ <li>
+ <!-- JAL-2223 -->'View Mappings' includes duplicate
+ entries after importing project with multiple views
+ </li>
+ <li>
+ <!-- JAL-2781 JAL-2780 -->Viewing or annotating Uniprot
+ protein sequences via SIFTS from associated PDB entries
+ with negative residue numbers or missing residues fails
+ </li>
+ <li>
+ <!-- JAL-2952 -->Exception when shading sequence with negative
+ Temperature Factor values from annotated PDB files (e.g.
+ as generated by CONSURF)
</li>
<li>
- <!-- JAL-2666 -->Linked scrolling via protein horizontal scroll bar doesn't work for some CDS/Protein views
+ <!-- JAL-2922 -->Invert displayed features very slow when
+ structure and/or overview windows are also shown
+ </li>
+ <li>
+ <!-- JAL-2954 -->Selecting columns from highlighted regions
+ very slow for alignments with large numbers of sequences
+ </li>
+ <li>
+ <!-- JAL-2925 -->Copy Consensus fails for group consensus
+ with 'StringIndexOutOfBounds'
+ </li>
+ <li>
+ <!-- JAL-2976 -->VAqua(4) provided as fallback Look and Feel for OSX
+ platforms running Java 10
+ </li>
+ <li>
+ <!-- JAL-2960 -->Adding a structure to existing structure
+ view appears to do nothing because the view is hidden behind the alignment view
</li>
- <li><!-- JAL-2930 -->Trackpad scrolling is broken on OSX on Java 1.8u153 onwards and Java 1.9u4+.</li>
- <li><!-- JAL-2924 -->Tooltip shouldn't be displayed for empty columns in annotation row</li>
- <li><!-- JAL-2913 -->Preferences panel's ID Width control is honored in interactive and batch mode</li>
- </ul><em>Applet</em><ul>
- <li><!-- JAL-2926 -->Copy consensus sequence option in applet should copy the group consensus when popup is opened on it</li>
-
</ul>
- </div>
- </td>
+ <em>Applet</em>
+ <ul>
+ <li>
+ <!-- JAL-2926 -->Copy consensus sequence option in applet
+ should copy the group consensus when popup is opened on it
+ </li>
+ </ul>
+ <em>Batch Mode</em>
+ <ul>
+ <li>
+ <!-- JAL-2913 -->Fixed ID width preference is not respected
+ </li>
+ </ul>
+ <em>New Known Defects</em>
+ <ul>
+ <li>
+ <!-- JAL-2973 --> Exceptions occasionally raised when
+ editing a large alignment and overview is displayed
+ </li>
+ <li>
+ <!-- JAL-2974 -->'Overview updating' progress bar is shown
+ repeatedly after a series of edits even when the overview
+ is no longer reflecting updates
+ </li>
+ <li>
+ <!-- JAL-2946 -->'SIFTS Mapping Error' when viewing
+ structures for protein subsequence (if 'Trim Retrieved
+ Sequences' enabled) or Ensembl isoforms (Workaround in
+ 2.10.4 is to fail back to N&W mapping)
+ </li>
+ </ul>
+ </div>
+ </td>
</tr>
<tr>
<td width="60" nowrap>
<strong>What's new in Jalview 2.10.4 ?</strong>
</p>
<p>
- This is the February 2018 release of Jalview, with several minor bug fixes and enhanvements.
- The full list bugs fixed in this release can be found in the <a href="releases.html#Jalview.2.10.4">2.10.4
- Release Notes</a>. In addition, Jalview 2.10.4 provides:
+ This is the May 2018 release of Jalview, and the last in the 2.10.x series. Jalview 2.10.4 includes:
</p>
<ul>
- <li></li>
+ <li>Numerous efficiency improvements in the renderer and overview when working with large alignments with lots of hidden columns</li>
+ <li>Use of HTTPS when connecting to Uniprot, Ensembl and other EBI web services</li>
+ <li>Critical patches for running Jalview on OSX with Java 10</li>
+ <li>Easier adjustment of the Alignment ID panel and Annotation panel</li>
+ <li>Improved support for mapping between 3D Structures and Uniprot Protein Sequences</li>
+ <li>Improved support for discovering CDS and transcripts for Proteins and Ensembl gene IDs</li>
+ <li>New buttons on the Structure Chooser for adding structures
+ to an existing view, and disabling automatic superposition
+ according to linked alignments</li>
+ <li>Annotation transfer between Chimera and Jalview <em>(formerly only
+ available in 'Experimental' mode)</em></li>
</ul>
<p>
- <strong><a name="experimental">Experimental Features</a></strong>
+ The full list of bugs fixed in this release can be found in the <a href="releases.html#Jalview.2.10.4">2.10.4
+ Release Notes</a>.
</p>
- <p>
- Remember, please enable the <em>Experimental Features</em> option in
- the Jalview Desktop's <em>Tools</em> menu, and then restart Jalview
- if you want to try out features below:
- </p>
- <ul>
- <li><em>Annotation transfer between Chimera and Jalview</em><br />Two
- <a href="features/chimera.html#experimental">new entries in
- the Chimera viewer's Chimera menu</a> allow positional annotation to
- be exchanged between Chimera and Jalview.</li>
- </ul>
-
</body>
</html>
label.enter_view_name = Enter View Name
label.enter_label = Enter label
label.enter_label_for_the_structure = Enter a label for the structure
-label.pdb_entry_is_already_displayed = {0} is already displayed.\nDo you want to re-use this viewer ?
-label.map_sequences_to_visible_window = Map Sequences to Visible Window: {0}
-label.add_pdbentry_to_view = Do you want to add {0} to the view called\n{1}\n
-label.align_to_existing_structure_view = Align to existing structure view
label.pdb_entries_couldnt_be_retrieved = The following pdb entries could not be retrieved from the PDB\:\n{0}\nPlease retry, or try downloading them manually.
label.couldnt_load_file = Couldn't load file
label.couldnt_find_pdb_id_in_file = Couldn't find a PDB id in the file supplied. Please enter an Id to identify this structure.
label.result = result
label.results = results
label.structure_chooser = Structure Chooser
-label.select = Select :
label.invert = Invert
label.select_pdb_file = Select PDB File
info.select_filter_option = Select Filter Option/Manual Entry
label.trim_termini = Trim Non-Matching Termini
label.trim_termini_desc = If true, non-matching regions on either end of the resulting alignment are removed.
label.no_of_sequences = Number of sequences returned
+label.reporting_cutoff = Reporting Cut-off
label.freq_alignment = Use alignment background frequencies
label.freq_uniprot = Use Uniprot background frequencies
label.hmmalign_options = hmmalign options
label.number_of_results = Number of Results to Return
label.auto_align_seqs = Automatically Align Fetched Sequences
label.use_accessions = Return Accessions
-label.seq_e_value = Sequence E-value Cutoff
+label.seq_evalue = Sequence E-value Cut-off
label.seq_score = Sequence Score Threshold
-label.dom_e_value = Domain E-value Cutoff
+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.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
-label.dom_e_value_desc = The E-value cutoff for returned domains (hmmsearch -domE)
-label.dom_score_desc = The score threshold for returned domains
+label.seq_score_desc = The score threshold for returned sequences (hmmsearch -T)
+label.dom_e_value_desc = The E-value cutoff for returned domains (hmmsearch --domE)
+label.dom_score_desc = The score threshold for returned domains (hmmsearch --domT)
label.add_database = Add Database
label.this_alignment = This alignment
warn.invalid_format = This is not a valid database file format. The current supported formats are Fasta, Stockholm and Pfam.
label.enter_view_name = Introduzca un nombre para la vista
label.enter_label = Introducir etiqueta
label.enter_label_for_the_structure = Introducir una etiqueta para la estructura
-label.pdb_entry_is_already_displayed = {0} Ya est\u00E1 mostrado.\nQuieres volver a usar este visor?
-label.map_sequences_to_visible_window = Mapa de secuencias en ventana visible: {0}
-label.add_pdbentry_to_view = Quieres a\u00F1adir {0} a la vista llamada\n{1}\n
-label.align_to_existing_structure_view = Alinear a una estructura ya existente
label.pdb_entries_couldnt_be_retrieved = Las siguientes entradas pdb no pueden ser extra\u00EDdas del PDB\:\n{0}\nPor favor, prueba descarg\u00E1ndolas manualmente.
label.couldnt_load_file = No se pudo cargar el fichero
label.couldnt_find_pdb_id_in_file = No se pudo encontrar un Id PDB en el fichero suministrado. Por favor, introduzca un Id para identificar esta estructura.
label.scale_protein_to_cdna=Adaptar proteÃna a cDNA
label.scale_protein_to_cdna_tip=Hacer a los residuos de proteÃnas de la misma anchura que los codones en ventanas divididas
status.loading_cached_pdb_entries=Cargando Entradas PDB en Caché
-label.select=Seleccionar :
label.select_by_annotation=Seleccionar/Ocultar Columnas por Anotación
action.select_by_annotation=Seleccionar/Ocultar Columnas por Anotación...
action.export_features=Exportar CaracterÃsticas
</xs:attribute>
</xs:complexType>
</xs:element>
+ <xs:element name="hmmerProfile" minOccurs="0" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>name of the project jar entry that holds the HMM file with the profile for the sequence</xs:documentation>
+ </xs:annotation>
+ </xs:element>
</xs:sequence>
<xs:attribute name="colour" type="xs:int" use="optional" />
<xs:attribute name="start" type="xs:int" use="required" />
public String id;
- public Vector<Bond> bonds = new Vector<Bond>();
+ public Vector<Bond> bonds = new Vector<>();
- public Vector<Atom> atoms = new Vector<Atom>();
+ public Vector<Atom> atoms = new Vector<>();
- public Vector<Residue> residues = new Vector<Residue>();
+ public Vector<Residue> residues = new Vector<>();
public int offset;
boolean deoxyn = false;
boolean nucleotide = false;
StringBuilder seq = new StringBuilder(256);
- Vector<SequenceFeature> resFeatures = new Vector<SequenceFeature>();
- Vector<Annotation> resAnnotation = new Vector<Annotation>();
- int i, iSize = atoms.size() - 1;
+ Vector<SequenceFeature> resFeatures = new Vector<>();
+ Vector<Annotation> resAnnotation = new Vector<>();
+ int iSize = atoms.size() - 1;
int resNumber = -1;
char insCode = ' ';
- for (i = 0; i <= iSize; i++)
+
+ for (int i = 0; i <= iSize; i++)
{
Atom tmp = atoms.elementAt(i);
resNumber = tmp.resNumber;
offset = resNumber;
}
- Vector<Atom> resAtoms = new Vector<Atom>();
+ Vector<Atom> resAtoms = new Vector<>();
// Add atoms to a vector while the residue number
// remains the same as the first atom's resNumber (res)
while ((resNumber == res) && (ins == insCode) && (i < atoms.size()))
if (StructureImportSettings.isShowSeqFeatures())
{
- for (i = 0, iSize = resFeatures.size(); i < iSize; i++)
+ iSize = resFeatures.size();
+ for (int i = 0; i < iSize; i++)
{
sequence.addSequenceFeature(resFeatures.elementAt(i));
resFeatures.setElementAt(null, i);
if (visibleChainAnnotation)
{
Annotation[] annots = new Annotation[resAnnotation.size()];
- float max = 0;
- for (i = 0, iSize = annots.length; i < iSize; i++)
+ float max = 0f;
+ float min = 0f;
+ iSize = annots.length;
+ for (int i = 0; i < iSize; i++)
{
annots[i] = resAnnotation.elementAt(i);
- if (annots[i].value > max)
- {
- max = annots[i].value;
- }
+ max = Math.max(max, annots[i].value);
+ min = Math.min(min, annots[i].value);
resAnnotation.setElementAt(null, i);
}
AlignmentAnnotation tfactorann = new AlignmentAnnotation(
"Temperature Factor", "Temperature Factor for " + pdbid + id,
- annots, 0, max, AlignmentAnnotation.LINE_GRAPH);
+ annots, min, max, AlignmentAnnotation.LINE_GRAPH);
tfactorann.setSequenceRef(sequence);
sequence.addAlignmentAnnotation(tfactorann);
}
*/
package jalview.api.structures;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
import jalview.schemes.ColourSchemeI;
import jalview.structures.models.AAStructureBindingModel;
*/
boolean hasMapping();
+ /**
+ * Checks if the PDB file is already loaded in this viewer, if so just adds
+ * mappings as necessary and answers true, else answers false. This supports
+ * the use case of adding additional chains of the same structure to a viewer.
+ *
+ * @param seq
+ * @param chains
+ * @param apanel
+ * @param pdbId
+ * @return
+ */
+ boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
+ AlignmentViewPanel apanel, String pdbId);
+
+ /**
+ * Adds one or more chains (sequences) of a PDB structure to this structure
+ * viewer
+ *
+ * @param pdbentry
+ * @param seq
+ * @param chains
+ * @param apanel
+ * @param pdbId
+ * @return
+ */
+ void addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
+ String[] chains, AlignmentViewPanel apanel, String pdbId);
+
+ /**
+ * refresh GUI after reconfiguring structure(s) and alignment panels
+ */
+ void updateTitleAndMenus();
+
+ /**
+ * Answers true if the viewer should attempt to align any added structures,
+ * else false
+ *
+ * @return
+ */
+ boolean isAlignAddedStructures();
+
+ /**
+ * Sets the flag for whether added structures should be aligned
+ *
+ * @param alignAdded
+ */
+ void setAlignAddedStructures(boolean alignAdded);
+
+ /**
+ * Raise the panel to the top of the stack...
+ */
+ void raiseViewer();
+
}
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception ex)
{
+ System.err.println("Unexpected Look and Feel Exception");
+ ex.printStackTrace();
}
if (Platform.isAMac())
{
System.err.println(
"Failed to set QuaQua look and feel: " + e.toString());
}
+ if (!ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel()
+ .equals(UIManager.getLookAndFeel()))
+ {
+ try
+ {
+ System.err.println(
+ "Quaqua LaF not available. Using VAqua(4).");
+ // UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel");
+ } catch (Throwable e)
+ {
+ System.err.println(
+ "Failed to reset look and feel: " + e.toString());
+ }
+ }
}
/*
package jalview.datamodel;
-import jalview.bin.Cache;
import jalview.io.HMMFile;
import jalview.schemes.ResidueProperties;
import jalview.util.Comparison;
this.hmmSeq = sq;
if (sq.getDatasetSequence() == hmm.mapToHmmConsensus.getTo())
{
+ // same dataset sequence e.g. after realigning search results
this.mapToHmmConsensus = hmm.mapToHmmConsensus;
}
else
{
- Cache.log.error("Error: HMM copied with change of mapped sequence");
+ // different dataset sequence e.g. after loading HMM from project
+ this.mapToHmmConsensus = new Mapping(sq.getDatasetSequence(),
+ hmm.mapToHmmConsensus.getMap());
}
}
{
int count = 0;
BitSet mask = new BitSet();
+ int startRes = sqcol.getStartRes();
+ int endRes = sqcol.getEndRes();
+
for (SequenceI s : sqcol.getSequences())
{
- int[] cols = getResults(s, sqcol.getStartRes(), sqcol.getEndRes());
+ int[] cols = getResults(s, startRes, endRes);
if (cols != null)
{
for (int pair = 0; pair < cols.length; pair += 2)
* @param curs
* @return
*/
- protected int findIndex(int pos, SequenceCursor curs)
+ protected int findIndex(final int pos, SequenceCursor curs)
{
if (!isValidCursor(curs))
{
while (newPos != pos)
{
col += delta; // shift one column left or right
- if (col < 0 || col == sequence.length)
+ if (col < 0)
{
break;
}
+ if (col == sequence.length)
+ {
+ col--; // return last column if we failed to reach pos
+ break;
+ }
if (!Comparison.isGap(sequence[col]))
{
newPos += delta;
}
col++; // convert back to base 1
- updateCursor(pos, col, curs.firstColumnPosition);
+
+ /*
+ * only update cursor if we found the target position
+ */
+ if (newPos == pos)
+ {
+ updateCursor(pos, col, curs.firstColumnPosition);
+ }
return col;
}
lastCommand = command;
}
+ Thread colourby = null;
/**
* Sends a set of colour commands to the structure viewer
*
*/
@Override
protected void colourBySequence(
- StructureMappingcommandSet[] colourBySequenceCommands)
+ final StructureMappingcommandSet[] colourBySequenceCommands)
{
- for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands)
+ if (colourby != null)
{
- for (String cbyseq : cpdbbyseq.commands)
+ colourby.interrupt();
+ colourby = null;
+ }
+ colourby = new Thread(new Runnable()
+ {
+ @Override
+ public void run()
{
- executeWhenReady(cbyseq);
+ for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands)
+ {
+ for (String cbyseq : cpdbbyseq.commands)
+ {
+ executeWhenReady(cbyseq);
+ }
+ }
}
- }
+ });
+ colourby.start();
}
/**
try
{
// recover PDB filename for the model hovered over.
- int _mp = _modelFileNameMap.length - 1,
- mnumber = new Integer(mdlId).intValue() - 1;
- while (mnumber < _modelFileNameMap[_mp])
+ int mnumber = new Integer(mdlId).intValue() - 1;
+ if (_modelFileNameMap != null)
{
- _mp--;
+ int _mp = _modelFileNameMap.length - 1;
+
+ while (mnumber < _modelFileNameMap[_mp])
+ {
+ _mp--;
+ }
+ pdbfilename = modelFileNames[_mp];
}
- pdbfilename = modelFileNames[_mp];
- if (pdbfilename == null)
+ else
{
- pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
- .getAbsolutePath();
- }
+ if (mnumber >= 0 && mnumber < modelFileNames.length)
+ {
+ pdbfilename = modelFileNames[mnumber];
+ }
+ if (pdbfilename == null)
+ {
+ pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
+ .getAbsolutePath();
+ }
+ }
} catch (Exception e)
{
}
public boolean equals(Object otherObject)
{
FTSDataColumnI that = (FTSDataColumnI) otherObject;
- return this.getCode().equals(that.getCode())
+ return otherObject == null ? false
+ : this.getCode().equals(that.getCode())
&& this.getName().equals(that.getName())
&& this.getGroup().equals(that.getGroup());
}
import java.util.Arrays;
import java.util.Deque;
import java.util.Enumeration;
-import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
-import java.util.Map;
import java.util.Scanner;
import java.util.Vector;
public class AlignFrame extends GAlignFrame implements DropTargetListener,
IProgressIndicator, AlignViewControllerGuiI, ColourChangeListener
{
-
- Map<String, Float> distribution = new HashMap<>(); // temporary
-
public static final int DEFAULT_WIDTH = 700;
public static final int DEFAULT_HEIGHT = 500;
}
String path = openFileChooser(false);
- if (new File(path).exists())
+ if (path != null && new File(path).exists())
{
IdentifyFile identifier = new IdentifyFile();
FileFormatI format = identifier.identify(path, DataSourceType.FILE);
MessageManager.getString("warn.invalid_format"));
}
}
- else
- {
- JOptionPane.showMessageDialog(this,
- MessageManager.getString("label.not_enough_sequences"));
- }
}
/**
- * Opens a file chooser
+ * Opens a file chooser, optionally restricted to selecting folders
+ * (directories) only. Answers the path to the selected file or folder, or
+ * null if none is chosen.
*
- * @param forFolder
+ * @param
* @return
*/
protected String openFileChooser(boolean forFolder)
{
+ // TODO duplicates GPreferences method - relocate to JalviewFileChooser?
String choice = null;
JFileChooser chooser = new JFileChooser();
if (forFolder)
}
}
+ @Override
+ protected void sliderDragReleased()
+ {
+ super.sliderDragReleased();
+ ap.paintAlignment(true, true);
+ }
+
}
@Override
public void mouseReleased(MouseEvent evt)
{
- if (sliderDragging)
- {
- sliderDragging = false;
- valueChanged(true);
- }
+ sliderDragReleased();
}
});
}
{
this.annotations = anns;
}
+
+ protected void sliderDragReleased()
+ {
+ if (sliderDragging)
+ {
+ sliderDragging = false;
+ valueChanged(true);
+ }
+ }
}
import java.util.Vector;
import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;
private static final String SPACE = " ";
- private static final String BACKSLASH = "\"";
+ private static final String QUOTE = "\"";
AppJmolBinding jmb;
{
return progressBar;
}
+
/**
- * add a single PDB structure to a new or existing Jmol view
+ * display a single PDB structure in a new Jmol view
*
* @param pdbentry
* @param seq
final AlignmentPanel ap)
{
progressBar = ap.alignFrame;
- String pdbId = pdbentry.getId();
- /*
- * If the PDB file is already loaded, the user may just choose to add to an
- * existing viewer (or cancel)
- */
- if (addAlreadyLoadedFile(seq, chains, ap, pdbId))
- {
- return;
- }
-
- /*
- * Check if there are other Jmol views involving this alignment and prompt
- * user about adding this molecule to one of them
- */
- if (addToExistingViewer(pdbentry, seq, chains, ap, pdbId))
- {
- return;
- }
-
- /*
- * If the options above are declined or do not apply, open a new viewer
- */
- openNewJmol(ap, new PDBEntry[] { pdbentry }, new SequenceI[][] { seq });
+ openNewJmol(ap, alignAddedStructures, new PDBEntry[] { pdbentry },
+ new SequenceI[][]
+ { seq });
}
- private void openNewJmol(AlignmentPanel ap, PDBEntry[] pdbentrys,
+ private void openNewJmol(AlignmentPanel ap, boolean alignAdded,
+ PDBEntry[] pdbentrys,
SequenceI[][] seqs)
{
progressBar = ap.alignFrame;
addAlignmentPanel(ap);
useAlignmentPanelForColourbyseq(ap);
- if (pdbentrys.length > 1)
- {
- alignAddedStructures = true;
- useAlignmentPanelForSuperposition(ap);
- }
+ alignAddedStructures = alignAdded;
+ useAlignmentPanelForSuperposition(ap);
+
jmb.setColourBySequence(true);
setSize(400, 400); // probably should be a configurable/dynamic default here
initMenus();
}
/**
- * create a new Jmol containing several structures superimposed using the
- * given alignPanel.
+ * create a new Jmol containing several structures optionally superimposed
+ * using the given alignPanel.
*
* @param ap
+ * @param alignAdded
+ * - true to superimpose
* @param pe
* @param seqs
*/
- public AppJmol(AlignmentPanel ap, PDBEntry[] pe, SequenceI[][] seqs)
+ public AppJmol(AlignmentPanel ap, boolean alignAdded, PDBEntry[] pe,
+ SequenceI[][] seqs)
{
- openNewJmol(ap, pe, seqs);
+ openNewJmol(ap, alignAdded, pe, seqs);
}
- /**
- * Returns a list of any Jmol viewers. The list is restricted to those linked
- * to the given alignment panel if it is not null.
- */
- @Override
- protected List<StructureViewerBase> getViewersFor(AlignmentPanel apanel)
- {
- List<StructureViewerBase> result = new ArrayList<>();
- JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
- for (JInternalFrame frame : frames)
- {
- if (frame instanceof AppJmol)
- {
- if (apanel == null
- || ((StructureViewerBase) frame).isLinkedWith(apanel))
- {
- result.add((StructureViewerBase) frame);
- }
- }
- }
- return result;
- }
void initJmol(String command)
{
jmb.setFinishedInit(true);
}
- boolean allChainsSelected = false;
-
@Override
void showSelectedChains()
{
StringBuilder fileList = new StringBuilder();
for (String s : files)
{
- fileList.append(SPACE).append(BACKSLASH)
- .append(Platform.escapeString(s)).append(BACKSLASH);
+ fileList.append(SPACE).append(QUOTE)
+ .append(Platform.escapeString(s)).append(QUOTE);
}
String filesString = fileList.toString();
jmb.updateColours(ap);
}
// do superposition if asked to
- if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures)
+ if (alignAddedStructures)
{
alignAddedStructures();
}
}
}
});
- alignAddedStructures = false;
+
}
/**
String file = jmb.getPdbEntry(pi).getFile();
if (file == null)
{
+ // todo: extract block as method and pull up (also ChimeraViewFrame)
// retrieve the pdb and store it locally
AlignmentI pdbseq = null;
pdbid = jmb.getPdbEntry(pi).getId();
savemenu.setVisible(false); // not yet implemented
viewMenu.add(fitToWindow);
- /*
- * exchange of Jalview features and Chimera attributes is for now
- * an optionally enabled experimental feature
- */
- if (Desktop.instance.showExperimental())
+ JMenuItem writeFeatures = new JMenuItem(
+ MessageManager.getString("label.create_chimera_attributes"));
+ writeFeatures.setToolTipText(MessageManager
+ .getString("label.create_chimera_attributes_tip"));
+ writeFeatures.addActionListener(new ActionListener()
{
- JMenuItem writeFeatures = new JMenuItem(
- MessageManager.getString("label.create_chimera_attributes"));
- writeFeatures.setToolTipText(MessageManager
- .getString("label.create_chimera_attributes_tip"));
- writeFeatures.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- sendFeaturesToChimera();
- }
- });
- viewerActionMenu.add(writeFeatures);
-
- final JMenu fetchAttributes = new JMenu(
- MessageManager.getString("label.fetch_chimera_attributes"));
- fetchAttributes.setToolTipText(MessageManager
- .getString("label.fetch_chimera_attributes_tip"));
- fetchAttributes.addMouseListener(new MouseAdapter()
+ @Override
+ public void actionPerformed(ActionEvent e)
{
+ sendFeaturesToChimera();
+ }
+ });
+ viewerActionMenu.add(writeFeatures);
- @Override
- public void mouseEntered(MouseEvent e)
- {
- buildAttributesMenu(fetchAttributes);
- }
- });
- viewerActionMenu.add(fetchAttributes);
- }
+ final JMenu fetchAttributes = new JMenu(
+ MessageManager.getString("label.fetch_chimera_attributes"));
+ fetchAttributes.setToolTipText(
+ MessageManager.getString("label.fetch_chimera_attributes_tip"));
+ fetchAttributes.addMouseListener(new MouseAdapter()
+ {
+
+ @Override
+ public void mouseEntered(MouseEvent e)
+ {
+ buildAttributesMenu(fetchAttributes);
+ }
+ });
+ viewerActionMenu.add(fetchAttributes);
}
/**
}
/**
- * add a single PDB structure to a new or existing Chimera view
+ * open a single PDB structure in a new Chimera view
*
* @param pdbentry
* @param seq
String[] chains, final AlignmentPanel ap)
{
this();
- String pdbId = pdbentry.getId();
-
- /*
- * If the PDB file is already loaded, the user may just choose to add to an
- * existing viewer (or cancel)
- */
- if (addAlreadyLoadedFile(seq, chains, ap, pdbId))
- {
- return;
- }
- /*
- * Check if there are other Chimera views involving this alignment and give
- * user the option to add and align this molecule to one of them (or cancel)
- */
- if (addToExistingViewer(pdbentry, seq, chains, ap, pdbId))
- {
- return;
- }
-
- /*
- * If the options above are declined or do not apply, show the structure in
- * a new viewer
- */
openNewChimera(ap, new PDBEntry[] { pdbentry },
new SequenceI[][]
{ seq });
if (pdbentrys.length > 1)
{
- alignAddedStructures = true;
useAlignmentPanelForSuperposition(ap);
}
jmb.setColourBySequence(true);
}
/**
- * create a new viewer containing several structures superimposed using the
- * given alignPanel.
+ * create a new viewer containing several structures, optionally superimposed
+ * using the given alignPanel.
*
* @param pe
* @param seqs
* @param ap
*/
- public ChimeraViewFrame(PDBEntry[] pe, SequenceI[][] seqs,
+ public ChimeraViewFrame(PDBEntry[] pe, boolean alignAdded,
+ SequenceI[][] seqs,
AlignmentPanel ap)
{
this();
+ setAlignAddedStructures(alignAdded);
openNewChimera(ap, pe, seqs);
}
}
/**
- * Returns a list of any Chimera viewers in the desktop. The list is
- * restricted to those linked to the given alignment panel if it is not null.
- */
- @Override
- protected List<StructureViewerBase> getViewersFor(AlignmentPanel ap)
- {
- List<StructureViewerBase> result = new ArrayList<>();
- JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
- for (JInternalFrame frame : frames)
- {
- if (frame instanceof ChimeraViewFrame)
- {
- if (ap == null || ((StructureViewerBase) frame).isLinkedWith(ap))
- {
- result.add((StructureViewerBase) frame);
- }
- }
- }
- return result;
- }
-
- /**
* Launch Chimera. If we have a chimera session file name, send Chimera the
* command to open its saved session file.
*/
jmb.updateColours(ap);
}
// do superposition if asked to
- if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures)
+ if (alignAddedStructures)
{
new Thread(new Runnable()
{
alignStructs_withAllAlignPanels();
}
}).start();
- alignAddedStructures = false;
}
addingStructures = false;
}
private String fetchPdbFile(PDBEntry processingEntry) throws Exception
{
- // FIXME: this is duplicated code with Jmol frame ?
String filePath = null;
Pdb pdbclient = new Pdb();
AlignmentI pdbseq = null;
{
Cache.setProperty(EXPERIMENTAL_FEATURES, Boolean.toString(selected));
}
+
+ /**
+ * Answers a (possibly empty) list of any structure viewer frames (currently
+ * for either Jmol or Chimera) which are currently open. This may optionally
+ * be restricted to viewers of a specified class, or viewers linked to a
+ * specified alignment panel.
+ *
+ * @param apanel
+ * if not null, only return viewers linked to this panel
+ * @param structureViewerClass
+ * if not null, only return viewers of this class
+ * @return
+ */
+ public List<StructureViewerBase> getStructureViewers(
+ AlignmentPanel apanel,
+ Class<? extends StructureViewerBase> structureViewerClass)
+ {
+ List<StructureViewerBase> result = new ArrayList<>();
+ JInternalFrame[] frames = Desktop.instance.getAllFrames();
+
+ for (JInternalFrame frame : frames)
+ {
+ if (frame instanceof StructureViewerBase)
+ {
+ if (structureViewerClass == null
+ || structureViewerClass.isInstance(frame))
+ {
+ if (apanel == null
+ || ((StructureViewerBase) frame).isLinkedWith(apanel))
+ {
+ result.add((StructureViewerBase) frame);
+ }
+ }
+ }
+ }
+ return result;
+ }
}
* identical DB sources, and should be collapsed.
*/
DefaultMutableTreeNode tn = null, root = new DefaultMutableTreeNode();
- Hashtable<String, DefaultMutableTreeNode> source = new Hashtable<String, DefaultMutableTreeNode>();
+ Hashtable<String, DefaultMutableTreeNode> source = new Hashtable<>();
sfetcher = sfetch;
String dbs[] = sfetch.getSupportedDb();
- Hashtable<String, String> ht = new Hashtable<String, String>();
+ Hashtable<String, String> ht = new Hashtable<>();
for (int i = 0; i < dbs.length; i++)
{
tn = source.get(dbs[i]);
tsel = dbviews.getSelectionPaths();
boolean forcedFirstChild = false;
- List<DbSourceProxy> srcs = new ArrayList<DbSourceProxy>();
+ List<DbSourceProxy> srcs = new ArrayList<>();
if (tsel != null)
{
for (TreePath tp : tsel)
return null;
}
StringBuffer sb = new StringBuffer();
- HashSet<String> hs = new HashSet<String>();
+ HashSet<String> hs = new HashSet<>();
for (DbSourceProxy dbs : getSelectedSources())
{
String tq = dbs.getTestQuery();
return sb.toString();
}
- List<ActionListener> lstners = new Vector<ActionListener>();
+ List<ActionListener> lstners = new Vector<>();
public void addActionListener(ActionListener actionListener)
{
// TODO Auto-generated method stub
}
+
+ @Override
+ public void setVisible(boolean arg0)
+ {
+ System.out.println("setVisible: " + arg0);
+ super.setVisible(arg0);
+ }
}
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.GraphLine;
+import jalview.datamodel.HiddenMarkovModel;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.RnaViewerModel;
import jalview.datamodel.SequenceFeature;
import jalview.gui.StructureViewer.ViewerType;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
+import jalview.io.HMMFile;
import jalview.renderer.ResidueShaderI;
import jalview.schemabinding.version2.AlcodMap;
import jalview.schemabinding.version2.AlcodonFrame;
import jalview.schemabinding.version2.AnnotationColours;
import jalview.schemabinding.version2.AnnotationElement;
import jalview.schemabinding.version2.CalcIdParam;
-import jalview.schemabinding.version2.Colour;
import jalview.schemabinding.version2.CompoundMatcher;
import jalview.schemabinding.version2.DBRef;
import jalview.schemabinding.version2.Features;
private static final String RNA_PREFIX = "rna_";
+ private static final String HMMER_PREFIX = "hmmer_";
+
private static final String UTF_8 = "UTF-8";
// use this with nextCounter() to make unique names for entities
}
}
- // TODO: omit sequence features from each alignment view's XML dump if we
- // are storing dataset
- List<jalview.datamodel.SequenceFeature> sfs = jds
- .getSequenceFeatures();
+ /*
+ * save sequence features
+ * TODO: omit sequence features from each alignment view's
+ * XML dump if we are storing dataset
+ */
+ List<SequenceFeature> sfs = jds.getSequenceFeatures();
for (SequenceFeature sf : sfs)
{
- Features features = new Features();
-
- features.setBegin(sf.getBegin());
- features.setEnd(sf.getEnd());
- features.setDescription(sf.getDescription());
- features.setType(sf.getType());
- features.setFeatureGroup(sf.getFeatureGroup());
- features.setScore(sf.getScore());
- if (sf.links != null)
- {
- for (int l = 0; l < sf.links.size(); l++)
- {
- OtherData keyValue = new OtherData();
- keyValue.setKey("LINK_" + l);
- keyValue.setValue(sf.links.elementAt(l).toString());
- features.addOtherData(keyValue);
- }
- }
- if (sf.otherDetails != null)
- {
- /*
- * save feature attributes, which may be simple strings or
- * map valued (have sub-attributes)
- */
- for (Entry<String, Object> entry : sf.otherDetails.entrySet())
- {
- String key = entry.getKey();
- Object value = entry.getValue();
- if (value instanceof Map<?, ?>)
- {
- for (Entry<String, Object> subAttribute : ((Map<String, Object>) value)
- .entrySet())
- {
- OtherData otherData = new OtherData();
- otherData.setKey(key);
- otherData.setKey2(subAttribute.getKey());
- otherData.setValue(subAttribute.getValue().toString());
- features.addOtherData(otherData);
- }
- }
- else
- {
- OtherData otherData = new OtherData();
- otherData.setKey(key);
- otherData.setValue(value.toString());
- features.addOtherData(otherData);
- }
- }
- }
-
+ Features features = saveFeature(sf);
jseq.addFeatures(features);
}
+ /*
+ * save PDB entries for sequence
+ */
if (jdatasq.getAllPDBEntries() != null)
{
- Enumeration en = jdatasq.getAllPDBEntries().elements();
+ Enumeration<PDBEntry> en = jdatasq.getAllPDBEntries().elements();
while (en.hasMoreElements())
{
Pdbids pdb = new Pdbids();
- jalview.datamodel.PDBEntry entry = (jalview.datamodel.PDBEntry) en
- .nextElement();
+ PDBEntry entry = en.nextElement();
String pdbId = entry.getId();
pdb.setId(pdbId);
saveRnaViewers(jout, jseq, jds, viewIds, ap, storeDS);
+ if (jds.hasHMMProfile())
+ {
+ saveHmmerProfile(jout, jseq, jds);
+ }
+
jms.addJSeq(jseq);
}
}
/**
+ * Saves the HMMER profile associated with the sequence as a file in the jar,
+ * in HMMER format, and saves the name of the file as a child element of the
+ * XML sequence element
+ *
+ * @param jout
+ * @param xmlSeq
+ * @param seq
+ */
+ protected void saveHmmerProfile(JarOutputStream jout, JSeq xmlSeq,
+ SequenceI seq)
+ {
+ HiddenMarkovModel profile = seq.getHMM();
+ if (profile == null)
+ {
+ warn("Want to save HMM profile for " + seq.getName()
+ + " but none found");
+ return;
+ }
+ HMMFile hmmFile = new HMMFile(profile);
+ String hmmAsString = hmmFile.print();
+ String jarEntryName = HMMER_PREFIX + nextCounter();
+ try
+ {
+ writeJarEntry(jout, jarEntryName, hmmAsString.getBytes());
+ xmlSeq.setHmmerProfile(jarEntryName);
+ } catch (IOException e)
+ {
+ warn("Error saving HMM profile: " + e.getMessage());
+ }
+ }
+
+ /**
+ * Converts a Jalview SequenceFeature into the XML model of it to save
+ *
+ * @param sf
+ * @return
+ */
+ protected Features saveFeature(SequenceFeature sf)
+ {
+ Features features = new Features();
+
+ features.setBegin(sf.getBegin());
+ features.setEnd(sf.getEnd());
+ features.setDescription(sf.getDescription());
+ features.setType(sf.getType());
+ features.setFeatureGroup(sf.getFeatureGroup());
+ features.setScore(sf.getScore());
+ if (sf.links != null)
+ {
+ for (int l = 0; l < sf.links.size(); l++)
+ {
+ OtherData keyValue = new OtherData();
+ keyValue.setKey("LINK_" + l);
+ keyValue.setValue(sf.links.elementAt(l).toString());
+ features.addOtherData(keyValue);
+ }
+ }
+ if (sf.otherDetails != null)
+ {
+ /*
+ * save feature attributes, which may be simple strings or
+ * map valued (have sub-attributes)
+ */
+ for (Entry<String, Object> entry : sf.otherDetails.entrySet())
+ {
+ String key = entry.getKey();
+ Object value = entry.getValue();
+ if (value instanceof Map<?, ?>)
+ {
+ for (Entry<String, Object> subAttribute : ((Map<String, Object>) value)
+ .entrySet())
+ {
+ OtherData otherData = new OtherData();
+ otherData.setKey(key);
+ otherData.setKey2(subAttribute.getKey());
+ otherData.setValue(subAttribute.getValue().toString());
+ features.addOtherData(otherData);
+ }
+ }
+ else
+ {
+ OtherData otherData = new OtherData();
+ otherData.setKey(key);
+ otherData.setValue(value.toString());
+ features.addOtherData(otherData);
+ }
+ }
+ }
+ return features;
+ }
+
+ /**
* Save any Varna viewers linked to this sequence. Writes an rnaViewer element
* for each viewer, with
* <ul>
}
else if (!matchedFile.equals(pdbentry.getFile()))
{
- Cache.log.warn(
- "Probably lost some PDB-Sequence mappings for this structure file (which apparently has same PDB Entry code): "
- + pdbentry.getFile());
+ warn("Probably lost some PDB-Sequence mappings for this structure file (which apparently has same PDB Entry code): "
+ + pdbentry.getFile());
}
// record the
// file so we
mpc.setDseqFor(jmpid);
if (!seqRefIds.containsKey(mpc.getDseqFor()))
{
- jalview.bin.Cache.log.debug("creatign new DseqFor ID");
+ debug("creating new DseqFor ID");
seqRefIds.put(mpc.getDseqFor(), ps);
}
else
{
- jalview.bin.Cache.log.debug("reusing DseqFor ID");
+ debug("reusing DseqFor ID");
}
mp.setMappingChoice(mpc);
//
for (int i = 0; i < vamsasSeq.length; i++)
{
+ SequenceI alignmentSeq = al.getSequenceAt(i);
if (jseqs[i].getFeaturesCount() > 0)
{
Features[] features = jseqs[i].getFeatures();
for (int f = 0; f < features.length; f++)
{
- SequenceFeature sf = new SequenceFeature(features[f].getType(),
- features[f].getDescription(), features[f].getBegin(),
- features[f].getEnd(), features[f].getScore(),
- features[f].getFeatureGroup());
- sf.setStatus(features[f].getStatus());
+ Features feature = features[f];
+ SequenceFeature sf = new SequenceFeature(feature.getType(),
+ feature.getDescription(), feature.getBegin(),
+ feature.getEnd(), feature.getScore(),
+ feature.getFeatureGroup());
+ sf.setStatus(feature.getStatus());
/*
* load any feature attributes - include map-valued attributes
*/
Map<String, Map<String, String>> mapAttributes = new HashMap<>();
- for (int od = 0; od < features[f].getOtherDataCount(); od++)
+ for (int od = 0; od < feature.getOtherDataCount(); od++)
{
- OtherData keyValue = features[f].getOtherData(od);
+ OtherData keyValue = feature.getOtherData(od);
String attributeName = keyValue.getKey();
String attributeValue = keyValue.getValue();
if (attributeName.startsWith("LINK"))
}
// adds feature to datasequence's feature set (since Jalview 2.10)
- al.getSequenceAt(i).addSequenceFeature(sf);
+ alignmentSeq.addSequenceFeature(sf);
}
}
if (vamsasSeq[i].getDBRefCount() > 0)
{
// adds dbrefs to datasequence's set (since Jalview 2.10)
addDBRefs(
- al.getSequenceAt(i).getDatasetSequence() == null
- ? al.getSequenceAt(i)
- : al.getSequenceAt(i).getDatasetSequence(),
+ alignmentSeq.getDatasetSequence() == null ? alignmentSeq
+ : alignmentSeq.getDatasetSequence(),
vamsasSeq[i]);
}
if (jseqs[i].getPdbidsCount() > 0)
.getStructureSelectionManager(Desktop.instance)
.registerPDBEntry(entry);
// adds PDBEntry to datasequence's set (since Jalview 2.10)
- if (al.getSequenceAt(i).getDatasetSequence() != null)
+ if (alignmentSeq.getDatasetSequence() != null)
{
- al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);
+ alignmentSeq.getDatasetSequence().addPDBId(entry);
}
else
{
- al.getSequenceAt(i).addPDBId(entry);
+ alignmentSeq.addPDBId(entry);
}
}
}
+
+ /*
+ * load any HMMER profile
+ */
+ String hmmJarFile = jseqs[i].getHmmerProfile();
+ if (hmmJarFile != null)
+ {
+ loadHmmerProfile(jprovider, hmmJarFile, alignmentSeq);
+ }
}
} // end !multipleview
}
/**
+ * Loads a HMMER profile from a file stored in the project, and associates it
+ * with the specified sequence
+ *
+ * @param jprovider
+ * @param hmmJarFile
+ * @param seq
+ */
+ protected void loadHmmerProfile(jarInputStreamProvider jprovider,
+ String hmmJarFile, SequenceI seq)
+ {
+ try
+ {
+ String hmmFile = copyJarEntry(jprovider, hmmJarFile, "hmm", null);
+ HMMFile parser = new HMMFile(hmmFile, DataSourceType.FILE);
+ HiddenMarkovModel hmmModel = parser.getHMM();
+ hmmModel = new HiddenMarkovModel(hmmModel, seq);
+ seq.setHMM(hmmModel);
+ } catch (IOException e)
+ {
+ warn("Error loading HMM profile for " + seq.getName() + ": "
+ + e.getMessage());
+ }
+ }
+
+ /**
* Instantiate and link any saved RNA (Varna) viewers. The state of the Varna
* panel is restored from separate jar entries, two (gapped and trimmed) per
* sequence and secondary structure.
id = object.getJalviewModelSequence().getViewport()[0]
.getSequenceSetId()))
{
- if (Cache.log != null && Cache.log.isDebugEnabled())
- {
- Cache.log.debug("Skipping seuqence set id " + id);
- }
+ debug("Skipping sequence set id " + id);
return true;
}
return false;
seqRefIds.put(sqid, djs);
}
- jalview.bin.Cache.log.debug("about to recurse on addDBRefs.");
+ debug("about to recurse on addDBRefs.");
addDBRefs(djs, ms);
}
}
else
{
- Cache.log.debug("Ignoring " + jvobj.getClass() + " (ID = " + id);
+ debug("Ignoring " + jvobj.getClass() + " (ID = " + id);
}
}
}
maxcol = new Color(Integer.parseInt(colourModel.getRGB(), 16));
} catch (Exception e)
{
- Cache.log.warn("Couldn't parse out graduated feature color.", e);
+ if (Cache.log != null)
+ {
+ Cache.log.warn("Couldn't parse out graduated feature color.", e);
+ }
}
NoValueColour noCol = colourModel.getNoValueColour();
public class OptionBox extends JPanel
implements MouseListener, ActionListener
{
- JCheckBox enabled = new JCheckBox();
+ JCheckBox enabled;
final URL finfo;
OptionI option;
- JLabel optlabel = new JLabel();
-
- JComboBox<String> val = new JComboBox<>();
+ JComboBox<String> val;
public OptionBox(OptionI opt)
{
option = opt;
setLayout(new FlowLayout(FlowLayout.LEFT));
+ enabled = new JCheckBox();
enabled.setSelected(opt.isRequired()); // TODO: lock required options
enabled.setFont(new Font("Verdana", Font.PLAIN, 11));
enabled.setText("");
}
}
add(enabled);
+
+ // todo combo or radio buttons?
+ val = new JComboBox<>();
for (String str : opt.getPossibleValues())
{
val.addItem(str);
* ensure slider has an integer range corresponding to
* the min-max range of the parameter
*/
- if (validator.getMin() != null && !isIntegerParameter
+ if (validator.getMin() != null && validator.getMax() != null
+ // && !isIntegerParameter
&& !isStringParameter)
{
double min = validator.getMin().doubleValue();
// todo scaleMin, scaleMax could also be final fields
}
}
- else
- {
- isChoiceParameter = parameter.getPossibleValues() != null;
- }
+
+ List<String> possibleValues = parameter.getPossibleValues();
+ isChoiceParameter = possibleValues != null
+ && !possibleValues.isEmpty();
if (compact)
{
*/
private void checkIfModified()
{
- Object newValue = updateSliderFromValueField();
- boolean modified = true;
- if (newValue.getClass() == lastVal.getClass())
+ if (!adjusting)
{
- modified = !newValue.equals(lastVal);
+ try
+ {
+ adjusting = true;
+ Object newValue = updateSliderFromValueField();
+ boolean modified = true;
+ if (newValue.getClass() == lastVal.getClass())
+ {
+ modified = !newValue.equals(lastVal);
+ }
+ pmdialogbox.argSetModified(this, modified);
+ } finally
+ {
+ adjusting = false;
+ }
}
- pmdialogbox.argSetModified(this, modified);
}
@Override
@Override
public void stateChanged(ChangeEvent e)
{
- if (!adjusting)
+ if (adjusting)
{
+ return;
+ }
+ try
+ {
+ adjusting = true;
if (!isLogarithmicParameter)
{
/*
valueField.setText(formatDouble(value));
}
checkIfModified();
+ } finally
+ {
+ adjusting = false;
}
}
public void run()
{
PrinterJob printJob = PrinterJob.getPrinterJob();
- PageFormat pf = printJob.pageDialog(printJob.defaultPage());
+ PageFormat defaultPage = printJob.defaultPage();
+ PageFormat pf = printJob.pageDialog(defaultPage);
+
+ if (defaultPage == pf)
+ {
+ /*
+ * user cancelled
+ */
+ return;
+ }
printJob.setPrintable(this, pf);
return true;
}
+
+ /**
+ *
+ * @return null or last search results handled by this panel
+ */
+ public SearchResultsI getLastSearchResults()
+ {
+ return lastSearchResults;
+ }
}
return Collections.emptyList();
}
}
- sf.newAlframes = new ArrayList<AlignFrame>();
+ sf.newAlframes = new ArrayList<>();
sf.run();
return sf.newAlframes;
}
// TODO: Refactor to GUI independent code and write tests.
// indicate if successive sources should be merged into one alignment.
boolean addToLast = false;
- List<String> aresultq = new ArrayList<String>();
- List<String> presultTitle = new ArrayList<String>();
- List<AlignmentI> presult = new ArrayList<AlignmentI>();
- List<AlignmentI> aresult = new ArrayList<AlignmentI>();
+ List<String> aresultq = new ArrayList<>();
+ List<String> presultTitle = new ArrayList<>();
+ List<AlignmentI> presult = new ArrayList<>();
+ List<AlignmentI> aresult = new ArrayList<>();
Iterator<DbSourceProxy> proxies = database.getSelectedSources()
.iterator();
String[] qries;
nqueries = nextFetch.size();
// save the remaining queries in the original array
qries = nextFetch.toArray(new String[nqueries]);
- nextFetch = new ArrayList<String>();
+ nextFetch = new ArrayList<>();
}
DbSourceProxy proxy = proxies.next();
List<AlignmentI> aresult, List<String> nextFetch) throws Exception
{
StringBuilder multiacc = new StringBuilder();
- List<String> tosend = new ArrayList<String>();
+ List<String> tosend = new ArrayList<>();
while (accessions.hasNext())
{
String nel = accessions.next();
package jalview.gui;
import jalview.api.structures.JalviewStructureDisplayI;
+import jalview.bin.Cache;
import jalview.bin.Jalview;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
public class StructureChooser extends GStructureChooser
implements IProgressIndicator
{
+ private static final String AUTOSUPERIMPOSE = "AUTOSUPERIMPOSE";
+
private static int MAX_QLENGTH = 7820;
private SequenceI selectedSequence;
private boolean cachedPDBExists;
+ private static StructureViewer lastTargetedView = null;
+
public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq,
AlignmentPanel ap)
{
/**
* Initializes parameters used by the Structure Chooser Panel
*/
- public void init()
+ protected void init()
{
if (!Jalview.isHeadlessMode())
{
progressBar = new ProgressBar(this.statusPanel, this.statusBar);
}
+ chk_superpose.setSelected(Cache.getDefault(AUTOSUPERIMPOSE, true));
+
// ensure a filter option is in force for search
populateFilterComboBox(true, cachedPDBExists);
Thread discoverPDBStructuresThread = new Thread(new Runnable()
fetchStructuresMetaData();
// revise filter options if no results were found
populateFilterComboBox(isStructuresDiscovered(), cachedPDBExists);
+ discoverStructureViews();
updateProgressIndicator(null, startTime);
mainFrame.setVisible(true);
updateCurrentView();
}
/**
+ * Builds a drop-down choice list of existing structure viewers to which new
+ * structures may be added. If this list is empty then it, and the 'Add'
+ * button, are hidden.
+ */
+ private void discoverStructureViews()
+ {
+ if (Desktop.instance != null)
+ {
+ targetView.removeAllItems();
+ if (lastTargetedView != null && !lastTargetedView.isVisible())
+ {
+ lastTargetedView = null;
+ }
+ int linkedViewsAt = 0;
+ for (StructureViewerBase view : Desktop.instance
+ .getStructureViewers(null, null))
+ {
+ StructureViewer viewHandler = (lastTargetedView != null
+ && lastTargetedView.sview == view) ? lastTargetedView
+ : StructureViewer.reconfigure(view);
+
+ if (view.isLinkedWith(ap))
+ {
+ targetView.insertItemAt(viewHandler,
+ linkedViewsAt++);
+ }
+ else
+ {
+ targetView.addItem(viewHandler);
+ }
+ }
+
+ /*
+ * show option to Add to viewer if at least 1 viewer found
+ */
+ targetView.setVisible(false);
+ if (targetView.getItemCount() > 0)
+ {
+ targetView.setVisible(true);
+ if (lastTargetedView != null)
+ {
+ targetView.setSelectedItem(lastTargetedView);
+ }
+ else
+ {
+ targetView.setSelectedIndex(0);
+ }
+ }
+ btn_add.setVisible(targetView.isVisible());
+ }
+ }
+
+ /**
* Updates the progress indicator with the specified message
*
* @param message
* @param id
* unique handle for this indicator
*/
- public void updateProgressIndicator(String message, long id)
+ protected void updateProgressIndicator(String message, long id)
{
if (progressIndicator != null)
{
* Retrieve meta-data for all the structure(s) for a given sequence(s) in a
* selection group
*/
- public void fetchStructuresMetaData()
+ void fetchStructuresMetaData()
{
long startTime = System.currentTimeMillis();
pdbRestCleint = PDBFTSRestClient.getInstance();
}
}
- public void loadLocalCachedPDBEntries()
+ protected void loadLocalCachedPDBEntries()
{
ArrayList<CachedPDB> entries = new ArrayList<>();
for (SequenceI seq : selectedSequences)
* @return the built query string
*/
- public static String buildQuery(SequenceI seq)
+ static String buildQuery(SequenceI seq)
{
boolean isPDBRefsFound = false;
boolean isUniProtRefsFound = false;
* @param seqName
* @return
*/
- public static boolean isValidSeqName(String seqName)
+ static boolean isValidSeqName(String seqName)
{
// System.out.println("seqName : " + seqName);
String ignoreList = "pdb,uniprot,swiss-prot";
return true;
}
- public static String getDBRefId(DBRefEntry dbRef)
+ static String getDBRefId(DBRefEntry dbRef)
{
String ref = dbRef.getAccessionId().replaceAll("GO:", "");
return ref;
* @param fieldToFilterBy
* the field to filter by
*/
- public void filterResultSet(final String fieldToFilterBy)
+ void filterResultSet(final String fieldToFilterBy)
{
Thread filterThread = new Thread(new Runnable()
{
* Handles action event for btn_pdbFromFile
*/
@Override
- public void pdbFromFile_actionPerformed()
+ protected void pdbFromFile_actionPerformed()
{
jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
}
/**
- * Validates user selection and activates the view button if all parameters
- * are correct
+ * Validates user selection and enables the 'Add' and 'New View' buttons if
+ * all parameters are correct (the Add button will only be visible if there is
+ * at least one existing structure viewer open). This basically means at least
+ * one structure selected and no error messages.
+ * <p>
+ * The 'Superpose Structures' option is enabled if either more than one
+ * structure is selected, or the 'Add' to existing view option is enabled, and
+ * disabled if the only option is to open a new view of a single structure.
*/
@Override
- public void validateSelections()
+ protected void validateSelections()
{
FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
.getSelectedItem());
- btn_view.setEnabled(false);
+ btn_add.setEnabled(false);
String currentView = selectedFilterOpt.getView();
+ int selectedCount = 0;
if (currentView == VIEWS_FILTER)
{
- if (getResultTable().getSelectedRows().length > 0)
+ selectedCount = getResultTable().getSelectedRows().length;
+ if (selectedCount > 0)
{
- btn_view.setEnabled(true);
+ btn_add.setEnabled(true);
}
}
else if (currentView == VIEWS_LOCAL_PDB)
{
- if (tbl_local_pdb.getSelectedRows().length > 0)
+ selectedCount = tbl_local_pdb.getSelectedRows().length;
+ if (selectedCount > 0)
{
- btn_view.setEnabled(true);
+ btn_add.setEnabled(true);
}
}
else if (currentView == VIEWS_ENTER_ID)
{
validateAssociationFromFile();
}
+
+ btn_newView.setEnabled(btn_add.isEnabled());
+
+ /*
+ * enable 'Superpose' option if more than one structure is selected,
+ * or there are view(s) available to add structure(s) to
+ */
+ chk_superpose
+ .setEnabled(selectedCount > 1 || targetView.getItemCount() > 0);
}
/**
* Validates inputs from the Manual PDB entry panel
*/
- public void validateAssociationEnterPdb()
+ protected void validateAssociationEnterPdb()
{
AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) idInputAssSeqPanel
.getCmb_assSeq().getSelectedItem();
txt_search.setEnabled(true);
if (isValidPBDEntry)
{
- btn_view.setEnabled(true);
+ btn_add.setEnabled(true);
lbl_pdbManualFetchStatus.setToolTipText("");
lbl_pdbManualFetchStatus.setIcon(goodImage);
}
/**
* Validates inputs for the manual PDB file selection options
*/
- public void validateAssociationFromFile()
+ protected void validateAssociationFromFile()
{
AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) fileChooserAssSeqPanel
.getCmb_assSeq().getSelectedItem();
btn_pdbFromFile.setEnabled(true);
if (selectedPdbFileName != null && selectedPdbFileName.length() > 0)
{
- btn_view.setEnabled(true);
+ btn_add.setEnabled(true);
lbl_fromFileStatus.setIcon(goodImage);
}
}
}
@Override
- public void cmbAssSeqStateChanged()
+ protected void cmbAssSeqStateChanged()
{
validateSelections();
}
}
return found;
}
+
+ /**
+ * Handles the 'New View' action
+ */
+ @Override
+ protected void newView_ActionPerformed()
+ {
+ targetView.setSelectedItem(null);
+ showStructures(false);
+ }
+
/**
- * Handles action event for btn_ok
+ * Handles the 'Add to existing viewer' action
*/
@Override
- public void ok_ActionPerformed()
+ protected void add_ActionPerformed()
{
showStructures(false);
}
return foundEntry;
}
+ /**
+ * Answers a structure viewer (new or existing) configured to superimpose
+ * added structures or not according to the user's choice
+ *
+ * @param ssm
+ * @return
+ */
+ StructureViewer getTargetedStructureViewer(
+ StructureSelectionManager ssm)
+ {
+ Object sv = targetView.getSelectedItem();
+
+ return sv == null ? new StructureViewer(ssm) : (StructureViewer) sv;
+ }
+
+ /**
+ * Adds PDB structures to a new or existing structure viewer
+ *
+ * @param ssm
+ * @param pdbEntriesToView
+ * @param alignPanel
+ * @param sequences
+ * @return
+ */
private StructureViewer launchStructureViewer(
StructureSelectionManager ssm,
final PDBEntry[] pdbEntriesToView,
long progressId = sequences.hashCode();
setProgressBar(MessageManager
.getString("status.launching_3d_structure_viewer"), progressId);
- final StructureViewer sViewer = new StructureViewer(ssm);
- setProgressBar(null, progressId);
+ final StructureViewer theViewer = getTargetedStructureViewer(ssm);
+ boolean superimpose = chk_superpose.isSelected();
+ theViewer.setSuperpose(superimpose);
+
+ /*
+ * remember user's choice of superimpose or not
+ */
+ Cache.setProperty(AUTOSUPERIMPOSE,
+ Boolean.valueOf(superimpose).toString());
+ setProgressBar(null, progressId);
if (SiftsSettings.isMapWithSifts())
{
List<SequenceI> seqsWithoutSourceDBRef = new ArrayList<>();
}
}
}
- if (seq.getPrimaryDBRefs().size() == 0)
+ if (seq.getPrimaryDBRefs().isEmpty())
{
seqsWithoutSourceDBRef.add(seq);
continue;
setProgressBar(MessageManager.formatMessage(
"status.fetching_dbrefs_for_sequences_without_valid_refs",
y), progressId);
- SequenceI[] seqWithoutSrcDBRef = new SequenceI[y];
- int x = 0;
- for (SequenceI fSeq : seqsWithoutSourceDBRef)
- {
- seqWithoutSrcDBRef[x++] = fSeq;
- }
-
+ SequenceI[] seqWithoutSrcDBRef = seqsWithoutSourceDBRef
+ .toArray(new SequenceI[y]);
DBRefFetcher dbRefFetcher = new DBRefFetcher(seqWithoutSrcDBRef);
dbRefFetcher.fetchDBRefs(true);
setProgressBar(MessageManager.getString(
"status.fetching_3d_structures_for_selected_entries"),
progressId);
- sViewer.viewStructures(pdbEntriesToView, sequences, alignPanel);
+ theViewer.viewStructures(pdbEntriesToView, sequences, alignPanel);
}
else
{
setProgressBar(MessageManager.formatMessage(
"status.fetching_3d_structures_for",
pdbEntriesToView[0].getId()),progressId);
- sViewer.viewStructures(pdbEntriesToView[0], sequences, alignPanel);
+ theViewer.viewStructures(pdbEntriesToView[0], sequences, alignPanel);
}
setProgressBar(null, progressId);
- return sViewer;
+ // remember the last viewer we used...
+ lastTargetedView = theViewer;
+ return theViewer;
}
/**
* a unique sequence when more than one sequence selection is made.
*/
@Override
- public void populateCmbAssociateSeqOptions(
+ protected void populateCmbAssociateSeqOptions(
JComboBox<AssociateSeqOptions> cmb_assSeq,
JLabel lbl_associateSeq)
{
}
}
- public boolean isStructuresDiscovered()
+ protected boolean isStructuresDiscovered()
{
return discoveredStructuresSet != null
&& !discoveredStructuresSet.isEmpty();
}
- public Collection<FTSData> getDiscoveredStructuresSet()
- {
- return discoveredStructuresSet;
- }
-
@Override
protected void txt_search_ActionPerformed()
{
}
@Override
- public void tabRefresh()
+ protected void tabRefresh()
{
if (selectedSequences != null)
{
StructureSelectionManager ssm;
+ /**
+ * decide if new structures are aligned to existing ones
+ */
+ private boolean superposeAdded = true;
+
public enum ViewerType
{
JMOL, CHIMERA
ssm = structureSelectionManager;
}
+ /**
+ * Factory to create a proxy for modifying existing structure viewer
+ *
+ */
+ public static StructureViewer reconfigure(
+ JalviewStructureDisplayI display)
+ {
+ StructureViewer sv = new StructureViewer(display.getBinding().getSsm());
+ sv.sview = display;
+ return sv;
+ }
+
+ @Override
+ public String toString()
+ {
+ if (sview != null)
+ {
+ return sview.toString();
+ }
+ return "New View";
+ }
public ViewerType getViewerType()
{
String viewType = Cache.getDefault(Preferences.STRUCTURE_DISPLAY,
new PDBEntry[seqsForPdbs.size()]);
SequenceI[][] theSeqs = seqsForPdbs.values().toArray(
new SequenceI[seqsForPdbs.size()][]);
+ if (sview != null)
+ {
+ sview.setAlignAddedStructures(superposeAdded);
+ new Thread(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+
+ for (int pdbep = 0; pdbep < pdbsForFile.length; pdbep++)
+ {
+ PDBEntry pdb = pdbsForFile[pdbep];
+ if (!sview.addAlreadyLoadedFile(theSeqs[pdbep], null, ap,
+ pdb.getId()))
+ {
+ sview.addToExistingViewer(pdb, theSeqs[pdbep], null, ap,
+ pdb.getId());
+ }
+ }
+
+ sview.updateTitleAndMenus();
+ }
+ }).start();
+ return sview;
+ }
if (viewerType.equals(ViewerType.JMOL))
{
- sview = new AppJmol(ap, pdbsForFile, theSeqs);
+ sview = new AppJmol(ap, superposeAdded, pdbsForFile, theSeqs);
}
else if (viewerType.equals(ViewerType.CHIMERA))
{
- sview = new ChimeraViewFrame(pdbsForFile, theSeqs, ap);
+ sview = new ChimeraViewFrame(pdbsForFile, superposeAdded, theSeqs,
+ ap);
}
else
{
public JalviewStructureDisplayI viewStructures(PDBEntry pdb,
SequenceI[] seqsForPdb, AlignmentPanel ap)
{
+ if (sview != null)
+ {
+ sview.setAlignAddedStructures(superposeAdded);
+ String pdbId = pdb.getId();
+ if (!sview.addAlreadyLoadedFile(seqsForPdb, null, ap, pdbId))
+ {
+ sview.addToExistingViewer(pdb, seqsForPdb, null, ap, pdbId);
+ }
+ sview.updateTitleAndMenus();
+ sview.raiseViewer();
+ return sview;
+ }
ViewerType viewerType = getViewerType();
if (viewerType.equals(ViewerType.JMOL))
{
return false;
}
+ /**
+ *
+ * @param pDBid
+ * @return true if view is already showing PDBid
+ */
+ public boolean hasPdbId(String pDBid)
+ {
+ if (sview == null)
+ {
+ return false;
+ }
+
+ return sview.getBinding().hasPdbId(pDBid);
+ }
+
+ public boolean isVisible()
+ {
+ return sview != null && sview.isVisible();
+ }
+
+ public void setSuperpose(boolean alignAddedStructures)
+ {
+ superposeAdded = alignAddedStructures;
+ }
+
}
*/
package jalview.gui;
+import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
}
/**
+ * @return true if added structures should be aligned to existing one(s)
+ */
+ @Override
+ public boolean isAlignAddedStructures()
+ {
+ return alignAddedStructures;
+ }
+
+ /**
+ *
+ * @param true
+ * if added structures should be aligned to existing one(s)
+ */
+ @Override
+ public void setAlignAddedStructures(boolean alignAdded)
+ {
+ alignAddedStructures = alignAdded;
+ }
+
+ /**
*
* @param ap2
* @return true if this Jmol instance is linked with the given alignPanel
*/
protected void addStructure(final PDBEntry pdbentry,
final SequenceI[] seqs, final String[] chains,
- final boolean align, final IProgressIndicator alignFrame)
+ final IProgressIndicator alignFrame)
{
if (pdbentry.getFile() == null)
{
}
}
// and call ourselves again.
- addStructure(pdbentry, seqs, chains, align, alignFrame);
+ addStructure(pdbentry, seqs, chains, alignFrame);
}
}).start();
return;
{ seqs }, new String[][] { chains });
addingStructures = true;
_started = false;
- alignAddedStructures = align;
worker = new Thread(this);
worker.start();
return;
}
- /**
- * Presents a dialog with the option to add an align a structure to an
- * existing structure view
- *
- * @param pdbId
- * @param view
- * @return YES, NO or CANCEL JvOptionPane code
- */
- protected int chooseAlignStructureToViewer(String pdbId,
- StructureViewerBase view)
- {
- int option = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
- MessageManager.formatMessage("label.add_pdbentry_to_view",
- new Object[]
- { pdbId, view.getTitle() }),
- MessageManager
- .getString("label.align_to_existing_structure_view"),
- JvOptionPane.YES_NO_CANCEL_OPTION);
- return option;
- }
-
protected boolean hasPdbId(String pdbId)
{
return getBinding().hasPdbId(pdbId);
}
- protected abstract List<StructureViewerBase> getViewersFor(
- AlignmentPanel alp);
-
/**
- * Check for any existing views involving this alignment and give user the
- * option to add and align this molecule to one of them
- *
- * @param pdbentry
- * @param seq
- * @param chains
- * @param apanel
- * @param pdbId
- * @return true if user adds to a view, or cancels entirely, else false
+ * Returns a list of any viewer of the instantiated type. The list is
+ * restricted to those linked to the given alignment panel if it is not null.
*/
- protected boolean addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
- String[] chains, final AlignmentPanel apanel, String pdbId)
+ protected List<StructureViewerBase> getViewersFor(AlignmentPanel alp)
{
- for (StructureViewerBase view : getViewersFor(apanel))
- {
- // TODO: highlight the view somehow
- /*
- * JAL-1742 exclude view with this structure already mapped (don't offer
- * to align chain B to chain A of the same structure)
- */
- if (view.hasPdbId(pdbId))
- {
- continue;
- }
- int option = chooseAlignStructureToViewer(pdbId, view);
- if (option == JvOptionPane.CANCEL_OPTION)
- {
- return true;
- }
- else if (option == JvOptionPane.YES_OPTION)
- {
- view.useAlignmentPanelForSuperposition(apanel);
- view.addStructure(pdbentry, seq, chains, true, apanel.alignFrame);
- return true;
- }
- else
- {
- // NO_OPTION - offer the next viewer if any
- }
- }
+ return Desktop.instance.getStructureViewers(alp, this.getClass());
+ }
+ @Override
+ public void addToExistingViewer(PDBEntry pdbentry, SequenceI[] seq,
+ String[] chains, final AlignmentViewPanel apanel, String pdbId)
+ {
/*
- * nothing offered and selected
+ * JAL-1742 exclude view with this structure already mapped (don't offer
+ * to align chain B to chain A of the same structure); code may defend
+ * against this possibility before we reach here
*/
- return false;
+ if (hasPdbId(pdbId))
+ {
+ return;
+ }
+ AlignmentPanel alignPanel = (AlignmentPanel) apanel; // Implementation error if this
+ // cast fails
+ useAlignmentPanelForSuperposition(alignPanel);
+ addStructure(pdbentry, seq, chains, alignPanel.alignFrame);
}
/**
* @param apanel
* @param pdbFilename
*/
- protected void addSequenceMappingsToStructure(SequenceI[] seq,
- String[] chains, final AlignmentPanel apanel, String pdbFilename)
+ public void addSequenceMappingsToStructure(SequenceI[] seq,
+ String[] chains, final AlignmentViewPanel alpanel,
+ String pdbFilename)
{
+ AlignmentPanel apanel = (AlignmentPanel) alpanel;
+
// TODO : Fix multiple seq to one chain issue here.
/*
* create the mappings
}
}
- /**
- * Check if the PDB file is already loaded, if so offer to add it to the
- * existing viewer
- *
- * @param seq
- * @param chains
- * @param apanel
- * @param pdbId
- * @return true if the user chooses to add to a viewer, or to cancel entirely
- */
- protected boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
- final AlignmentPanel apanel, String pdbId)
+ @Override
+ public boolean addAlreadyLoadedFile(SequenceI[] seq, String[] chains,
+ final AlignmentViewPanel apanel, String pdbId)
{
- boolean finished = false;
String alreadyMapped = apanel.getStructureSelectionManager()
.alreadyMappedToFile(pdbId);
- if (alreadyMapped != null)
+ if (alreadyMapped == null)
{
- /*
- * the PDB file is already loaded
- */
- int option = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
- MessageManager.formatMessage(
- "label.pdb_entry_is_already_displayed", new Object[]
- { pdbId }),
- MessageManager.formatMessage(
- "label.map_sequences_to_visible_window", new Object[]
- { pdbId }),
- JvOptionPane.YES_NO_CANCEL_OPTION);
- if (option == JvOptionPane.CANCEL_OPTION)
- {
- finished = true;
- }
- else if (option == JvOptionPane.YES_OPTION)
- {
- addSequenceMappingsToStructure(seq, chains, apanel, alreadyMapped);
- finished = true;
- }
+ return false;
}
- return finished;
+
+ addSequenceMappingsToStructure(seq, chains, apanel, alreadyMapped);
+ return true;
}
void setChainMenuItems(List<String> chainNames)
int[] alm = new int[_alignwith.size()];
int a = 0;
- for (AlignmentPanel ap : _alignwith)
+ for (AlignmentPanel alignPanel : _alignwith)
{
- als[a] = ap.av.getAlignment();
+ als[a] = alignPanel.av.getAlignment();
alm[a] = -1;
- alc[a++] = ap.av.getAlignment().getHiddenColumns();
+ alc[a++] = alignPanel.av.getAlignment().getHiddenColumns();
}
reply = getBinding().superposeStructures(als, alm, alc);
if (reply != null)
} catch (Exception e)
{
StringBuffer sp = new StringBuffer();
- for (AlignmentPanel ap : _alignwith)
+ for (AlignmentPanel alignPanel : _alignwith)
{
- sp.append("'" + ap.alignFrame.getTitle() + "' ");
+ sp.append("'" + alignPanel.alignFrame.getTitle() + "' ");
}
Cache.log.info("Couldn't align structures with the " + sp.toString()
+ "associated alignment panels.", e);
}
}
// Set the colour using the current view for the associated alignframe
- for (AlignmentPanel ap : _colourwith)
+ for (AlignmentPanel alignPanel : _colourwith)
{
- binding.colourBySequence(ap);
+ binding.colourBySequence(alignPanel);
}
seqColoursApplied = true;
}
/**
* Configures the title and menu items of the viewer panel.
*/
+ @Override
public void updateTitleAndMenus()
{
AAStructureBindingModel binding = getBinding();
}
@Override
+ public String toString()
+ {
+ return getTitle();
+ }
+
+ @Override
public boolean hasMapping()
{
if (worker != null && (addingStructures || _started))
return seqColoursApplied;
}
+ @Override
+ public void raiseViewer()
+ {
+ toFront();
+ }
+
}
*/
public class WsParamSetManager implements ParamManager
{
- Hashtable<String, ParamDatastoreI> paramparsers = new Hashtable<String, ParamDatastoreI>();
+ private static final String WS_PARAM_FILES = "WS_PARAM_FILES";
+ Hashtable<String, ParamDatastoreI> paramparsers = new Hashtable<>();
@Override
public WsParamSetI[] getParameterSet(String name, String serviceUrl,
boolean modifiable, boolean unmodifiable)
{
- String files = Cache.getProperty("WS_PARAM_FILES");
+ String files = Cache.getProperty(WS_PARAM_FILES);
if (files == null)
{
return null;
}
StringTokenizer st = new StringTokenizer(files, "|");
String pfile = null;
- ArrayList<WsParamSetI> params = new ArrayList<WsParamSetI>();
+ ArrayList<WsParamSetI> params = new ArrayList<>();
while (st.hasMoreTokens())
{
pfile = st.nextToken();
} catch (IOException e)
{
Cache.log.info("Failed to parse parameter file " + pfile
- + " (Check that all JALVIEW_WSPARAMFILES entries are valid!)",
+ + " (Check that all " + WS_PARAM_FILES
+ + " entries are valid!)",
e);
}
}
private WsParamSetI[] parseParamFile(String filename) throws IOException
{
- List<WsParamSetI> psets = new ArrayList<WsParamSetI>();
+ List<WsParamSetI> psets = new ArrayList<>();
InputStreamReader is = new InputStreamReader(
new java.io.FileInputStream(new File(filename)), "UTF-8");
}
if (outfile != null)
{
- String paramFiles = jalview.bin.Cache.getDefault("WS_PARAM_FILES",
+ String paramFiles = jalview.bin.Cache.getDefault(WS_PARAM_FILES,
filename);
if (paramFiles.indexOf(filename) == -1)
{
}
paramFiles = paramFiles.concat(filename);
}
- jalview.bin.Cache.setProperty("WS_PARAM_FILES", paramFiles);
+ jalview.bin.Cache.setProperty(WS_PARAM_FILES, paramFiles);
jalview.schemabinding.version2.WebServiceParameterSet paramxml = new jalview.schemabinding.version2.WebServiceParameterSet();
{
return;
}
- String paramFiles = jalview.bin.Cache.getDefault("WS_PARAM_FILES", "");
+ String paramFiles = jalview.bin.Cache.getDefault(WS_PARAM_FILES, "");
if (paramFiles.indexOf(filename) > -1)
{
String nparamFiles = new String();
nparamFiles = nparamFiles.concat("|").concat(fl);
}
}
- jalview.bin.Cache.setProperty("WS_PARAM_FILES", nparamFiles);
+ jalview.bin.Cache.setProperty(WS_PARAM_FILES, nparamFiles);
}
try
AlignViewportI viewport)
{
List<AnnotatedCollectionI> runBuildFor = new ArrayList<>();
+ boolean foundArg = false;
+
for (ArgumentI arg : params)
{
String name = arg.getName();
if (MessageManager.getString("label.hmmbuild_for").equals(name))
{
+ foundArg = true;
String value = arg.getValue();
if (MessageManager.getString("label.alignment").equals(value))
{
}
}
}
+
+ /*
+ * default is to build for the whole alignment
+ */
+ if (!foundArg)
+ {
+ runBuildFor.add(alignment);
+ }
+
return runBuildFor;
}
import jalview.ws.params.ParamDatastoreI;
import jalview.ws.params.WsParamSetI;
import jalview.ws.params.simple.BooleanOption;
+import jalview.ws.params.simple.DoubleParameter;
import jalview.ws.params.simple.IntegerParameter;
import jalview.ws.params.simple.LogarithmicParameter;
import jalview.ws.params.simple.Option;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Scanner;
*/
private void getHMMSearchParams(List<ArgumentI> args)
{
+ /*
+ * 'Options'
+ */
addChoiceOfHmm(args);
- args.add(new IntegerParameter(
- MessageManager.getString("label.number_of_results"),
- MessageManager.getString("label.number_of_results_desc"), true,
- 100, 0, 100000));
String names = Cache.getProperty(Preferences.HMMSEARCH_DBS);
if (names != null && !names.isEmpty())
{
List<String> databases = new ArrayList<>();
- databases.add(MessageManager.getString("label.this_alignment"));
+ databases.add(MessageManager.getString(HMMSearch.THIS_ALIGNMENT_KEY));
Scanner nameScanner = new Scanner(names);
if (nameScanner.hasNext())
}
}
nameScanner.close();
- args.add(new Option(MessageManager.getString("label.database"),
+ args.add(new StringParameter(
+ MessageManager.getString(HMMSearch.DATABASE_KEY),
MessageManager.getString("label.database_for_hmmsearch"),
- true, MessageManager.getString("label.this_alignment"),
- MessageManager.getString("label.this_alignment"), databases,
- null));
+ true, MessageManager.getString(HMMSearch.THIS_ALIGNMENT_KEY),
+ MessageManager.getString(HMMSearch.THIS_ALIGNMENT_KEY),
+ databases));
}
args.add(new BooleanOption(
- MessageManager.getString("label.auto_align_seqs"),
+ MessageManager.getString(HMMSearch.AUTO_ALIGN_SEQS_KEY),
MessageManager.getString("label.auto_align_seqs_desc"), false,
false, true, null));
args.add(new BooleanOption(
- MessageManager.getString("label.use_accessions"),
+ MessageManager.getString(HMMSearch.USE_ACCESSIONS_KEY),
MessageManager.getString("label.use_accessions_desc"), false,
false, true, null));
args.add(new BooleanOption(
- MessageManager.getString("label.trim_termini"),
+ MessageManager.getString(HMMSearch.TRIM_TERMINI_KEY),
MessageManager.getString("label.trim_termini_desc"), false,
false, true, null));
+
+ /*
+ * 'Parameters'
+ */
+ args.add(new IntegerParameter(
+ MessageManager.getString(HMMSearch.NUMBER_OF_RESULTS_KEY),
+ MessageManager.getString("label.number_of_results_desc"), true,
+ 100, 0, 100000));
+ args.add(new StringParameter(
+ MessageManager.getString(HMMSearch.REPORTING_CUTOFF_KEY), null,
+ true, HMMSearch.CUTOFF_NONE, HMMSearch.CUTOFF_NONE,
+ Arrays.asList(HMMSearch.CUTOFF_NONE, HMMSearch.CUTOFF_EVALUE,
+ HMMSearch.CUTOFF_SCORE)));
args.add(new LogarithmicParameter(
- MessageManager.getString("label.seq_e_value"),
+ MessageManager.getString(HMMSearch.SEQ_EVALUE_KEY),
MessageManager.getString("label.seq_e_value_desc"), false, 1D,
- 1E-38, 10D, 10D));
- /*
- args.add(new DoubleParameter(
- MessageManager.getString("label.seq_score"),
- MessageManager.getString("label.seq_score_desc"), false,
- 0d, 0d, 10000d));
- */
+ 1E-38, 10D));
args.add(new LogarithmicParameter(
- MessageManager.getString("label.dom_e_value"),
+ MessageManager.getString(HMMSearch.DOM_EVALUE_KEY),
MessageManager.getString("label.dom_e_value_desc"), false, 1D,
- 1E-38, 10D, 10D));
- /*
- args.add(new DoubleParameter(
- MessageManager.getString("label.dom_score"),
- MessageManager.getString("label.dom_score_desc"), false, 0d,
- 0d,
- 10000d));
- */
+ 1E-38, 10D));
+ args.add(
+ new DoubleParameter(
+ MessageManager.getString(HMMSearch.SEQ_SCORE_KEY),
+ MessageManager.getString("label.seq_score_desc"), false,
+ 0d, 0d, 1000d));
+ args.add(
+ new DoubleParameter(
+ MessageManager.getString(HMMSearch.DOM_SCORE_KEY),
+ MessageManager.getString("label.dom_score_desc"), false,
+ 0d, 0d, 1000d));
}
/**
/**
* Adds an argument representing the choice of HMM sequences (profiles)
- * against which to perform align or search, provided more than one is found
+ * against which to perform align or search, provided at least one is found
*
* @param args
*/
options.add(hmmSeq.getName());
}
String defseq = options.get(0);
- Option option = new Option(MessageManager.getString("label.use_hmm"),
- "", true, defseq, defseq, options, null);
- args.add(option);
+ ArgumentI arg = new StringParameter(
+ MessageManager.getString("label.use_hmm"), null, true, defseq,
+ defseq, options);
+ args.add(arg);
}
}
/*
* choice of whether to compute HMM for alignment and/or group(s)
+ * - only if there are any groups
*/
- Collection<String> options = new ArrayList<>();
- options.add(MessageManager.getString("label.alignment"));
- options.add(MessageManager.getString("label.groups_and_alignment"));
- options.add(MessageManager.getString("label.groups"));
- options.add(MessageManager.getString("label.selected_group"));
- args.add(new Option(MessageManager.getString("label.hmmbuild_for"),
- MessageManager.getString("label.hmmbuild_for_desc"), true,
- MessageManager.getString("label.alignment"),
- MessageManager.getString("label.alignment"), options, null));
+ if (!viewport.getAlignment().getGroups().isEmpty())
+ {
+ Collection<String> options = new ArrayList<>();
+ options.add(MessageManager.getString("label.alignment"));
+ options.add(MessageManager.getString("label.groups_and_alignment"));
+ options.add(MessageManager.getString("label.groups"));
+ options.add(MessageManager.getString("label.selected_group"));
+ args.add(new Option(MessageManager.getString("label.hmmbuild_for"),
+ MessageManager.getString("label.hmmbuild_for_desc"), true,
+ MessageManager.getString("label.alignment"),
+ MessageManager.getString("label.alignment"), options, null));
+ }
}
@Override
public class HMMSearch extends HmmerCommand
{
- private static final String PARAMNAME_NO_OF_RESULTS = MessageManager.getString("label.number_of_results");
-
static final String HMMSEARCH = "hmmsearch";
+ /*
+ * constants for i18n lookup of passed parameter names
+ */
+ static final String DATABASE_KEY = "label.database";
+
+ static final String THIS_ALIGNMENT_KEY = "label.this_alignment";
+
+ static final String USE_ACCESSIONS_KEY = "label.use_accessions";
+
+ static final String AUTO_ALIGN_SEQS_KEY = "label.auto_align_seqs";
+
+ static final String NUMBER_OF_RESULTS_KEY = "label.number_of_results";
+
+ static final String TRIM_TERMINI_KEY = "label.trim_termini";
+
+ static final String REPORTING_CUTOFF_KEY = "label.reporting_cutoff";
+
+ static final String CUTOFF_NONE = "None";
+
+ static final String CUTOFF_SCORE = "Score";
+
+ static final String CUTOFF_EVALUE = "E-Value";
+
+ static final String SEQ_EVALUE_KEY = "label.seq_evalue";
+
+ static final String DOM_EVALUE_KEY = "label.dom_evalue";
+
+ static final String SEQ_SCORE_KEY = "label.seq_score";
+
+ static final String DOM_SCORE_KEY = "label.dom_score";
+
boolean realign = false;
boolean trim = false;
String dbPath = "";
File databaseFile = null;
+ boolean useEvalueCutoff = false;
+ boolean useScoreCutoff = false;
+ String seqEvalueCutoff = null;
+ String domEvalueCutoff = null;
+ String seqScoreCutoff = null;
+ String domScoreCutoff = null;
+
if (params != null)
{
for (ArgumentI arg : params)
{
String name = arg.getName();
- if (MessageManager.getString("label.number_of_results")
+ if (MessageManager.getString(NUMBER_OF_RESULTS_KEY)
.equals(name))
{
seqsToReturn = Integer.parseInt(arg.getValue());
}
- else if (MessageManager.getString("label.auto_align_seqs")
+ else if (MessageManager.getString(AUTO_ALIGN_SEQS_KEY)
.equals(name))
{
realign = true; // TODO: not used
}
- else if (MessageManager.getString("label.use_accessions")
+ else if (MessageManager.getString(USE_ACCESSIONS_KEY)
.equals(name))
{
args.add("--acc");
}
- else if (MessageManager.getString("label.seq_e_value").equals(name))
+ else if (MessageManager.getString(REPORTING_CUTOFF_KEY)
+ .equals(name))
+ {
+ if (CUTOFF_EVALUE.equals(arg.getValue()))
+ {
+ useEvalueCutoff = true;
+ }
+ else if (CUTOFF_SCORE.equals(arg.getValue()))
+ {
+ useScoreCutoff = true;
+ }
+ }
+ else if (MessageManager.getString(SEQ_EVALUE_KEY).equals(name))
{
- args.add("-E");
- args.add(arg.getValue());
+ seqEvalueCutoff = arg.getValue();
}
- else if (MessageManager.getString("label.seq_score").equals(name))
+ else if (MessageManager.getString(SEQ_SCORE_KEY).equals(name))
{
- args.add("-incT");
- args.add(arg.getValue());
+ seqScoreCutoff = arg.getValue();
}
- else if (MessageManager.getString("label.dom_e_value")
+ else if (MessageManager.getString(DOM_EVALUE_KEY)
.equals(name))
{
- args.add("--domE");
- args.add(arg.getValue());
+ domEvalueCutoff = arg.getValue();
}
- else if (MessageManager.getString("label.dom_score").equals(name))
+ else if (MessageManager.getString(DOM_SCORE_KEY).equals(name))
{
- args.add("--incdomT");
- args.add(arg.getValue());
+ domScoreCutoff = arg.getValue();
}
- else if (MessageManager.getString("label.trim_termini")
+ else if (MessageManager.getString(TRIM_TERMINI_KEY)
.equals(name))
{
trim = true;
}
- else if (MessageManager.getString("label.database").equals(name))
+ else if (MessageManager.getString(DATABASE_KEY).equals(name))
{
dbFound = true;
dbPath = arg.getValue();
- if (!MessageManager.getString("label.this_alignment")
+ if (!MessageManager.getString(THIS_ALIGNMENT_KEY)
.equals(dbPath))
{
databaseFile = new File(dbPath);
}
}
- if (!dbFound || MessageManager.getString("label.this_alignment")
+ if (useEvalueCutoff)
+ {
+ args.add("-E");
+ args.add(seqEvalueCutoff);
+ args.add("--domE");
+ args.add(domEvalueCutoff);
+ }
+ else if (useScoreCutoff)
+ {
+ args.add("-T");
+ args.add(seqScoreCutoff);
+ args.add("--domT");
+ args.add(domScoreCutoff);
+ }
+
+ if (!dbFound || MessageManager.getString(THIS_ALIGNMENT_KEY)
.equals(dbPath))
{
/*
copy.deleteSequence(hmmSeq);
}
exportStockholm(copy.getSequencesArray(), databaseFile, null);
- // StockholmFile stoFile = new StockholmFile(copy);
- // stoFile.setSeqs(copy.getSequencesArray());
- // String alignmentString = stoFile.print();
- // PrintWriter writer = new PrintWriter(databaseFile);
- // writer.print(alignmentString);
- // writer.close();
}
args.add(getFilePath(hmmFile));
if (trim)
{
alignArgs.add(new BooleanOption(
- MessageManager.getString("label.trim_termini"),
+ MessageManager.getString(TRIM_TERMINI_KEY),
MessageManager.getString("label.trim_termini_desc"), true,
true, true, null));
}
* Constructor for HMMFile used for exporting
*
* @param hmm
- * @param exportImmediately
*/
public HMMFile(HiddenMarkovModel markov)
{
import jalview.gui.AlignmentPanel;
import jalview.gui.Desktop;
import jalview.gui.JvSwingUtils;
+import jalview.gui.StructureViewer;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
+import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import javax.swing.event.InternalFrameEvent;
import javax.swing.table.TableColumn;
+import net.miginfocom.swing.MigLayout;
+
@SuppressWarnings("serial")
/**
* GUI layout for structure chooser
public abstract class GStructureChooser extends JPanel
implements ItemListener
{
+ private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
+
+ protected static final String VIEWS_FILTER = "VIEWS_FILTER";
+
+ protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE";
+
+ protected static final String VIEWS_ENTER_ID = "VIEWS_ENTER_ID";
+
+ /*
+ * 'cached' structure view
+ */
+ protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
+
protected JPanel statusPanel = new JPanel();
public JLabel statusBar = new JLabel();
- private JPanel pnl_actionsAndStatus = new JPanel(new BorderLayout());
-
protected String frameTitle = MessageManager
.getString("label.structure_chooser");
protected StringBuilder errorWarning = new StringBuilder();
- protected JLabel lbl_result = new JLabel(
- MessageManager.getString("label.select"));
-
- protected JButton btn_view = new JButton();
+ protected JButton btn_add;
- protected JButton btn_cancel = new JButton();
+ protected JButton btn_newView;
protected JButton btn_pdbFromFile = new JButton();
- protected JTextField txt_search = new JTextField(14);
-
- private JPanel pnl_actions = new JPanel();
-
- private JPanel pnl_main = new JPanel();
-
- private JPanel pnl_idInput = new JPanel(new FlowLayout());
+ protected JCheckBox chk_superpose = new JCheckBox(
+ MessageManager.getString("label.superpose_structures"));
- private JPanel pnl_fileChooser = new JPanel(new FlowLayout());
-
- private JPanel pnl_idInputBL = new JPanel(new BorderLayout());
-
- private JPanel pnl_fileChooserBL = new JPanel(new BorderLayout());
-
- private JPanel pnl_locPDB = new JPanel(new BorderLayout());
+ protected JTextField txt_search = new JTextField(14);
protected JPanel pnl_switchableViews = new JPanel(new CardLayout());
protected CardLayout layout_switchableViews = (CardLayout) (pnl_switchableViews
.getLayout());
- private BorderLayout mainLayout = new BorderLayout();
-
- protected JCheckBox chk_rememberSettings = new JCheckBox(
- MessageManager.getString("label.dont_ask_me_again"));
-
protected JCheckBox chk_invertFilter = new JCheckBox(
MessageManager.getString("label.invert"));
protected ImageIcon warningImage = new ImageIcon(
getClass().getResource("/images/warning.gif"));
- protected JLabel lbl_warning = new JLabel(warningImage);
-
protected JLabel lbl_loading = new JLabel(loadingImage);
protected JLabel lbl_pdbManualFetchStatus = new JLabel(errorImage);
protected JLabel lbl_fromFileStatus = new JLabel(errorImage);
- protected AssciateSeqPanel idInputAssSeqPanel = new AssciateSeqPanel();
-
- protected AssciateSeqPanel fileChooserAssSeqPanel = new AssciateSeqPanel();
-
- protected static final String VIEWS_FILTER = "VIEWS_FILTER";
+ protected AssociateSeqPanel idInputAssSeqPanel = new AssociateSeqPanel();
- protected static final String VIEWS_FROM_FILE = "VIEWS_FROM_FILE";
+ protected AssociateSeqPanel fileChooserAssSeqPanel = new AssociateSeqPanel();
- protected static final String VIEWS_ENTER_ID = "VIEWS_ENTER_ID";
-
- /**
- * 'cached' structure view
- */
- protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
+ protected JComboBox<StructureViewer> targetView = new JComboBox<>();
protected JTable tbl_local_pdb = new JTable();
- protected JScrollPane scrl_localPDB = new JScrollPane(tbl_local_pdb);
-
protected JTabbedPane pnl_filter = new JTabbedPane();
protected FTSDataColumnPreferences pdbDocFieldPrefs = new FTSDataColumnPreferences(
}
};
- protected JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary);
-
public GStructureChooser()
{
try
mainFrame.dispose();
break;
case KeyEvent.VK_ENTER: // enter key
- if (btn_view.isEnabled())
+ if (btn_add.isEnabled())
{
- ok_ActionPerformed();
+ add_ActionPerformed();
}
break;
case KeyEvent.VK_TAB: // tab key
}
else
{
- btn_view.requestFocus();
+ btn_add.requestFocus();
}
evt.consume();
break;
}
}
});
+
+ JButton btn_cancel = new JButton(
+ MessageManager.getString("action.cancel"));
+ btn_cancel.setFont(VERDANA_12);
+ btn_cancel.addActionListener(new java.awt.event.ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ closeAction(pnl_filter.getHeight());
+ }
+ });
+ btn_cancel.addKeyListener(new KeyAdapter()
+ {
+ @Override
+ public void keyPressed(KeyEvent evt)
+ {
+ if (evt.getKeyCode() == KeyEvent.VK_ENTER)
+ {
+ closeAction(pnl_filter.getHeight());
+ }
+ }
+ });
+
tbl_local_pdb.setAutoCreateRowSorter(true);
tbl_local_pdb.getTableHeader().setReorderingAllowed(false);
tbl_local_pdb.addMouseListener(new MouseAdapter()
mainFrame.dispose();
break;
case KeyEvent.VK_ENTER: // enter key
- if (btn_view.isEnabled())
+ if (btn_add.isEnabled())
{
- ok_ActionPerformed();
+ add_ActionPerformed();
}
break;
case KeyEvent.VK_TAB: // tab key
}
else
{
- if (btn_view.isEnabled())
+ if (btn_add.isEnabled())
{
- btn_view.requestFocus();
+ btn_add.requestFocus();
}
else
{
}
}
});
- btn_view.setFont(new java.awt.Font("Verdana", 0, 12));
- btn_view.setText(MessageManager.getString("action.view"));
- btn_view.addActionListener(new java.awt.event.ActionListener()
+
+ btn_newView = new JButton(MessageManager.getString("action.new_view"));
+ btn_newView.setFont(VERDANA_12);
+ btn_newView.addActionListener(new java.awt.event.ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- ok_ActionPerformed();
+ newView_ActionPerformed();
}
});
- btn_view.addKeyListener(new KeyAdapter()
+ btn_newView.addKeyListener(new KeyAdapter()
{
@Override
public void keyPressed(KeyEvent evt)
{
if (evt.getKeyCode() == KeyEvent.VK_ENTER)
{
- ok_ActionPerformed();
+ newView_ActionPerformed();
}
}
});
- btn_cancel.setFont(new java.awt.Font("Verdana", 0, 12));
- btn_cancel.setText(MessageManager.getString("action.cancel"));
- btn_cancel.addActionListener(new java.awt.event.ActionListener()
+ btn_add = new JButton(MessageManager.getString("action.add"));
+ btn_add.setFont(VERDANA_12);
+ btn_add.addActionListener(new java.awt.event.ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- closeAction(pnl_filter.getHeight());
+ add_ActionPerformed();
}
});
- btn_cancel.addKeyListener(new KeyAdapter()
+ btn_add.addKeyListener(new KeyAdapter()
{
@Override
public void keyPressed(KeyEvent evt)
{
if (evt.getKeyCode() == KeyEvent.VK_ENTER)
{
- closeAction(pnl_filter.getHeight());
+ add_ActionPerformed();
}
}
});
- btn_pdbFromFile.setFont(new java.awt.Font("Verdana", 0, 12));
+ btn_pdbFromFile.setFont(VERDANA_12);
String btn_title = MessageManager.getString("label.select_pdb_file");
btn_pdbFromFile.setText(btn_title + " ");
btn_pdbFromFile.addActionListener(new java.awt.event.ActionListener()
}
});
+ JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary);
scrl_foundStructures.setPreferredSize(new Dimension(width, height));
+ JScrollPane scrl_localPDB = new JScrollPane(tbl_local_pdb);
scrl_localPDB.setPreferredSize(new Dimension(width, height));
scrl_localPDB.setHorizontalScrollBarPolicy(
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- cmb_filterOption.setFont(new java.awt.Font("Verdana", 0, 12));
- chk_invertFilter.setFont(new java.awt.Font("Verdana", 0, 12));
- chk_rememberSettings.setFont(new java.awt.Font("Verdana", 0, 12));
- chk_rememberSettings.setVisible(false);
+ chk_invertFilter.setFont(VERDANA_12);
txt_search.setToolTipText(JvSwingUtils.wrapTooltip(true,
MessageManager.getString("label.enter_pdb_id_tip")));
- cmb_filterOption.setToolTipText(
- MessageManager.getString("info.select_filter_option"));
txt_search.getDocument().addDocumentListener(new DocumentListener()
{
@Override
}
});
+ cmb_filterOption.setFont(VERDANA_12);
+ cmb_filterOption.setToolTipText(
+ MessageManager.getString("info.select_filter_option"));
cmb_filterOption.addItemListener(this);
-
// add CustomComboSeparatorsRenderer to filter option combo-box
cmb_filterOption.setRenderer(new CustomComboSeparatorsRenderer(
(ListCellRenderer<Object>) cmb_filterOption.getRenderer())
chk_invertFilter.addItemListener(this);
- pnl_actions.add(chk_rememberSettings);
- pnl_actions.add(btn_view);
- pnl_actions.add(btn_cancel);
+ targetView.setVisible(false);
- // pnl_filter.add(lbl_result);
+ JPanel actionsPanel = new JPanel(new MigLayout());
+ actionsPanel.add(targetView, "left");
+ actionsPanel.add(btn_add, "wrap");
+ actionsPanel.add(chk_superpose, "left");
+ actionsPanel.add(btn_newView);
+ actionsPanel.add(btn_cancel, "right");
+
+ JPanel pnl_main = new JPanel();
pnl_main.add(cmb_filterOption);
pnl_main.add(lbl_loading);
pnl_main.add(chk_invertFilter);
lbl_loading.setVisible(false);
+ JPanel pnl_fileChooser = new JPanel(new FlowLayout());
pnl_fileChooser.add(btn_pdbFromFile);
pnl_fileChooser.add(lbl_fromFileStatus);
+ JPanel pnl_fileChooserBL = new JPanel(new BorderLayout());
pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.NORTH);
pnl_fileChooserBL.add(pnl_fileChooser, BorderLayout.CENTER);
+ JPanel pnl_idInput = new JPanel(new FlowLayout());
pnl_idInput.add(txt_search);
pnl_idInput.add(lbl_pdbManualFetchStatus);
+
+ JPanel pnl_idInputBL = new JPanel(new BorderLayout());
pnl_idInputBL.add(idInputAssSeqPanel, BorderLayout.NORTH);
pnl_idInputBL.add(pnl_idInput, BorderLayout.CENTER);
JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
.getSource();
int index = sourceTabbedPane.getSelectedIndex();
- btn_view.setVisible(true);
+ btn_add.setVisible(targetView.isVisible());
+ btn_newView.setVisible(true);
btn_cancel.setVisible(true);
if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
{
- btn_view.setEnabled(false);
+ btn_add.setEnabled(false);
btn_cancel.setEnabled(false);
- btn_view.setVisible(false);
+ btn_add.setVisible(false);
+ btn_newView.setEnabled(false);
btn_cancel.setVisible(false);
previousWantedFields = pdbDocFieldPrefs
.getStructureSummaryFields()
pnl_filter.add(foundStructureSummary, scrl_foundStructures);
pnl_filter.add(configureCols, pdbDocFieldPrefs);
+ JPanel pnl_locPDB = new JPanel(new BorderLayout());
pnl_locPDB.add(scrl_localPDB);
pnl_switchableViews.add(pnl_fileChooserBL, VIEWS_FROM_FILE);
pnl_switchableViews.add(pnl_filter, VIEWS_FILTER);
pnl_switchableViews.add(pnl_locPDB, VIEWS_LOCAL_PDB);
- this.setLayout(mainLayout);
+ this.setLayout(new BorderLayout());
this.add(pnl_main, java.awt.BorderLayout.NORTH);
this.add(pnl_switchableViews, java.awt.BorderLayout.CENTER);
// this.add(pnl_actions, java.awt.BorderLayout.SOUTH);
statusPanel.setLayout(new GridLayout());
- pnl_actionsAndStatus.add(pnl_actions, BorderLayout.CENTER);
+
+ JPanel pnl_actionsAndStatus = new JPanel(new BorderLayout());
+ pnl_actionsAndStatus.add(actionsPanel, BorderLayout.CENTER);
pnl_actionsAndStatus.add(statusPanel, BorderLayout.SOUTH);
statusPanel.add(statusBar, null);
this.add(pnl_actionsAndStatus, java.awt.BorderLayout.SOUTH);
* @author tcnofoegbu
*
*/
- public class AssciateSeqPanel extends JPanel implements ItemListener
+ public class AssociateSeqPanel extends JPanel implements ItemListener
{
private JComboBox<AssociateSeqOptions> cmb_assSeq = new JComboBox<>();
private JLabel lbl_associateSeq = new JLabel();
- public AssciateSeqPanel()
+ public AssociateSeqPanel()
{
this.setLayout(new FlowLayout());
this.add(cmb_assSeq);
protected abstract void stateChanged(ItemEvent e);
- protected abstract void ok_ActionPerformed();
+ protected abstract void add_ActionPerformed();
+
+ protected abstract void newView_ActionPerformed();
protected abstract void pdbFromFile_actionPerformed();
protected abstract void txt_search_ActionPerformed();
- public abstract void populateCmbAssociateSeqOptions(
+ protected abstract void populateCmbAssociateSeqOptions(
JComboBox<AssociateSeqOptions> cmb_assSeq,
JLabel lbl_associateSeq);
- public abstract void cmbAssSeqStateChanged();
+ protected abstract void cmbAssSeqStateChanged();
- public abstract void tabRefresh();
+ protected abstract void tabRefresh();
- public abstract void validateSelections();
+ protected abstract void validateSelections();
}
\ No newline at end of file
package jalview.schemabinding.version2;
-//---------------------------------/
-//- Imported classes and packages -/
+ //---------------------------------/
+ //- Imported classes and packages -/
//---------------------------------/
import org.exolab.castor.xml.Marshaller;
*
* @version $Revision$ $Date$
*/
-public class JSeq implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _colour.
- */
- private int _colour;
-
- /**
- * keeps track of state for field: _colour
- */
- private boolean _has_colour;
-
- /**
- * Field _start.
- */
- private int _start;
-
- /**
- * keeps track of state for field: _start
- */
- private boolean _has_start;
-
- /**
- * Field _end.
- */
- private int _end;
-
- /**
- * keeps track of state for field: _end
- */
- private boolean _has_end;
-
- /**
- * Field _id.
- */
- private java.lang.String _id;
-
- /**
- * Field _hidden.
- */
- private boolean _hidden;
-
- /**
- * keeps track of state for field: _hidden
- */
- private boolean _has_hidden;
-
- /**
- * Field _viewreference.
- */
- private boolean _viewreference;
-
- /**
- * keeps track of state for field: _viewreference
- */
- private boolean _has_viewreference;
-
- /**
- * Field _featuresList.
- */
- private java.util.Vector _featuresList;
-
- /**
- * Field _pdbidsList.
- */
- private java.util.Vector _pdbidsList;
-
- /**
- * Field _hiddenSequencesList.
- */
- private java.util.Vector _hiddenSequencesList;
-
- /**
- * Reference to a viewer showing RNA structure for this sequence. Schema
- * supports one viewer showing multiple annotations for multiple sequences,
- * though currently only one annotation for one sequence (gapped or trimmed)
- * is used
- *
- */
- private java.util.Vector _rnaViewerList;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public JSeq()
- {
- super();
- this._featuresList = new java.util.Vector();
- this._pdbidsList = new java.util.Vector();
- this._hiddenSequencesList = new java.util.Vector();
- this._rnaViewerList = new java.util.Vector();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- *
- *
- * @param vFeatures
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addFeatures(
- final jalview.schemabinding.version2.Features vFeatures)
- throws java.lang.IndexOutOfBoundsException
- {
- this._featuresList.addElement(vFeatures);
- }
-
- /**
- *
- *
- * @param index
- * @param vFeatures
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addFeatures(final int index,
- final jalview.schemabinding.version2.Features vFeatures)
- throws java.lang.IndexOutOfBoundsException
- {
- this._featuresList.add(index, vFeatures);
- }
-
- /**
- *
- *
- * @param vHiddenSequences
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addHiddenSequences(final int vHiddenSequences)
- throws java.lang.IndexOutOfBoundsException
- {
- this._hiddenSequencesList.addElement(new java.lang.Integer(
- vHiddenSequences));
- }
-
- /**
- *
- *
- * @param index
- * @param vHiddenSequences
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addHiddenSequences(final int index, final int vHiddenSequences)
- throws java.lang.IndexOutOfBoundsException
- {
- this._hiddenSequencesList.add(index, new java.lang.Integer(
- vHiddenSequences));
- }
-
- /**
- *
- *
- * @param vPdbids
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addPdbids(final jalview.schemabinding.version2.Pdbids vPdbids)
- throws java.lang.IndexOutOfBoundsException
- {
- this._pdbidsList.addElement(vPdbids);
- }
-
- /**
- *
- *
- * @param index
- * @param vPdbids
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addPdbids(final int index,
- final jalview.schemabinding.version2.Pdbids vPdbids)
- throws java.lang.IndexOutOfBoundsException
- {
- this._pdbidsList.add(index, vPdbids);
- }
-
- /**
- *
- *
- * @param vRnaViewer
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addRnaViewer(
- final jalview.schemabinding.version2.RnaViewer vRnaViewer)
- throws java.lang.IndexOutOfBoundsException
- {
- this._rnaViewerList.addElement(vRnaViewer);
- }
-
- /**
- *
- *
- * @param index
- * @param vRnaViewer
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addRnaViewer(final int index,
- final jalview.schemabinding.version2.RnaViewer vRnaViewer)
- throws java.lang.IndexOutOfBoundsException
- {
- this._rnaViewerList.add(index, vRnaViewer);
- }
-
- /**
- */
- public void deleteColour()
- {
- this._has_colour = false;
- }
-
- /**
- */
- public void deleteEnd()
- {
- this._has_end = false;
- }
-
- /**
- */
- public void deleteHidden()
- {
- this._has_hidden = false;
- }
-
- /**
- */
- public void deleteStart()
- {
- this._has_start = false;
- }
-
- /**
- */
- public void deleteViewreference()
- {
- this._has_viewreference = false;
- }
-
- /**
- * Method enumerateFeatures.
- *
- * @return an Enumeration over all jalview.schemabinding.version2.Features
- * elements
- */
- public java.util.Enumeration enumerateFeatures()
- {
- return this._featuresList.elements();
- }
-
- /**
- * Method enumerateHiddenSequences.
- *
- * @return an Enumeration over all int elements
- */
- public java.util.Enumeration enumerateHiddenSequences()
- {
- return this._hiddenSequencesList.elements();
- }
-
- /**
- * Method enumeratePdbids.
- *
- * @return an Enumeration over all jalview.schemabinding.version2.Pdbids
- * elements
- */
- public java.util.Enumeration enumeratePdbids()
- {
- return this._pdbidsList.elements();
- }
-
- /**
- * Method enumerateRnaViewer.
- *
- * @return an Enumeration over all jalview.schemabinding.version2.RnaViewer
- * elements
- */
- public java.util.Enumeration enumerateRnaViewer()
- {
- return this._rnaViewerList.elements();
- }
-
- /**
- * Returns the value of field 'colour'.
- *
- * @return the value of field 'Colour'.
- */
- public int getColour()
- {
- return this._colour;
- }
-
- /**
- * Returns the value of field 'end'.
- *
- * @return the value of field 'End'.
- */
- public int getEnd()
- {
- return this._end;
- }
-
- /**
- * Method getFeatures.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the jalview.schemabinding.version2.Features at the
- * given index
- */
- public jalview.schemabinding.version2.Features getFeatures(final int index)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._featuresList.size())
- {
- throw new IndexOutOfBoundsException("getFeatures: Index value '"
- + index + "' not in range [0.."
- + (this._featuresList.size() - 1) + "]");
- }
-
- return (jalview.schemabinding.version2.Features) _featuresList
- .get(index);
- }
-
- /**
- * Method getFeatures.Returns the contents of the collection in an Array.
- * <p>
- * Note: Just in case the collection contents are changing in another thread,
- * we pass a 0-length Array of the correct type into the API call. This way we
- * <i>know</i> that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public jalview.schemabinding.version2.Features[] getFeatures()
- {
- jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
- return (jalview.schemabinding.version2.Features[]) this._featuresList
- .toArray(array);
- }
-
- /**
- * Method getFeaturesCount.
- *
- * @return the size of this collection
- */
- public int getFeaturesCount()
- {
- return this._featuresList.size();
- }
-
- /**
- * Returns the value of field 'hidden'.
- *
- * @return the value of field 'Hidden'.
- */
- public boolean getHidden()
- {
- return this._hidden;
- }
-
- /**
- * Method getHiddenSequences.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the int at the given index
- */
- public int getHiddenSequences(final int index)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._hiddenSequencesList.size())
- {
- throw new IndexOutOfBoundsException(
- "getHiddenSequences: Index value '" + index
- + "' not in range [0.."
- + (this._hiddenSequencesList.size() - 1) + "]");
- }
-
- return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
- }
-
- /**
- * Method getHiddenSequences.Returns the contents of the collection in an
- * Array.
- *
- * @return this collection as an Array
- */
- public int[] getHiddenSequences()
- {
- int size = this._hiddenSequencesList.size();
- int[] array = new int[size];
- java.util.Iterator iter = _hiddenSequencesList.iterator();
- for (int index = 0; index < size; index++)
- {
- array[index] = ((java.lang.Integer) iter.next()).intValue();
- }
- return array;
- }
-
- /**
- * Method getHiddenSequencesCount.
- *
- * @return the size of this collection
- */
- public int getHiddenSequencesCount()
- {
- return this._hiddenSequencesList.size();
- }
-
- /**
- * Returns the value of field 'id'.
- *
- * @return the value of field 'Id'.
- */
- public java.lang.String getId()
- {
- return this._id;
- }
-
- /**
- * Method getPdbids.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the jalview.schemabinding.version2.Pdbids at the given
- * index
- */
- public jalview.schemabinding.version2.Pdbids getPdbids(final int index)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._pdbidsList.size())
- {
- throw new IndexOutOfBoundsException("getPdbids: Index value '"
- + index + "' not in range [0.."
- + (this._pdbidsList.size() - 1) + "]");
- }
-
- return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
- }
-
- /**
- * Method getPdbids.Returns the contents of the collection in an Array.
- * <p>
- * Note: Just in case the collection contents are changing in another thread,
- * we pass a 0-length Array of the correct type into the API call. This way we
- * <i>know</i> that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public jalview.schemabinding.version2.Pdbids[] getPdbids()
- {
- jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
- return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList
- .toArray(array);
- }
-
- /**
- * Method getPdbidsCount.
- *
- * @return the size of this collection
- */
- public int getPdbidsCount()
- {
- return this._pdbidsList.size();
- }
-
- /**
- * Method getRnaViewer.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the jalview.schemabinding.version2.RnaViewer at the
- * given index
- */
- public jalview.schemabinding.version2.RnaViewer getRnaViewer(
- final int index) throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._rnaViewerList.size())
- {
- throw new IndexOutOfBoundsException("getRnaViewer: Index value '"
- + index + "' not in range [0.."
- + (this._rnaViewerList.size() - 1) + "]");
- }
-
- return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList
- .get(index);
- }
-
- /**
- * Method getRnaViewer.Returns the contents of the collection in an Array.
- * <p>
- * Note: Just in case the collection contents are changing in another thread,
- * we pass a 0-length Array of the correct type into the API call. This way we
- * <i>know</i> that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public jalview.schemabinding.version2.RnaViewer[] getRnaViewer()
- {
- jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0];
- return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList
- .toArray(array);
- }
-
- /**
- * Method getRnaViewerCount.
- *
- * @return the size of this collection
- */
- public int getRnaViewerCount()
- {
- return this._rnaViewerList.size();
- }
-
- /**
- * Returns the value of field 'start'.
- *
- * @return the value of field 'Start'.
- */
- public int getStart()
- {
- return this._start;
- }
-
- /**
- * Returns the value of field 'viewreference'.
- *
- * @return the value of field 'Viewreference'.
- */
- public boolean getViewreference()
- {
- return this._viewreference;
- }
-
- /**
- * Method hasColour.
- *
- * @return true if at least one Colour has been added
- */
- public boolean hasColour()
- {
- return this._has_colour;
- }
-
- /**
- * Method hasEnd.
- *
- * @return true if at least one End has been added
- */
- public boolean hasEnd()
- {
- return this._has_end;
- }
-
- /**
- * Method hasHidden.
- *
- * @return true if at least one Hidden has been added
- */
- public boolean hasHidden()
- {
- return this._has_hidden;
- }
-
- /**
- * Method hasStart.
- *
- * @return true if at least one Start has been added
- */
- public boolean hasStart()
- {
- return this._has_start;
- }
-
- /**
- * Method hasViewreference.
- *
- * @return true if at least one Viewreference has been added
- */
- public boolean hasViewreference()
- {
- return this._has_viewreference;
- }
-
- /**
- * Returns the value of field 'hidden'.
- *
- * @return the value of field 'Hidden'.
- */
- public boolean isHidden()
- {
- return this._hidden;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- * Returns the value of field 'viewreference'.
- *
- * @return the value of field 'Viewreference'.
- */
- public boolean isViewreference()
- {
- return this._viewreference;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllFeatures()
- {
- this._featuresList.clear();
- }
-
- /**
- */
- public void removeAllHiddenSequences()
- {
- this._hiddenSequencesList.clear();
- }
-
- /**
- */
- public void removeAllPdbids()
- {
- this._pdbidsList.clear();
- }
-
- /**
- */
- public void removeAllRnaViewer()
- {
- this._rnaViewerList.clear();
- }
-
- /**
- * Method removeFeatures.
- *
- * @param vFeatures
- * @return true if the object was removed from the collection.
- */
- public boolean removeFeatures(
- final jalview.schemabinding.version2.Features vFeatures)
- {
- boolean removed = _featuresList.remove(vFeatures);
- return removed;
- }
-
- /**
- * Method removeFeaturesAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public jalview.schemabinding.version2.Features removeFeaturesAt(
- final int index)
- {
- java.lang.Object obj = this._featuresList.remove(index);
- return (jalview.schemabinding.version2.Features) obj;
- }
-
- /**
- * Method removeHiddenSequences.
- *
- * @param vHiddenSequences
- * @return true if the object was removed from the collection.
- */
- public boolean removeHiddenSequences(final int vHiddenSequences)
- {
- boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(
- vHiddenSequences));
- return removed;
- }
-
- /**
- * Method removeHiddenSequencesAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public int removeHiddenSequencesAt(final int index)
- {
- java.lang.Object obj = this._hiddenSequencesList.remove(index);
- return ((java.lang.Integer) obj).intValue();
- }
-
- /**
- * Method removePdbids.
- *
- * @param vPdbids
- * @return true if the object was removed from the collection.
- */
- public boolean removePdbids(
- final jalview.schemabinding.version2.Pdbids vPdbids)
- {
- boolean removed = _pdbidsList.remove(vPdbids);
- return removed;
- }
-
- /**
- * Method removePdbidsAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public jalview.schemabinding.version2.Pdbids removePdbidsAt(
- final int index)
- {
- java.lang.Object obj = this._pdbidsList.remove(index);
- return (jalview.schemabinding.version2.Pdbids) obj;
- }
-
- /**
- * Method removeRnaViewer.
- *
- * @param vRnaViewer
- * @return true if the object was removed from the collection.
- */
- public boolean removeRnaViewer(
- final jalview.schemabinding.version2.RnaViewer vRnaViewer)
- {
- boolean removed = _rnaViewerList.remove(vRnaViewer);
- return removed;
- }
-
- /**
- * Method removeRnaViewerAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt(
- final int index)
- {
- java.lang.Object obj = this._rnaViewerList.remove(index);
- return (jalview.schemabinding.version2.RnaViewer) obj;
- }
-
- /**
- * Sets the value of field 'colour'.
- *
- * @param colour
- * the value of field 'colour'.
- */
- public void setColour(final int colour)
- {
- this._colour = colour;
- this._has_colour = true;
- }
-
- /**
- * Sets the value of field 'end'.
- *
- * @param end
- * the value of field 'end'.
- */
- public void setEnd(final int end)
- {
- this._end = end;
- this._has_end = true;
- }
-
- /**
- *
- *
- * @param index
- * @param vFeatures
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setFeatures(final int index,
- final jalview.schemabinding.version2.Features vFeatures)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._featuresList.size())
- {
- throw new IndexOutOfBoundsException("setFeatures: Index value '"
- + index + "' not in range [0.."
- + (this._featuresList.size() - 1) + "]");
- }
-
- this._featuresList.set(index, vFeatures);
- }
-
- /**
- *
- *
- * @param vFeaturesArray
- */
- public void setFeatures(
- final jalview.schemabinding.version2.Features[] vFeaturesArray)
- {
- // -- copy array
- _featuresList.clear();
-
- for (int i = 0; i < vFeaturesArray.length; i++)
- {
- this._featuresList.add(vFeaturesArray[i]);
- }
- }
-
- /**
- * Sets the value of field 'hidden'.
- *
- * @param hidden
- * the value of field 'hidden'.
- */
- public void setHidden(final boolean hidden)
- {
- this._hidden = hidden;
- this._has_hidden = true;
- }
-
- /**
- *
- *
- * @param index
- * @param vHiddenSequences
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setHiddenSequences(final int index, final int vHiddenSequences)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._hiddenSequencesList.size())
- {
- throw new IndexOutOfBoundsException(
- "setHiddenSequences: Index value '" + index
- + "' not in range [0.."
- + (this._hiddenSequencesList.size() - 1) + "]");
- }
-
- this._hiddenSequencesList.set(index, new java.lang.Integer(
- vHiddenSequences));
- }
-
- /**
- *
- *
- * @param vHiddenSequencesArray
- */
- public void setHiddenSequences(final int[] vHiddenSequencesArray)
- {
- // -- copy array
- _hiddenSequencesList.clear();
-
- for (int i = 0; i < vHiddenSequencesArray.length; i++)
- {
- this._hiddenSequencesList.add(new java.lang.Integer(
- vHiddenSequencesArray[i]));
- }
- }
-
- /**
- * Sets the value of field 'id'.
- *
- * @param id
- * the value of field 'id'.
- */
- public void setId(final java.lang.String id)
- {
- this._id = id;
- }
-
- /**
- *
- *
- * @param index
- * @param vPdbids
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setPdbids(final int index,
- final jalview.schemabinding.version2.Pdbids vPdbids)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._pdbidsList.size())
- {
- throw new IndexOutOfBoundsException("setPdbids: Index value '"
- + index + "' not in range [0.."
- + (this._pdbidsList.size() - 1) + "]");
- }
-
- this._pdbidsList.set(index, vPdbids);
- }
-
- /**
- *
- *
- * @param vPdbidsArray
- */
- public void setPdbids(
- final jalview.schemabinding.version2.Pdbids[] vPdbidsArray)
- {
- // -- copy array
- _pdbidsList.clear();
-
- for (int i = 0; i < vPdbidsArray.length; i++)
- {
- this._pdbidsList.add(vPdbidsArray[i]);
- }
- }
-
- /**
- *
- *
- * @param index
- * @param vRnaViewer
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setRnaViewer(final int index,
- final jalview.schemabinding.version2.RnaViewer vRnaViewer)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._rnaViewerList.size())
- {
- throw new IndexOutOfBoundsException("setRnaViewer: Index value '"
- + index + "' not in range [0.."
- + (this._rnaViewerList.size() - 1) + "]");
- }
-
- this._rnaViewerList.set(index, vRnaViewer);
- }
-
- /**
- *
- *
- * @param vRnaViewerArray
- */
- public void setRnaViewer(
- final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray)
- {
- // -- copy array
- _rnaViewerList.clear();
-
- for (int i = 0; i < vRnaViewerArray.length; i++)
- {
- this._rnaViewerList.add(vRnaViewerArray[i]);
- }
- }
-
- /**
- * Sets the value of field 'start'.
- *
- * @param start
- * the value of field 'start'.
- */
- public void setStart(final int start)
- {
- this._start = start;
- this._has_start = true;
- }
-
- /**
- * Sets the value of field 'viewreference'.
- *
- * @param viewreference
- * the value of field 'viewreference'.
- */
- public void setViewreference(final boolean viewreference)
- {
- this._viewreference = viewreference;
- this._has_viewreference = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.JSeq
- */
- public static jalview.schemabinding.version2.JSeq unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(
- jalview.schemabinding.version2.JSeq.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
+public class JSeq implements java.io.Serializable {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * Field _colour.
+ */
+ private int _colour;
+
+ /**
+ * keeps track of state for field: _colour
+ */
+ private boolean _has_colour;
+
+ /**
+ * Field _start.
+ */
+ private int _start;
+
+ /**
+ * keeps track of state for field: _start
+ */
+ private boolean _has_start;
+
+ /**
+ * Field _end.
+ */
+ private int _end;
+
+ /**
+ * keeps track of state for field: _end
+ */
+ private boolean _has_end;
+
+ /**
+ * Field _id.
+ */
+ private java.lang.String _id;
+
+ /**
+ * Field _hidden.
+ */
+ private boolean _hidden;
+
+ /**
+ * keeps track of state for field: _hidden
+ */
+ private boolean _has_hidden;
+
+ /**
+ * Field _viewreference.
+ */
+ private boolean _viewreference;
+
+ /**
+ * keeps track of state for field: _viewreference
+ */
+ private boolean _has_viewreference;
+
+ /**
+ * Field _featuresList.
+ */
+ private java.util.Vector _featuresList;
+
+ /**
+ * Field _pdbidsList.
+ */
+ private java.util.Vector _pdbidsList;
+
+ /**
+ * Field _hiddenSequencesList.
+ */
+ private java.util.Vector _hiddenSequencesList;
+
+ /**
+ * Reference to a viewer showing RNA structure
+ * for this sequence. Schema supports one viewer showing
+ * multiple
+ * annotations for multiple sequences, though currently only
+ * one
+ * annotation for one sequence (gapped or trimmed) is used
+ *
+ */
+ private java.util.Vector _rnaViewerList;
+
+ /**
+ * name of the project jar entry that holds the HMM file with
+ * the profile for the sequence
+ */
+ private java.lang.String _hmmerProfile;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ public JSeq() {
+ super();
+ this._featuresList = new java.util.Vector();
+ this._pdbidsList = new java.util.Vector();
+ this._hiddenSequencesList = new java.util.Vector();
+ this._rnaViewerList = new java.util.Vector();
+ }
+
+
+ //-----------/
+ //- Methods -/
+ //-----------/
+
+ /**
+ *
+ *
+ * @param vFeatures
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addFeatures(
+ final jalview.schemabinding.version2.Features vFeatures)
+ throws java.lang.IndexOutOfBoundsException {
+ this._featuresList.addElement(vFeatures);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vFeatures
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addFeatures(
+ final int index,
+ final jalview.schemabinding.version2.Features vFeatures)
+ throws java.lang.IndexOutOfBoundsException {
+ this._featuresList.add(index, vFeatures);
+ }
+
+ /**
+ *
+ *
+ * @param vHiddenSequences
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addHiddenSequences(
+ final int vHiddenSequences)
+ throws java.lang.IndexOutOfBoundsException {
+ this._hiddenSequencesList.addElement(new java.lang.Integer(vHiddenSequences));
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vHiddenSequences
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addHiddenSequences(
+ final int index,
+ final int vHiddenSequences)
+ throws java.lang.IndexOutOfBoundsException {
+ this._hiddenSequencesList.add(index, new java.lang.Integer(vHiddenSequences));
+ }
+
+ /**
+ *
+ *
+ * @param vPdbids
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addPdbids(
+ final jalview.schemabinding.version2.Pdbids vPdbids)
+ throws java.lang.IndexOutOfBoundsException {
+ this._pdbidsList.addElement(vPdbids);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vPdbids
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addPdbids(
+ final int index,
+ final jalview.schemabinding.version2.Pdbids vPdbids)
+ throws java.lang.IndexOutOfBoundsException {
+ this._pdbidsList.add(index, vPdbids);
+ }
+
+ /**
+ *
+ *
+ * @param vRnaViewer
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addRnaViewer(
+ final jalview.schemabinding.version2.RnaViewer vRnaViewer)
+ throws java.lang.IndexOutOfBoundsException {
+ this._rnaViewerList.addElement(vRnaViewer);
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vRnaViewer
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void addRnaViewer(
+ final int index,
+ final jalview.schemabinding.version2.RnaViewer vRnaViewer)
+ throws java.lang.IndexOutOfBoundsException {
+ this._rnaViewerList.add(index, vRnaViewer);
+ }
+
+ /**
+ */
+ public void deleteColour(
+ ) {
+ this._has_colour= false;
+ }
+
+ /**
+ */
+ public void deleteEnd(
+ ) {
+ this._has_end= false;
+ }
+
+ /**
+ */
+ public void deleteHidden(
+ ) {
+ this._has_hidden= false;
+ }
+
+ /**
+ */
+ public void deleteStart(
+ ) {
+ this._has_start= false;
+ }
+
+ /**
+ */
+ public void deleteViewreference(
+ ) {
+ this._has_viewreference= false;
+ }
+
+ /**
+ * Method enumerateFeatures.
+ *
+ * @return an Enumeration over all
+ * jalview.schemabinding.version2.Features elements
+ */
+ public java.util.Enumeration enumerateFeatures(
+ ) {
+ return this._featuresList.elements();
+ }
+
+ /**
+ * Method enumerateHiddenSequences.
+ *
+ * @return an Enumeration over all int elements
+ */
+ public java.util.Enumeration enumerateHiddenSequences(
+ ) {
+ return this._hiddenSequencesList.elements();
+ }
+
+ /**
+ * Method enumeratePdbids.
+ *
+ * @return an Enumeration over all
+ * jalview.schemabinding.version2.Pdbids elements
+ */
+ public java.util.Enumeration enumeratePdbids(
+ ) {
+ return this._pdbidsList.elements();
+ }
+
+ /**
+ * Method enumerateRnaViewer.
+ *
+ * @return an Enumeration over all
+ * jalview.schemabinding.version2.RnaViewer elements
+ */
+ public java.util.Enumeration enumerateRnaViewer(
+ ) {
+ return this._rnaViewerList.elements();
+ }
+
+ /**
+ * Returns the value of field 'colour'.
+ *
+ * @return the value of field 'Colour'.
+ */
+ public int getColour(
+ ) {
+ return this._colour;
+ }
+
+ /**
+ * Returns the value of field 'end'.
+ *
+ * @return the value of field 'End'.
+ */
+ public int getEnd(
+ ) {
+ return this._end;
+ }
+
+ /**
+ * Method getFeatures.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the
+ * jalview.schemabinding.version2.Features at the given index
+ */
+ public jalview.schemabinding.version2.Features getFeatures(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._featuresList.size()) {
+ throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
+ }
+
+ return (jalview.schemabinding.version2.Features) _featuresList.get(index);
+ }
+
+ /**
+ * Method getFeatures.Returns the contents of the collection in
+ * an Array. <p>Note: Just in case the collection contents
+ * are changing in another thread, we pass a 0-length Array of
+ * the correct type into the API call. This way we <i>know</i>
+ * that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public jalview.schemabinding.version2.Features[] getFeatures(
+ ) {
+ jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0];
+ return (jalview.schemabinding.version2.Features[]) this._featuresList.toArray(array);
+ }
+
+ /**
+ * Method getFeaturesCount.
+ *
+ * @return the size of this collection
+ */
+ public int getFeaturesCount(
+ ) {
+ return this._featuresList.size();
+ }
+
+ /**
+ * Returns the value of field 'hidden'.
+ *
+ * @return the value of field 'Hidden'.
+ */
+ public boolean getHidden(
+ ) {
+ return this._hidden;
+ }
+
+ /**
+ * Method getHiddenSequences.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the int at the given index
+ */
+ public int getHiddenSequences(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._hiddenSequencesList.size()) {
+ throw new IndexOutOfBoundsException("getHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
+ }
+
+ return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue();
+ }
+
+ /**
+ * Method getHiddenSequences.Returns the contents of the
+ * collection in an Array.
+ *
+ * @return this collection as an Array
+ */
+ public int[] getHiddenSequences(
+ ) {
+ int size = this._hiddenSequencesList.size();
+ int[] array = new int[size];
+ java.util.Iterator iter = _hiddenSequencesList.iterator();
+ for (int index = 0; index < size; index++) {
+ array[index] = ((java.lang.Integer) iter.next()).intValue();
+ }
+ return array;
+ }
+
+ /**
+ * Method getHiddenSequencesCount.
+ *
+ * @return the size of this collection
+ */
+ public int getHiddenSequencesCount(
+ ) {
+ return this._hiddenSequencesList.size();
+ }
+
+ /**
+ * Returns the value of field 'hmmerProfile'. The field
+ * 'hmmerProfile' has the following description: name of the
+ * project jar entry that holds the HMM file with the profile
+ * for the sequence
+ *
+ * @return the value of field 'HmmerProfile'.
+ */
+ public java.lang.String getHmmerProfile(
+ ) {
+ return this._hmmerProfile;
+ }
+
+ /**
+ * Returns the value of field 'id'.
+ *
+ * @return the value of field 'Id'.
+ */
+ public java.lang.String getId(
+ ) {
+ return this._id;
+ }
+
+ /**
+ * Method getPdbids.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the
+ * jalview.schemabinding.version2.Pdbids at the given index
+ */
+ public jalview.schemabinding.version2.Pdbids getPdbids(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._pdbidsList.size()) {
+ throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
+ }
+
+ return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index);
+ }
+
+ /**
+ * Method getPdbids.Returns the contents of the collection in
+ * an Array. <p>Note: Just in case the collection contents
+ * are changing in another thread, we pass a 0-length Array of
+ * the correct type into the API call. This way we <i>know</i>
+ * that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public jalview.schemabinding.version2.Pdbids[] getPdbids(
+ ) {
+ jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0];
+ return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList.toArray(array);
+ }
+
+ /**
+ * Method getPdbidsCount.
+ *
+ * @return the size of this collection
+ */
+ public int getPdbidsCount(
+ ) {
+ return this._pdbidsList.size();
+ }
+
+ /**
+ * Method getRnaViewer.
+ *
+ * @param index
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ * @return the value of the
+ * jalview.schemabinding.version2.RnaViewer at the given index
+ */
+ public jalview.schemabinding.version2.RnaViewer getRnaViewer(
+ final int index)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._rnaViewerList.size()) {
+ throw new IndexOutOfBoundsException("getRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]");
+ }
+
+ return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList.get(index);
+ }
+
+ /**
+ * Method getRnaViewer.Returns the contents of the collection
+ * in an Array. <p>Note: Just in case the collection contents
+ * are changing in another thread, we pass a 0-length Array of
+ * the correct type into the API call. This way we <i>know</i>
+ * that the Array returned is of exactly the correct length.
+ *
+ * @return this collection as an Array
+ */
+ public jalview.schemabinding.version2.RnaViewer[] getRnaViewer(
+ ) {
+ jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0];
+ return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList.toArray(array);
+ }
+
+ /**
+ * Method getRnaViewerCount.
+ *
+ * @return the size of this collection
+ */
+ public int getRnaViewerCount(
+ ) {
+ return this._rnaViewerList.size();
+ }
+
+ /**
+ * Returns the value of field 'start'.
+ *
+ * @return the value of field 'Start'.
+ */
+ public int getStart(
+ ) {
+ return this._start;
+ }
+
+ /**
+ * Returns the value of field 'viewreference'.
+ *
+ * @return the value of field 'Viewreference'.
+ */
+ public boolean getViewreference(
+ ) {
+ return this._viewreference;
+ }
+
+ /**
+ * Method hasColour.
+ *
+ * @return true if at least one Colour has been added
+ */
+ public boolean hasColour(
+ ) {
+ return this._has_colour;
+ }
+
+ /**
+ * Method hasEnd.
+ *
+ * @return true if at least one End has been added
+ */
+ public boolean hasEnd(
+ ) {
+ return this._has_end;
+ }
+
+ /**
+ * Method hasHidden.
+ *
+ * @return true if at least one Hidden has been added
+ */
+ public boolean hasHidden(
+ ) {
+ return this._has_hidden;
+ }
+
+ /**
+ * Method hasStart.
+ *
+ * @return true if at least one Start has been added
+ */
+ public boolean hasStart(
+ ) {
+ return this._has_start;
+ }
+
+ /**
+ * Method hasViewreference.
+ *
+ * @return true if at least one Viewreference has been added
+ */
+ public boolean hasViewreference(
+ ) {
+ return this._has_viewreference;
+ }
+
+ /**
+ * Returns the value of field 'hidden'.
+ *
+ * @return the value of field 'Hidden'.
+ */
+ public boolean isHidden(
+ ) {
+ return this._hidden;
+ }
+
+ /**
+ * Method isValid.
+ *
+ * @return true if this object is valid according to the schema
+ */
+ public boolean isValid(
+ ) {
+ try {
+ validate();
+ } catch (org.exolab.castor.xml.ValidationException vex) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns the value of field 'viewreference'.
+ *
+ * @return the value of field 'Viewreference'.
+ */
+ public boolean isViewreference(
+ ) {
+ return this._viewreference;
+ }
+
+ /**
+ *
+ *
+ * @param out
+ * @throws org.exolab.castor.xml.MarshalException if object is
+ * null or if any SAXException is thrown during marshaling
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
+ */
+ public void marshal(
+ final java.io.Writer out)
+ throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, out);
+ }
+
+ /**
+ *
+ *
+ * @param handler
+ * @throws java.io.IOException if an IOException occurs during
+ * marshaling
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
+ * @throws org.exolab.castor.xml.MarshalException if object is
+ * null or if any SAXException is thrown during marshaling
+ */
+ public void marshal(
+ final org.xml.sax.ContentHandler handler)
+ throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+ Marshaller.marshal(this, handler);
+ }
+
+ /**
+ */
+ public void removeAllFeatures(
+ ) {
+ this._featuresList.clear();
+ }
+
+ /**
+ */
+ public void removeAllHiddenSequences(
+ ) {
+ this._hiddenSequencesList.clear();
+ }
+
+ /**
+ */
+ public void removeAllPdbids(
+ ) {
+ this._pdbidsList.clear();
+ }
+
+ /**
+ */
+ public void removeAllRnaViewer(
+ ) {
+ this._rnaViewerList.clear();
+ }
+
+ /**
+ * Method removeFeatures.
+ *
+ * @param vFeatures
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeFeatures(
+ final jalview.schemabinding.version2.Features vFeatures) {
+ boolean removed = _featuresList.remove(vFeatures);
+ return removed;
+ }
+
+ /**
+ * Method removeFeaturesAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public jalview.schemabinding.version2.Features removeFeaturesAt(
+ final int index) {
+ java.lang.Object obj = this._featuresList.remove(index);
+ return (jalview.schemabinding.version2.Features) obj;
+ }
+
+ /**
+ * Method removeHiddenSequences.
+ *
+ * @param vHiddenSequences
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeHiddenSequences(
+ final int vHiddenSequences) {
+ boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(vHiddenSequences));
+ return removed;
+ }
+
+ /**
+ * Method removeHiddenSequencesAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public int removeHiddenSequencesAt(
+ final int index) {
+ java.lang.Object obj = this._hiddenSequencesList.remove(index);
+ return ((java.lang.Integer) obj).intValue();
+ }
+
+ /**
+ * Method removePdbids.
+ *
+ * @param vPdbids
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removePdbids(
+ final jalview.schemabinding.version2.Pdbids vPdbids) {
+ boolean removed = _pdbidsList.remove(vPdbids);
+ return removed;
+ }
+
+ /**
+ * Method removePdbidsAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public jalview.schemabinding.version2.Pdbids removePdbidsAt(
+ final int index) {
+ java.lang.Object obj = this._pdbidsList.remove(index);
+ return (jalview.schemabinding.version2.Pdbids) obj;
+ }
+
+ /**
+ * Method removeRnaViewer.
+ *
+ * @param vRnaViewer
+ * @return true if the object was removed from the collection.
+ */
+ public boolean removeRnaViewer(
+ final jalview.schemabinding.version2.RnaViewer vRnaViewer) {
+ boolean removed = _rnaViewerList.remove(vRnaViewer);
+ return removed;
+ }
+
+ /**
+ * Method removeRnaViewerAt.
+ *
+ * @param index
+ * @return the element removed from the collection
+ */
+ public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt(
+ final int index) {
+ java.lang.Object obj = this._rnaViewerList.remove(index);
+ return (jalview.schemabinding.version2.RnaViewer) obj;
+ }
+
+ /**
+ * Sets the value of field 'colour'.
+ *
+ * @param colour the value of field 'colour'.
+ */
+ public void setColour(
+ final int colour) {
+ this._colour = colour;
+ this._has_colour = true;
+ }
+
+ /**
+ * Sets the value of field 'end'.
+ *
+ * @param end the value of field 'end'.
+ */
+ public void setEnd(
+ final int end) {
+ this._end = end;
+ this._has_end = true;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vFeatures
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setFeatures(
+ final int index,
+ final jalview.schemabinding.version2.Features vFeatures)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._featuresList.size()) {
+ throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]");
+ }
+
+ this._featuresList.set(index, vFeatures);
+ }
+
+ /**
+ *
+ *
+ * @param vFeaturesArray
+ */
+ public void setFeatures(
+ final jalview.schemabinding.version2.Features[] vFeaturesArray) {
+ //-- copy array
+ _featuresList.clear();
+
+ for (int i = 0; i < vFeaturesArray.length; i++) {
+ this._featuresList.add(vFeaturesArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of field 'hidden'.
+ *
+ * @param hidden the value of field 'hidden'.
+ */
+ public void setHidden(
+ final boolean hidden) {
+ this._hidden = hidden;
+ this._has_hidden = true;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vHiddenSequences
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setHiddenSequences(
+ final int index,
+ final int vHiddenSequences)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._hiddenSequencesList.size()) {
+ throw new IndexOutOfBoundsException("setHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]");
+ }
+
+ this._hiddenSequencesList.set(index, new java.lang.Integer(vHiddenSequences));
+ }
+
+ /**
+ *
+ *
+ * @param vHiddenSequencesArray
+ */
+ public void setHiddenSequences(
+ final int[] vHiddenSequencesArray) {
+ //-- copy array
+ _hiddenSequencesList.clear();
+
+ for (int i = 0; i < vHiddenSequencesArray.length; i++) {
+ this._hiddenSequencesList.add(new java.lang.Integer(vHiddenSequencesArray[i]));
+ }
+ }
+
+ /**
+ * Sets the value of field 'hmmerProfile'. The field
+ * 'hmmerProfile' has the following description: name of the
+ * project jar entry that holds the HMM file with the profile
+ * for the sequence
+ *
+ * @param hmmerProfile the value of field 'hmmerProfile'.
+ */
+ public void setHmmerProfile(
+ final java.lang.String hmmerProfile) {
+ this._hmmerProfile = hmmerProfile;
+ }
+
+ /**
+ * Sets the value of field 'id'.
+ *
+ * @param id the value of field 'id'.
+ */
+ public void setId(
+ final java.lang.String id) {
+ this._id = id;
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vPdbids
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setPdbids(
+ final int index,
+ final jalview.schemabinding.version2.Pdbids vPdbids)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._pdbidsList.size()) {
+ throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]");
+ }
+
+ this._pdbidsList.set(index, vPdbids);
+ }
+
+ /**
+ *
+ *
+ * @param vPdbidsArray
+ */
+ public void setPdbids(
+ final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) {
+ //-- copy array
+ _pdbidsList.clear();
+
+ for (int i = 0; i < vPdbidsArray.length; i++) {
+ this._pdbidsList.add(vPdbidsArray[i]);
+ }
+ }
+
+ /**
+ *
+ *
+ * @param index
+ * @param vRnaViewer
+ * @throws java.lang.IndexOutOfBoundsException if the index
+ * given is outside the bounds of the collection
+ */
+ public void setRnaViewer(
+ final int index,
+ final jalview.schemabinding.version2.RnaViewer vRnaViewer)
+ throws java.lang.IndexOutOfBoundsException {
+ // check bounds for index
+ if (index < 0 || index >= this._rnaViewerList.size()) {
+ throw new IndexOutOfBoundsException("setRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]");
+ }
+
+ this._rnaViewerList.set(index, vRnaViewer);
+ }
+
+ /**
+ *
+ *
+ * @param vRnaViewerArray
+ */
+ public void setRnaViewer(
+ final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray) {
+ //-- copy array
+ _rnaViewerList.clear();
+
+ for (int i = 0; i < vRnaViewerArray.length; i++) {
+ this._rnaViewerList.add(vRnaViewerArray[i]);
+ }
+ }
+
+ /**
+ * Sets the value of field 'start'.
+ *
+ * @param start the value of field 'start'.
+ */
+ public void setStart(
+ final int start) {
+ this._start = start;
+ this._has_start = true;
+ }
+
+ /**
+ * Sets the value of field 'viewreference'.
+ *
+ * @param viewreference the value of field 'viewreference'.
+ */
+ public void setViewreference(
+ final boolean viewreference) {
+ this._viewreference = viewreference;
+ this._has_viewreference = true;
+ }
+
+ /**
+ * Method unmarshal.
+ *
+ * @param reader
+ * @throws org.exolab.castor.xml.MarshalException if object is
+ * null or if any SAXException is thrown during marshaling
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
+ * @return the unmarshaled jalview.schemabinding.version2.JSeq
+ */
+ public static jalview.schemabinding.version2.JSeq unmarshal(
+ final java.io.Reader reader)
+ throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
+ return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(jalview.schemabinding.version2.JSeq.class, reader);
+ }
+
+ /**
+ *
+ *
+ * @throws org.exolab.castor.xml.ValidationException if this
+ * object is an invalid instance according to the schema
+ */
+ public void validate(
+ )
+ throws org.exolab.castor.xml.ValidationException {
+ org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
+ validator.validate(this);
+ }
}
package jalview.schemabinding.version2.descriptors;
-//---------------------------------/
-//- Imported classes and packages -/
+ //---------------------------------/
+ //- Imported classes and packages -/
//---------------------------------/
import jalview.schemabinding.version2.JSeq;
*
* @version $Revision$ $Date$
*/
-public class JSeqDescriptor extends
- org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public JSeqDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "JSeq";
- _elementDefinition = true;
-
- // -- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- _colour
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_colour", "colour",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- if (!target.hasColour())
- {
- return null;
+public class JSeqDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
+
+
+ //--------------------------/
+ //- Class/Member Variables -/
+ //--------------------------/
+
+ /**
+ * Field _elementDefinition.
+ */
+ private boolean _elementDefinition;
+
+ /**
+ * Field _nsPrefix.
+ */
+ private java.lang.String _nsPrefix;
+
+ /**
+ * Field _nsURI.
+ */
+ private java.lang.String _nsURI;
+
+ /**
+ * Field _xmlName.
+ */
+ private java.lang.String _xmlName;
+
+
+ //----------------/
+ //- Constructors -/
+ //----------------/
+
+ public JSeqDescriptor() {
+ super();
+ _nsURI = "www.jalview.org";
+ _xmlName = "JSeq";
+ _elementDefinition = true;
+
+ //-- set grouping compositor
+ setCompositorAsSequence();
+ org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
+ org.exolab.castor.mapping.FieldHandler handler = null;
+ org.exolab.castor.xml.FieldValidator fieldValidator = null;
+ //-- initialize attribute descriptors
+
+ //-- _colour
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ if (!target.hasColour()) { return null; }
+ return new java.lang.Integer(target.getColour());
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteColour();
+ return;
+ }
+ target.setColour( ((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _colour
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { //-- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
- return new java.lang.Integer(target.getColour());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteColour();
- return;
- }
- target.setColour(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
+ desc.setValidator(fieldValidator);
+ //-- _start
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ if (!target.hasStart()) { return null; }
+ return new java.lang.Integer(target.getStart());
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ // ignore null values for non optional primitives
+ if (value == null) { return; }
+
+ target.setStart( ((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _start
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { //-- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _colour
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _start
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_start", "start",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- if (!target.hasStart())
- {
- return null;
+ desc.setValidator(fieldValidator);
+ //-- _end
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ if (!target.hasEnd()) { return null; }
+ return new java.lang.Integer(target.getEnd());
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ // ignore null values for non optional primitives
+ if (value == null) { return; }
+
+ target.setEnd( ((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _end
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { //-- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
- return new java.lang.Integer(target.getStart());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- // ignore null values for non optional primitives
- if (value == null)
- {
- return;
- }
-
- target.setStart(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
+ desc.setValidator(fieldValidator);
+ //-- _id
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ return target.getId();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ target.setId( (java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setRequired(true);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _id
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(1);
+ { //-- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _start
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _end
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_end", "end",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- if (!target.hasEnd())
- {
- return null;
+ desc.setValidator(fieldValidator);
+ //-- _hidden
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_hidden", "hidden", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ if (!target.hasHidden()) { return null; }
+ return (target.getHidden() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteHidden();
+ return;
+ }
+ target.setHidden( ((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _hidden
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { //-- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
}
- return new java.lang.Integer(target.getEnd());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- // ignore null values for non optional primitives
- if (value == null)
- {
- return;
- }
-
- target.setEnd(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
+ desc.setValidator(fieldValidator);
+ //-- _viewreference
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_viewreference", "viewreference", org.exolab.castor.xml.NodeType.Attribute);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ if (!target.hasViewreference()) { return null; }
+ return (target.getViewreference() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ // if null, use delete method for optional primitives
+ if (value == null) {
+ target.deleteViewreference();
+ return;
+ }
+ target.setViewreference( ((java.lang.Boolean) value).booleanValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _viewreference
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { //-- local scope
+ org.exolab.castor.xml.validators.BooleanValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
+ fieldValidator.setValidator(typeValidator);
}
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _end
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _id
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.String.class, "_id", "id",
- org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- return target.getId();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.setId((java.lang.String) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
+ desc.setValidator(fieldValidator);
+ //-- initialize element descriptors
+
+ //-- _featuresList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Features.class, "_featuresList", "features", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ return target.getFeatures();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ target.addFeatures( (jalview.schemabinding.version2.Features) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
+ try {
+ JSeq target = (JSeq) object;
+ target.removeAllFeatures();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new jalview.schemabinding.version2.Features();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("www.jalview.org");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _featuresList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { //-- local scope
}
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _id
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- // -- _hidden
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_hidden", "hidden",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- if (!target.hasHidden())
- {
- return null;
+ desc.setValidator(fieldValidator);
+ //-- _pdbidsList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Pdbids.class, "_pdbidsList", "pdbids", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ return target.getPdbids();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ target.addPdbids( (jalview.schemabinding.version2.Pdbids) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
+ try {
+ JSeq target = (JSeq) object;
+ target.removeAllPdbids();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new jalview.schemabinding.version2.Pdbids();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("www.jalview.org");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _pdbidsList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { //-- local scope
}
- return (target.getHidden() ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteHidden();
- return;
- }
- target.setHidden(((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
+ desc.setValidator(fieldValidator);
+ //-- _hiddenSequencesList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_hiddenSequencesList", "hiddenSequences", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ return target.getHiddenSequences();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ // ignore null values for non optional primitives
+ if (value == null) { return; }
+
+ target.addHiddenSequences( ((java.lang.Integer) value).intValue());
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
+ try {
+ JSeq target = (JSeq) object;
+ target.removeAllHiddenSequences();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("www.jalview.org");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _hiddenSequencesList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { //-- local scope
+ org.exolab.castor.xml.validators.IntValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.IntValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setMinInclusive(-2147483648);
+ typeValidator.setMaxInclusive(2147483647);
}
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _hidden
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- // -- _viewreference
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_viewreference", "viewreference",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- if (!target.hasViewreference())
- {
- return null;
+ desc.setValidator(fieldValidator);
+ //-- _rnaViewerList
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.RnaViewer.class, "_rnaViewerList", "rnaViewer", org.exolab.castor.xml.NodeType.Element);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ return target.getRnaViewer();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ target.addRnaViewer( (jalview.schemabinding.version2.RnaViewer) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
+ try {
+ JSeq target = (JSeq) object;
+ target.removeAllRnaViewer();
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return new jalview.schemabinding.version2.RnaViewer();
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("www.jalview.org");
+ desc.setMultivalued(true);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _rnaViewerList
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ fieldValidator.setMinOccurs(0);
+ { //-- local scope
}
- return (target.getViewreference() ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteViewreference();
- return;
- }
- target.setViewreference(((java.lang.Boolean) value)
- .booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
+ desc.setValidator(fieldValidator);
+ //-- _hmmerProfile
+ desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_hmmerProfile", "hmmerProfile", org.exolab.castor.xml.NodeType.Element);
+ desc.setImmutable(true);
+ handler = new org.exolab.castor.xml.XMLFieldHandler() {
+ public java.lang.Object getValue( java.lang.Object object )
+ throws IllegalStateException
+ {
+ JSeq target = (JSeq) object;
+ return target.getHmmerProfile();
+ }
+ public void setValue( java.lang.Object object, java.lang.Object value)
+ throws IllegalStateException, IllegalArgumentException
+ {
+ try {
+ JSeq target = (JSeq) object;
+ target.setHmmerProfile( (java.lang.String) value);
+ } catch (java.lang.Exception ex) {
+ throw new IllegalStateException(ex.toString());
+ }
+ }
+ public java.lang.Object newInstance(java.lang.Object parent) {
+ return null;
+ }
+ };
+ desc.setHandler(handler);
+ desc.setNameSpaceURI("www.jalview.org");
+ desc.setMultivalued(false);
+ addFieldDescriptor(desc);
+
+ //-- validation code for: _hmmerProfile
+ fieldValidator = new org.exolab.castor.xml.FieldValidator();
+ { //-- local scope
+ org.exolab.castor.xml.validators.StringValidator typeValidator;
+ typeValidator = new org.exolab.castor.xml.validators.StringValidator();
+ fieldValidator.setValidator(typeValidator);
+ typeValidator.setWhiteSpace("preserve");
}
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _viewreference
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
+ desc.setValidator(fieldValidator);
}
- desc.setValidator(fieldValidator);
- // -- initialize element descriptors
- // -- _featuresList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.Features.class, "_featuresList",
- "features", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- return target.getFeatures();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.addFeatures((jalview.schemabinding.version2.Features) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public void resetValue(Object object) throws IllegalStateException,
- IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.removeAllFeatures();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.Features();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
+ //-----------/
+ //- Methods -/
+ //-----------/
- // -- validation code for: _featuresList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { // -- local scope
+ /**
+ * Method getAccessMode.
+ *
+ * @return the access mode specified for this class.
+ */
+ public org.exolab.castor.mapping.AccessMode getAccessMode(
+ ) {
+ return null;
}
- desc.setValidator(fieldValidator);
- // -- _pdbidsList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.Pdbids.class, "_pdbidsList",
- "pdbids", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- return target.getPdbids();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.addPdbids((jalview.schemabinding.version2.Pdbids) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public void resetValue(Object object) throws IllegalStateException,
- IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.removeAllPdbids();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.Pdbids();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- // -- validation code for: _pdbidsList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { // -- local scope
+ /**
+ * Method getIdentity.
+ *
+ * @return the identity field, null if this class has no
+ * identity.
+ */
+ public org.exolab.castor.mapping.FieldDescriptor getIdentity(
+ ) {
+ return super.getIdentity();
}
- desc.setValidator(fieldValidator);
- // -- _hiddenSequencesList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_hiddenSequencesList",
- "hiddenSequences", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- return target.getHiddenSequences();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- // ignore null values for non optional primitives
- if (value == null)
- {
- return;
- }
-
- target.addHiddenSequences(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
- public void resetValue(Object object) throws IllegalStateException,
- IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.removeAllHiddenSequences();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- // -- validation code for: _hiddenSequencesList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
+ /**
+ * Method getJavaClass.
+ *
+ * @return the Java class represented by this descriptor.
+ */
+ public java.lang.Class getJavaClass(
+ ) {
+ return jalview.schemabinding.version2.JSeq.class;
}
- desc.setValidator(fieldValidator);
- // -- _rnaViewerList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.RnaViewer.class,
- "_rnaViewerList", "rnaViewer",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- JSeq target = (JSeq) object;
- return target.getRnaViewer();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.addRnaViewer((jalview.schemabinding.version2.RnaViewer) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public void resetValue(Object object) throws IllegalStateException,
- IllegalArgumentException
- {
- try
- {
- JSeq target = (JSeq) object;
- target.removeAllRnaViewer();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.RnaViewer();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
- // -- validation code for: _rnaViewerList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { // -- local scope
+ /**
+ * Method getNameSpacePrefix.
+ *
+ * @return the namespace prefix to use when marshaling as XML.
+ */
+ public java.lang.String getNameSpacePrefix(
+ ) {
+ return _nsPrefix;
}
- desc.setValidator(fieldValidator);
- }
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.JSeq.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
+ /**
+ * Method getNameSpaceURI.
+ *
+ * @return the namespace URI used when marshaling and
+ * unmarshaling as XML.
+ */
+ public java.lang.String getNameSpaceURI(
+ ) {
+ return _nsURI;
+ }
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
+ /**
+ * Method getValidator.
+ *
+ * @return a specific validator for the class described by this
+ * ClassDescriptor.
+ */
+ public org.exolab.castor.xml.TypeValidator getValidator(
+ ) {
+ return this;
+ }
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
+ /**
+ * Method getXMLName.
+ *
+ * @return the XML Name for the Class being described.
+ */
+ public java.lang.String getXMLName(
+ ) {
+ return _xmlName;
+ }
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
+ /**
+ * Method isElementDefinition.
+ *
+ * @return true if XML schema definition of this Class is that
+ * of a global
+ * element or element with anonymous type definition.
+ */
+ public boolean isElementDefinition(
+ ) {
+ return _elementDefinition;
+ }
}
public class StructureMapping
{
+ public static final int UNASSIGNED_VALUE = Integer.MIN_VALUE;
+
+ private static final int PDB_RES_NUM_INDEX = 0;
+
+ private static final int PDB_ATOM_NUM_INDEX = 1;
+
String mappingDetails;
SequenceI sequence;
String pdbchain;
- public static final int UNASSIGNED_VALUE = Integer.MIN_VALUE;
-
- private static final int PDB_RES_NUM_INDEX = 0;
-
- private static final int PDB_ATOM_NUM_INDEX = 1;
-
// Mapping key is residue index while value is an array containing PDB resNum,
// and atomNo
HashMap<Integer, int[]> mapping;
jalview.datamodel.Mapping seqToPdbMapping = null;
+
/**
* Constructor
*
*/
public List<int[]> getPDBResNumRanges(int fromSeqPos, int toSeqPos)
{
- List<int[]> result = new ArrayList<int[]>();
+ List<int[]> result = new ArrayList<>();
int startRes = -1;
int endRes = -1;
{
return seqToPdbMapping;
}
+
+ /**
+ * A hash function that satisfies the contract that if two mappings are
+ * equal(), they have the same hashCode
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((mappingDetails == null) ? 0 : mappingDetails.hashCode());
+ result = prime * result
+ + ((pdbchain == null) ? 0 : pdbchain.hashCode());
+ result = prime * result + ((pdbfile == null) ? 0 : pdbfile.hashCode());
+ result = prime * result + ((pdbid == null) ? 0 : pdbid.hashCode());
+ result = prime * result
+ + ((seqToPdbMapping == null) ? 0 : seqToPdbMapping.hashCode());
+ result = prime * result
+ + ((sequence == null) ? 0 : sequence.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (getClass() != obj.getClass())
+ {
+ return false;
+ }
+ StructureMapping other = (StructureMapping) obj;
+ if (mappingDetails == null)
+ {
+ if (other.mappingDetails != null)
+ {
+ return false;
+ }
+ }
+ else if (!mappingDetails.equals(other.mappingDetails))
+ {
+ return false;
+ }
+ if (pdbchain == null)
+ {
+ if (other.pdbchain != null)
+ {
+ return false;
+ }
+ }
+ else if (!pdbchain.equals(other.pdbchain))
+ {
+ return false;
+ }
+ if (pdbfile == null)
+ {
+ if (other.pdbfile != null)
+ {
+ return false;
+ }
+ }
+ else if (!pdbfile.equals(other.pdbfile))
+ {
+ return false;
+ }
+ if (pdbid == null)
+ {
+ if (other.pdbid != null)
+ {
+ return false;
+ }
+ }
+ else if (!pdbid.equals(other.pdbid))
+ {
+ return false;
+ }
+ if (seqToPdbMapping == null)
+ {
+ if (other.seqToPdbMapping != null)
+ {
+ return false;
+ }
+ }
+ else if (!seqToPdbMapping.equals(other.seqToPdbMapping))
+ {
+ return false;
+ }
+ if (sequence != other.sequence)
+ {
+ return false;
+ }
+
+ return true;
+ }
}
}
/**
- * Returns the file name for a mapped PDB id (or null if not mapped).
+ * Returns the filename the PDB id is already mapped to if known, or null if
+ * it is not mapped
*
* @param pdbid
* @return
{
for (StructureMapping sm : mappings)
{
- if (sm.getPdbId().equals(pdbid))
+ if (sm.getPdbId().equalsIgnoreCase(pdbid))
{
return sm.pdbfile;
}
{
System.err.println(e.getMessage());
}
+ catch (Exception e)
+ {
+ System.err
+ .println(
+ "Unexpected exception during SIFTS mapping - falling back to NW for this sequence/structure pair");
+ System.err.println(e.getMessage());
+ }
}
if (!foundSiftsMappings.isEmpty())
{
}
if (forStructureView)
{
- mappings.addAll(seqToStrucMapping);
+ for (StructureMapping sm : seqToStrucMapping)
+ {
+ addStructureMapping(sm); // not addAll!
+ }
}
if (progress != null)
{
public void addStructureMapping(StructureMapping sm)
{
- mappings.add(sm);
+ if (!mappings.contains(sm))
+ {
+ mappings.add(sm);
+ }
}
/**
{
int hashCode = 31 * fromRatio;
hashCode = 31 * hashCode + toRatio;
- hashCode = 31 * hashCode + fromShifts.toArray().hashCode();
- hashCode = 31 * hashCode + toShifts.toArray().hashCode();
+ for (int[] shift : fromShifts)
+ {
+ hashCode = 31 * hashCode + shift[0];
+ hashCode = 31 * hashCode + shift[1];
+ }
+ for (int[] shift : toShifts)
+ {
+ hashCode = 31 * hashCode + shift[0];
+ hashCode = 31 * hashCode + shift[1];
+ }
+
return hashCode;
}
@Override
public void run()
{
+ if (alignViewport.getAlignment().getHmmSequences().isEmpty())
+ {
+ return;
+ }
if (calcMan.isPending(this))
{
return;
final double max;
- final double base; // todo is this even needed?
-
@Override
public ValueConstrainI getValidValue()
{
max = parm.max;
min = parm.min;
defval = 0D;
- base = parm.base;
}
public LogarithmicParameter(String name, String description,
- boolean required, Double defValue, double min, double max,
- double base)
+ boolean required, Double defValue, double min, double max)
{
super(name, description, required, String.valueOf(defValue), null, null,
null);
defval = defValue;
this.min = min;
this.max = max;
- this.base = base;
}
public LogarithmicParameter(String name, String description,
boolean required, Double defValue, double value, double min,
- double max, double base)
+ double max)
{
super(name, description, required, String.valueOf(defValue),
String.valueOf(value), null, null);
defval = defValue;
this.min = min;
this.max = max;
- this.base = base;
}
@Override
{
return new LogarithmicParameter(this);
}
-
- public double getBase()
- {
- return base;
- }
}
*/
package jalview.ws.params.simple;
+import java.util.List;
+
+/**
+ * A parameter with options intended to be rendered as radio buttons
+ */
public class StringChoiceParameter extends Option
{
+ /**
+ * Constructor
+ *
+ * @param name
+ * @param description
+ * @param options
+ * @param def
+ */
+ public StringChoiceParameter(String name, String description,
+ List<String> options, String def)
+ {
+ super(name, description, true, def, def, options, null);
+ }
}
import jalview.ws.params.ParameterI;
import jalview.ws.params.ValueConstrainI;
-import java.net.URL;
-import java.util.List;
+import java.util.Collection;
public class StringParameter extends Option implements ParameterI
{
-
- @Override
- public URL getFurtherDetails()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean isRequired()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public String getDescription()
- {
- // TODO Auto-generated method stub
- return description;
- }
-
- @Override
- public List<String> getPossibleValues()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getName()
- {
- // TODO Auto-generated method stub
- return name;
- }
-
- @Override
- public String getValue()
- {
- // TODO Auto-generated method stub
- return value;
- }
-
- @Override
- public void setValue(String selectedItem)
- {
- value = selectedItem;
-
- }
-
@Override
public ValueConstrainI getValidValue()
{
- // TODO Auto-generated method stub
return new StringValueConstrain();
}
String.valueOf(value), null, null);
this.defvalue = defValue;
}
+
+ /**
+ * Constructor for a parameter with a list of possible values
+ *
+ * @param name2
+ * @param description2
+ * @param isrequired
+ * @param defValue
+ * @param value
+ * @param possibleVals
+ */
+ public StringParameter(String name2, String description2,
+ boolean isrequired, String defValue, String value,
+ Collection<String> possibleVals)
+ {
+ super(name2, description2, isrequired, defValue, value, possibleVals,
+ null);
+ }
}
a3.resName = "ASP";
a3.resNumber = 41;
- Vector<Bond> v = new Vector<Bond>();
+ Vector<Bond> v = new Vector<>();
v.add(new Bond(a1, a2));
v.add(new Bond(a2, a3));
v.add(new Bond(a3, a1));
@Test(groups = { "Functional" })
public void testMakeResidueList_noAnnotation()
{
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
c.isNa = true;
atoms.add(makeAtom(4, "N", "MET"));
@Test(groups = { "Functional" })
public void testMakeResidueList_withTempFactor()
{
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "MET"));
atoms.get(atoms.size() - 1).tfactor = 1f;
atoms.add(makeAtom(5, "CA", "LYS"));
atoms.get(atoms.size() - 1).tfactor = 9f;
atoms.add(makeAtom(6, "O", "LEU"));
- atoms.get(atoms.size() - 1).tfactor = 4f;
+ atoms.get(atoms.size() - 1).tfactor = -4f;
atoms.add(makeAtom(6, "N", "LEU"));
atoms.get(atoms.size() - 1).tfactor = 5f;
atoms.add(makeAtom(6, "CA", "LEU"));
/*
* Verify annotations; note the tempFactor is read from the first atom in
- * each residue i.e. we expect values 1, 7, 4 for the residues
+ * each residue i.e. we expect values 1, 7, -4 for the residues
*/
AlignmentAnnotation[] ann = c.sequence.getAnnotation();
assertEquals(1, ann.length);
assertEquals("Temperature Factor for 1gaqA", ann[0].description);
assertSame(c.sequence, ann[0].sequenceRef);
assertEquals(AlignmentAnnotation.LINE_GRAPH, ann[0].graph);
- assertEquals(0f, ann[0].graphMin, 0.001f);
+ assertEquals(-4f, ann[0].graphMin, 0.001f);
assertEquals(7f, ann[0].graphMax, 0.001f);
assertEquals(3, ann[0].annotations.length);
assertEquals(1f, ann[0].annotations[0].value, 0.001f);
assertEquals(7f, ann[0].annotations[1].value, 0.001f);
- assertEquals(4f, ann[0].annotations[2].value, 0.001f);
+ assertEquals(-4f, ann[0].annotations[2].value, 0.001f);
}
/**
public void testMakeCaBondList()
{
c.isNa = true;
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "MET"));
atoms.add(makeAtom(4, "CA", "MET"));
public void testMakeCaBondList_nucleotide()
{
c.isNa = false;
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "G"));
atoms.add(makeAtom(4, "P", "G"));
@Test(groups = { "Functional" })
public void testMakeExactMapping()
{
- Vector<Atom> atoms = new Vector<Atom>();
+ Vector<Atom> atoms = new Vector<>();
c.atoms = atoms;
atoms.add(makeAtom(4, "N", "MET"));
atoms.add(makeAtom(4, "CA", "MET"));
sq.sequenceChanged();
assertEquals(6, sq.findIndex(9));
- sq = new Sequence("test/8-13", "-A--B-C-D-E-F--");
+ final String aligned = "-A--B-C-D-E-F--";
+ assertEquals(15, aligned.length());
+ sq = new Sequence("test/8-13", aligned);
assertEquals(2, sq.findIndex(8));
sq.sequenceChanged();
assertEquals(5, sq.findIndex(9));
// beyond end returns last residue column
sq.sequenceChanged();
assertEquals(13, sq.findIndex(99));
+
+ /*
+ * residue before sequence 'end' but beyond end of sequence returns
+ * length of sequence (last column) (rightly or wrongly!)
+ */
+ sq = new Sequence("test/8-15", "A-B-C-"); // trailing gap case
+ assertEquals(6, sq.getLength());
+ sq.sequenceChanged();
+ assertEquals(sq.getLength(), sq.findIndex(14));
+ sq = new Sequence("test/8-99", "-A--B-C-D"); // trailing residue case
+ sq.sequenceChanged();
+ assertEquals(sq.getLength(), sq.findIndex(65));
+
+ /*
+ * residue after sequence 'start' but before first residue returns
+ * zero (before first column) (rightly or wrongly!)
+ */
+ sq = new Sequence("test/8-15", "-A-B-C-"); // leading gap case
+ sq.sequenceChanged();
+ assertEquals(0, sq.findIndex(3));
+ sq = new Sequence("test/8-15", "A-B-C-"); // leading residue case
+ sq.sequenceChanged();
+ assertEquals(0, sq.findIndex(2));
}
/**
{
Sequence sq = new Sequence("test/8-13", "-A--BCD-EF--");
- // find F given A
+ // find F given A, check cursor is now at the found position
assertEquals(10, sq.findIndex(13, new SequenceCursor(sq, 8, 2, 0)));
+ SequenceCursor cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertEquals(13, cursor.residuePosition);
+ assertEquals(10, cursor.columnPosition);
// find A given F
assertEquals(2, sq.findIndex(8, new SequenceCursor(sq, 13, 10, 0)));
+ cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertEquals(8, cursor.residuePosition);
+ assertEquals(2, cursor.columnPosition);
- // find C given C
+ // find C given C (no cursor update is done for this case)
assertEquals(6, sq.findIndex(10, new SequenceCursor(sq, 10, 6, 0)));
+ SequenceCursor cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertSame(cursor2, cursor);
+
+ /*
+ * sequence 'end' beyond end of sequence returns length of sequence
+ * (for compatibility with pre-cursor code)
+ * - also verify the cursor is left in a valid state
+ */
+ sq = new Sequence("test/8-99", "-A--B-C-D-E-F--"); // trailing gap case
+ assertEquals(7, sq.findIndex(10)); // establishes a cursor
+ cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertEquals(10, cursor.residuePosition);
+ assertEquals(7, cursor.columnPosition);
+ assertEquals(sq.getLength(), sq.findIndex(65));
+ cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertSame(cursor, cursor2); // not updated for this case!
+
+ sq = new Sequence("test/8-99", "-A--B-C-D-E-F"); // trailing residue case
+ sq.findIndex(10); // establishes a cursor
+ cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertEquals(sq.getLength(), sq.findIndex(65));
+ cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertSame(cursor, cursor2); // not updated for this case!
+
+ /*
+ * residue after sequence 'start' but before first residue should return
+ * zero (for compatibility with pre-cursor code)
+ */
+ sq = new Sequence("test/8-15", "-A-B-C-"); // leading gap case
+ sq.findIndex(10); // establishes a cursor
+ cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertEquals(0, sq.findIndex(3));
+ cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertSame(cursor, cursor2); // not updated for this case!
+
+ sq = new Sequence("test/8-15", "A-B-C-"); // leading residue case
+ sq.findIndex(10); // establishes a cursor
+ cursor = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertEquals(0, sq.findIndex(2));
+ cursor2 = (SequenceCursor) PA.getValue(sq, "cursor");
+ assertSame(cursor, cursor2); // not updated for this case!
}
@Test(groups = { "Functional" })
/**
* clear down attributes map before tests
*/
- @BeforeClass
+ @BeforeClass(alwaysRun = true)
public void setUp()
{
FeatureAttributes fa = FeatureAttributes.getInstance();
/**
* clear down attributes map after tests
*/
- @AfterMethod
+ @AfterMethod(alwaysRun = true)
public void tearDown()
{
FeatureAttributes fa = FeatureAttributes.getInstance();
*/
package jalview.ext.jmol;
+import static org.junit.Assert.assertNotNull;
+import static org.testng.Assert.assertEquals;
import static org.testng.AssertJUnit.assertTrue;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SearchResultsI;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.JvOptionPane;
import jalview.gui.StructureViewer;
import jalview.gui.StructureViewer.ViewerType;
import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
+import jalview.io.FileLoader;
+
+import java.lang.reflect.InvocationTargetException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
- Jalview.main(new String[] { "-noquestionnaire", "-nonews", "-props",
- "test/jalview/ext/rbvi/chimera/testProps.jvprops" });
+ Jalview.main(
+ new String[]
+ { "-noquestionnaire", "-nonews", "-props",
+ "test/jalview/ext/rbvi/chimera/testProps.jvprops" });
}
/**
@Test(groups = { "Functional" })
public void testSingleSeqViewJMol()
{
- Cache.setProperty(Preferences.STRUCTURE_DISPLAY, ViewerType.JMOL.name());
+ Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
+ ViewerType.JMOL.name());
String inFile = "examples/1gaq.txt";
- AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
- inFile, DataSourceType.FILE);
+ AlignFrame af = new jalview.io.FileLoader()
+ .LoadFileWaitTillLoaded(inFile, DataSourceType.FILE);
assertTrue("Didn't read input file " + inFile, af != null);
for (SequenceI sq : af.getViewport().getAlignment().getSequences())
{
{
for (int q = 0; q < dsq.getAllPDBEntries().size(); q++)
{
- final StructureViewer structureViewer = new StructureViewer(af
- .getViewport().getStructureSelectionManager());
+ final StructureViewer structureViewer = new StructureViewer(
+ af.getViewport().getStructureSelectionManager());
structureViewer.setViewerType(ViewerType.JMOL);
JalviewStructureDisplayI jmolViewer = structureViewer
.viewStructures(dsq.getAllPDBEntries().elementAt(q),
- new SequenceI[] { sq }, af.getCurrentView()
- .getAlignPanel());
+ new SequenceI[]
+ { sq }, af.getCurrentView().getAlignPanel());
/*
* Wait for viewer load thread to complete
*/
}
}
+ @Test(groups = { "Functional" })
+ public void testAddStrToSingleSeqViewJMol()
+ throws InvocationTargetException, InterruptedException
+ {
+ Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
+ ViewerType.JMOL.name());
+ String inFile = "examples/1gaq.txt";
+ AlignFrame af = new jalview.io.FileLoader(true)
+ .LoadFileWaitTillLoaded(inFile, DataSourceType.FILE);
+ assertTrue("Didn't read input file " + inFile, af != null);
+ // show a structure for 4th Sequence
+ SequenceI sq1 = af.getViewport().getAlignment().getSequences().get(0);
+ final StructureViewer structureViewer = new StructureViewer(
+ af.getViewport().getStructureSelectionManager());
+ structureViewer.setViewerType(ViewerType.JMOL);
+ JalviewStructureDisplayI jmolViewer = structureViewer.viewStructures(
+ sq1.getDatasetSequence().getAllPDBEntries().elementAt(0),
+ new SequenceI[]
+ { sq1 }, af.getCurrentView().getAlignPanel());
+ /*
+ * Wait for viewer load thread to complete
+ */
+ try
+ {
+ while (!jmolViewer.getBinding().isFinishedInit())
+ {
+ Thread.sleep(500);
+ }
+ } catch (InterruptedException e)
+ {
+ }
+
+ assertTrue(jmolViewer.isVisible());
+
+ // add another pdb file and add it to view
+ final String _inFile = "examples/3W5V.pdb";
+ inFile = _inFile;
+ FileLoader fl = new FileLoader();
+ fl.LoadFile(af.getCurrentView(), _inFile, DataSourceType.FILE,
+ FileFormat.PDB);
+ try
+ {
+ int time = 0;
+ do
+ {
+ Thread.sleep(50); // hope we can avoid race condition
+
+ } while (++time < 30
+ && af.getViewport().getAlignment().getHeight() == 3);
+ } catch (Exception q)
+ {
+ }
+ ;
+ assertTrue("Didn't paste additional structure" + inFile,
+ af.getViewport().getAlignment().getHeight() > 3);
+ SequenceI sq2 = af.getViewport().getAlignment().getSequenceAt(3);
+ PDBEntry pdbe = sq2.getDatasetSequence().getAllPDBEntries().get(0);
+ assertTrue(pdbe.getFile().contains(inFile));
+ structureViewer.viewStructures(pdbe, new SequenceI[] { sq2 },
+ af.alignPanel);
+ /*
+ * Wait for viewer load thread to complete
+ */
+ try
+ {
+ while (structureViewer.isBusy())
+ {
+ Thread.sleep(500);
+ }
+ } catch (InterruptedException e)
+ {
+ }
+ assertEquals(jmolViewer.getBinding().getPdbCount(), 2);
+ String mouseOverTest = "[GLY]293:A.CA/2.1 #2164";
+ ((JalviewJmolBinding) jmolViewer.getBinding()).mouseOverStructure(2164,
+ mouseOverTest);
+ SearchResultsI highlight = af.alignPanel.getSeqPanel()
+ .getLastSearchResults();
+ assertNotNull("Didn't find highlight from second structure mouseover",
+ highlight.getResults(sq2, sq2.getStart(), sq2.getEnd()));
+ }
}
package jalview.gui;
import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.fts.api.FTSData;
import jalview.jbgui.GStructureChooser.FilterOption;
+import java.util.Collection;
import java.util.Vector;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import junit.extensions.PA;
+
public class StructureChooserTest
{
SequenceI[] selectedSeqs = new SequenceI[] { seq };
StructureChooser sc = new StructureChooser(selectedSeqs, seq, null);
sc.fetchStructuresMetaData();
- assertTrue(sc.getDiscoveredStructuresSet() != null);
- assertTrue(sc.getDiscoveredStructuresSet().size() > 0);
+ Collection<FTSData> ss = (Collection<FTSData>) PA.getValue(sc,
+ "discoveredStructuresSet");
+ assertNotNull(ss);
+ assertTrue(ss.size() > 0);
}
import jalview.api.ViewStyleI;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+import jalview.datamodel.HiddenMarkovModel;
import jalview.datamodel.HiddenSequences;
+import jalview.datamodel.Mapping;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
import jalview.datamodel.SequenceCollectionI;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import junit.extensions.PA;
+
@Test(singleThreaded = true)
public class Jalview2xmlTests extends Jalview2xmlBase
{
}
+ /**
+ * Test for JAL-2223 - multiple mappings in View Mapping report
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" })
+ public void noDuplicatePdbMappingsMade() throws Exception
+ {
+ StructureImportSettings.setProcessSecondaryStructure(true);
+ StructureImportSettings.setVisibleChainAnnotation(true);
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/exampleFile_2_7.jar", DataSourceType.FILE);
+ assertNotNull(af, "Didn't read in the example file correctly.");
+
+ // locate Jmol viewer
+ // count number of PDB mappings the structure selection manager holds -
+ String pdbFile = af.getCurrentView().getStructureSelectionManager()
+ .findFileForPDBId("1A70");
+ assertEquals(
+ af.getCurrentView().getStructureSelectionManager()
+ .getMapping(pdbFile).length,
+ 2, "Expected only two mappings for 1A70");
+
+ }
+
@Test(groups = { "Functional" })
public void viewRefPdbAnnotation() throws Exception
{
* @throws IOException
*/
@Test(groups = { "Functional" })
- public void testSaveLoadFeatureColoursAndFilters() throws IOException
+ public void testStoreAndRecoverFeatureColoursAndFilters()
+ throws IOException
{
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
">Seq1\nACDEFGHIKLM", DataSourceType.PASTE);
addFeature(seq, featureType, score++);
addFeature(seq, featureType, score);
}
+
+ /**
+ * Load an HMM profile to an alignment, and confirm it is correctly restored
+ * when reloaded from project
+ *
+ * @throws IOException
+ */
+ @Test(groups = { "Functional" })
+ public void testStoreAndRecoverHmmProfile() throws IOException
+ {
+ Desktop.instance.closeAll_actionPerformed(null);
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/uniref50.fa", DataSourceType.FILE);
+
+ AlignViewportI av = af.getViewport();
+ AlignmentI al = av.getAlignment();
+
+ /*
+ * mimic drag and drop of hmm file on to alignment
+ */
+ AlignFrame af2 = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/uniref50.hmm", DataSourceType.FILE);
+ al.insertSequenceAt(0,
+ af2.getViewport().getAlignment().getSequenceAt(0));
+
+ /*
+ * check it loaded in
+ */
+ SequenceI hmmSeq = al.getSequenceAt(0);
+ assertTrue(hmmSeq.hasHMMProfile());
+ HiddenMarkovModel hmm = hmmSeq.getHMM();
+ assertSame(hmm.getConsensusSequence(), hmmSeq);
+
+ /*
+ * save project, close windows, reload project, verify
+ */
+ File tfile = File.createTempFile("testStoreAndRecoverHmmProfile",
+ ".jvp");
+ tfile.deleteOnExit();
+ new Jalview2XML(false).saveState(tfile);
+ Desktop.instance.closeAll_actionPerformed(null);
+ af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+ DataSourceType.FILE);
+ Assert.assertNotNull(af, "Failed to reload project");
+
+ hmmSeq = al.getSequenceAt(0);
+ assertTrue(hmmSeq.hasHMMProfile());
+ assertSame(hmm.getConsensusSequence(), hmmSeq);
+ Mapping mapToHmmConsensus = (Mapping) PA.getValue(hmm,
+ "mapToHmmConsensus");
+ assertNotNull(mapToHmmConsensus);
+ assertSame(mapToHmmConsensus.getTo(), hmmSeq.getDatasetSequence());
+ }
}
package jalview.structure;
import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
+import jalview.datamodel.Mapping;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.util.MapList;
+
import java.util.HashMap;
import java.util.List;
public class StructureMappingTest
{
@Test(groups = "Functional")
- public void testgetPDBResNumRanges()
+ public void testGetPDBResNumRanges()
{
- HashMap<Integer, int[]> map = new HashMap<Integer, int[]>();
+ HashMap<Integer, int[]> map = new HashMap<>();
StructureMapping mapping = new StructureMapping(null, null, null, null,
map, null);
assertEquals(ranges.get(1)[0], 15);
assertEquals(ranges.get(1)[1], 15);
}
+
+ @Test(groups = "Functional")
+ public void testEquals()
+ {
+ SequenceI seq1 = new Sequence("seq1", "ABCDE");
+ SequenceI seq2 = new Sequence("seq1", "ABCDE");
+ String pdbFile = "a/b/file1.pdb";
+ String pdbId = "1a70";
+ String chain = "A";
+ String mappingDetails = "these are the mapping details, honest";
+ HashMap<Integer, int[]> map = new HashMap<>();
+
+ Mapping seqToPdbMapping = new Mapping(seq1,
+ new MapList(new int[]
+ { 1, 5 }, new int[] { 2, 6 }, 1, 1));
+ StructureMapping sm1 = new StructureMapping(seq1, pdbFile, pdbId, chain,
+ map, mappingDetails, seqToPdbMapping);
+ assertFalse(sm1.equals(null));
+ assertFalse(sm1.equals("x"));
+
+ StructureMapping sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain,
+ map, mappingDetails, seqToPdbMapping);
+ assertTrue(sm1.equals(sm2));
+ assertTrue(sm2.equals(sm1));
+ assertEquals(sm1.hashCode(), sm2.hashCode());
+
+ // with different sequence
+ sm2 = new StructureMapping(seq2, pdbFile, pdbId, chain, map,
+ mappingDetails, seqToPdbMapping);
+ assertFalse(sm1.equals(sm2));
+ assertFalse(sm2.equals(sm1));
+
+ // with different file
+ sm2 = new StructureMapping(seq1, "a/b/file2.pdb", pdbId, chain, map,
+ mappingDetails, seqToPdbMapping);
+ assertFalse(sm1.equals(sm2));
+ assertFalse(sm2.equals(sm1));
+
+ // with different pdbid (case sensitive)
+ sm2 = new StructureMapping(seq1, pdbFile, "1A70", chain, map,
+ mappingDetails, seqToPdbMapping);
+ assertFalse(sm1.equals(sm2));
+ assertFalse(sm2.equals(sm1));
+
+ // with different chain
+ sm2 = new StructureMapping(seq1, pdbFile, pdbId, "B", map,
+ mappingDetails, seqToPdbMapping);
+ assertFalse(sm1.equals(sm2));
+ assertFalse(sm2.equals(sm1));
+
+ // map is ignore for this test
+ sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain, null,
+ mappingDetails, seqToPdbMapping);
+ assertTrue(sm1.equals(sm2));
+ assertTrue(sm2.equals(sm1));
+
+ // with different mapping details
+ sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain, map,
+ "different details!", seqToPdbMapping);
+ assertFalse(sm1.equals(sm2));
+ assertFalse(sm2.equals(sm1));
+
+ // with different seq to pdb mapping
+ Mapping map2 = new Mapping(seq1,
+ new MapList(new int[]
+ { 1, 5 }, new int[] { 3, 7 }, 1, 1));
+ sm2 = new StructureMapping(seq1, pdbFile, pdbId, chain, map,
+ mappingDetails, map2);
+ assertFalse(sm1.equals(sm2));
+ assertFalse(sm2.equals(sm1));
+ }
}
MapList ml7 = new MapList(codons, protein, 3, 1); // toShifts differ
assertTrue(ml.equals(ml));
+ assertEquals(ml.hashCode(), ml.hashCode());
assertTrue(ml.equals(ml1));
+ assertEquals(ml.hashCode(), ml1.hashCode());
assertTrue(ml1.equals(ml));
assertFalse(ml.equals(null));
</object>
</method>
<method name="addElement">
+ <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="9a1f46efeef911a">
+ <property name="belongsToUninstallPhase">
+ <boolean>false</boolean>
+ </property>
+ <property name="rollbackEnabledCancel">
+ <boolean>true</boolean>
+ </property>
+ <property name="rollbackEnabledError">
+ <boolean>true</boolean>
+ </property>
+ <property name="ruleExpression">
+ <string><![CDATA[]]></string>
+ </property>
+ <property name="unixPermissions">
+ <string><![CDATA[664]]></string>
+ </property>
+ <property name="sourceName">
+ <string><![CDATA[VAqua4.jar]]></string>
+ </property>
+ <property name="overrideUnixPermissions">
+ <boolean>false</boolean>
+ </property>
+ <property name="sourcePath">
+ <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+ </property>
+ <property name="shouldUninstall">
+ <boolean>true</boolean>
+ </property>
+ <property name="rollbackEnabledCancel">
+ <boolean>true</boolean>
+ </property>
+ <property name="rollbackEnabledError">
+ <boolean>true</boolean>
+ </property>
+ <property name="destinationName">
+ <string><![CDATA[VAqua4.jar]]></string>
+ </property>
+ <property name="fileSize">
+ <long>1355141</long>
+ </property>
+ <property name="macBinary">
+ <boolean>false</boolean>
+ </property>
+ <property name="targetCheckKind">
+ <int>0</int>
+ </property>
+ <property name="ruleExpression">
+ <string><![CDATA[]]></string>
+ </property>
+ </object>
+ </method>
+ <method name="addElement">
<object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="1936efeefab93">
<property name="belongsToUninstallPhase">
<boolean>false</boolean>
<object refID="24485f8ca673"/>
<object refID="24485f8ba674"/>
<object refID="24485f8ca674"/>
+ <object refID="9a1f46efeef911a"/>
<object class="com.zerog.ia.installer.actions.CreateShortcut" objectID="3cd8e2ffa672">
<property name="belongsToUninstallPhase">
<boolean>false</boolean>
<object refID="24485f8ca673"/>
<object refID="24485f8ba674"/>
<object refID="24485f8ca674"/>
+ <object refID="9a1f46efeef911a"/>
<object refID="b1a16838a449"/>
<object refID="b1a16839a449"/>
<object refID="495aeddb8b3d"/>