<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="utils"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/activation.jar"/>
<classpathentry kind="lib" path="lib/axis.jar" sourcepath="D:/axis-1_2RC2-src/axis-1_2RC2"/>
</classpathentry>
<classpathentry kind="lib" path="lib/miglayout-4.0-swing.jar"/>
<classpathentry kind="lib" path="lib/jswingreader-0.3.jar" sourcepath="/jswingreader"/>
- <classpathentry kind="lib" path="lib/min-jaba-client.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
+ <classpathentry kind="lib" path="lib/min-jaba-client-2.0.jar" sourcepath="/clustengine2"/>
<classpathentry kind="lib" path="lib/Jmol-12.2.4.jar"/>
<classpathentry kind="lib" path="appletlib/JmolApplet-12.2.4.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.jar"/>
+<!-- <classpathentry exported="true" kind="var" path="GROOVY_ECLIPSE_HOME/groovy-all-1.0.jar"/> -->
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.java"/>
+ <classpathentry kind="lib" path="lib/VARNAv3-9.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jalview"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="buildindices,"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${build_project}/build.xml"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
--- /dev/null
+Normalised logo feature todo
+
+* add gui switches in applet for normalised logo display
+* add flags for normalised logo display to AnnotationFile and Jalview Project
+* add preference for application
+* consider rationalising flag model for N types of consensus/logo calculation methods
+
<?xml version="1.0"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+-->
+<title>Jalview RNA Support</title>
+<body>
+<h1>
+Jalview RNA Support
+</h1>
+<p>
+Jalview RNA support was first added during a
+<a href="http://socghop.appspot.com/gsoc/program/home/google/gsoc2010">2010 Google Summer of Code Project</a> by
+Lauren Lui (see her <a href="https://www.nescent.org/wg_phyloinformatics/PhyloSoC:Extending_Jalview_to_Support_RNA_Alignment_Annotation_and_Secondary_Structure_Visualization">
+NESCent wiki page</a> and the project <a href="http://jalview-rnasupport.blogspot.com/">blog</a>).
+</p>
+<h2>What was added</h2>
+<p>
+<ul>
+<li>Recognition of ".stk" and ".sto" extensions for Stockholm file format.</li>
+<li>Purine/Pyrimidine colour scheme.</li>
+<li>Colouring by RNA helices. Helices are determined from the secondary structure line written in WUSS format in Stockholm files.</li>
+<li>Ability to fetch sequences from RFAM.</li>
+<li>Visualization of RNA secondary structure in WUSS format (from input file) and RNA helices in the
+annotation panel.</li>
+</ul>
+</p>
+<p>In 2011, Jan Engelhardt was supported by <a href="http://socghop.appspot.com/gsoc/program/home/google/gsoc2011">GSOC</a> to extend Lauren's work, with <a href="https://www.nescent.org/wg_phyloinformatics/PhyloSoC:_Extending_Jalview_support_for_handling_RNA">support for viewing secondary structure in VARNA and visualizing base pair contact conservation</a>.
+</p>
+<h2>What Jan added</h2>
+<p>
+<ul>
+<li>Enable RNA secondary structure annotation to be imported/exported through Jalview annotation files</li>
+<li>Incorporated <a href="varna.lri.fr">VARNA</a> into the desktop application</li>
+<li>Added a new base pair consensus histogram and sequence logo annotation row</li>
+</ul>
+</p>
+<h2>TODO</h2>
+<h3>Secondary Structure Visualization/Annotation</h3>
+<ul>
+<li>Detection of pseudoknots and tetraloops </li>
+<li>Update colouring of RNA helices in annotation panel when "By RNA helices" colouring is selected</li>
+<li>Editing of secondary structure line</li>
+<li>Update helix colouring when secondary structure changes.</li>
+<li>Support per sequence in RNA secondary structure annotation</li>
+</ul>
+
+<h3>Colour schemes</h3>
+<ul>
+<li>Coloring scheme for pseudoknots</li>
+<li>Covariation colour scheme similar to RFAM's</li>
+<li>Coloring schemes from other MSA viewers, like 4Sale and Assemble</li>
+<li>Highlight positions in alignments that break base pairing specified in the secondary structure line</li>
+</ul>
+<h3>Embed VARNA, An RNA Secondary Structure Viewer</h3>
+<ul>
+<li>The homepage for VARNA can be found <a href="http://varna.lri.fr/">here</a>.</li>
+<li>Hook VARNA into Jalview</li>
+<li>Ability to port RNA secondary structure (e.g. from Stockholm files) into VARNA</li>
+<li>Mouse over and selections get highlighted in the linked views</li>
+</ul>
+<h3>Miscellaneous</h3>
+<ul>
+<li>Add changes done to the main gui to the applet gui</li>
+<li>Add export of Stockholm file format</li>
+</ul>
+</p>
+</body>
+</html>
+
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<p>
You will need the following (hopefully):<br>
<ul>
-<li>Java development kit (we used JDK1.5SE but JDK1.6 will work too,
-and maybe even jikes).</li>
+<li>Java development kit (JDK1.6 is the recommended platform for developing with Jalview, although JDK1.7 seems to work too!).</li>
<li>Ant (we think 1.5.4 is quite sufficient to use the simple build
-file supplied).</li>
+file supplied, and it seems to work with later versions e.g. 1.7).</li>
</ul>
With any luck, after setting your paths and JAVA_HOME correctly, you
just need to change to the Jalview directory and run ant (this works
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<html>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
--- /dev/null
+# STOCKHOLM 1.0
+
+#=GF ID SECIS_1
+#=GF AC RF00031
+#=GF DE Selenocysteine insertion sequence 1
+#=GF AU Griffiths-Jones SR
+#=GF GA 20.0
+#=GF NC 0.0
+#=GF TC 22.6
+#=GF PI SECIS
+#=GF SE Gautheret D, PMID:12458087
+#=GF SS Published; PMID:12458087
+#=GF TP Cis-reg;
+#=GF BM cmbuild -F CM SEED; cmcalibrate --mpi -s 1 CM
+#=GF BM cmsearch -Z 169604 -E 1000 --toponly CM SEQDB
+#=GF DR SO:1001274 SO:SECIS_element
+#=GF DR GO:0001514 GO:selenocysteine incorporation
+#=GF RN [1]
+#=GF RM 8634917
+#=GF RT A novel RNA structural motif in the selenocysteine insertion element
+#=GF RT of eukaryotic selenoprotein mRNAs.
+#=GF RA Walczak R, Westhof E, Carbon P, Krol A;
+#=GF RL RNA 1996;2:367-379.
+#=GF RN [2]
+#=GF RM 12458087
+#=GF RT A survey of metazoan selenocysteine insertion sequences.
+#=GF RA Lambert A, Lescure A, Gautheret D;
+#=GF RL Biochimie 2002;84:953-959.
+#=GF CC The incorporation of selenocysteine into a protein sequence
+#=GF CC is directed by an in-frame UGA codon (usually a stop codon)
+#=GF CC within the coding region of the mRNA. Selenoprotein mRNAs
+#=GF CC contain a conserved secondary structure in the 3' UTR that
+#=GF CC is required for the distinction of UGA stop from UGA
+#=GF CC selenocysteine. The selenocysteine insertion sequence
+#=GF CC (SECIS) is around 60 nt in length and adopts a hairpin
+#=GF CC structure which is sufficiently well-defined and conserved
+#=GF CC to act as a computational screen for selenoprotein genes [2].
+#=GF WK http://en.wikipedia.org/wiki/SECIS_element
+#=GF SQ 61
+
+#=GS D.melanogaster.1 AC AY119185.1/838-902
+#=GS D.melanogaster.2 AC AC092237.1/57223-57161
+#=GS D.melanogaster.3 AC AY060611.1/560-627
+#=GS O.niloticus.1 AC Y11109.1/1272-1330
+#=GS O.niloticus.2 AC Y11109.1/927-987
+#=GS O.niloticus.3 AC Y11111.1/1260-1324
+#=GS D.rerio.1 AC AF322071.1/1577-1642
+#=GS X.laevis.1 AC L28111.1/1299-1365
+#=GS G.gallus.1 AC AF125575.1/5781-5843
+#=GS G.gallus.2 AC Y11110.1/1218-1277
+#=GS G.gallus.3 AC Y11273.1/1139-1211
+#=GS M.musculus.1 AC AF195142.1/461-524
+#=GS M.musculus.2 AC AF021345.1/10097-10160
+#=GS M.musculus.3 AC X03920.1/1172-1235
+#=GS M.musculus.4 AC AF096875.1/5504-5568
+#=GS M.musculus.5 AC AF241527.2/359-424
+#=GS M.musculus.6 AC AF136399.1/1808-1868
+#=GS M.musculus.7 AC X84742.1/5239-5302
+#=GS M.musculus.8 AC AF288740.1/1291-1357
+#=GS M.musculus.9 AC AF274027.1/835-900
+#=GS M.musculus.10 AC AB030643.1/4176-4241
+#=GS M.musculus.11 AC AL645723.11/192421-192359
+#=GS M.musculus.12 AC AC002327.1/156204-156268
+#=GS M.musculus.13 AC AF333036.1/2190-2249
+#=GS M.musculus.14 AC U43285.1/2009-2075
+#=GS R.norvegicus.1 AC X57999.1/1526-1586
+#=GS R.norvegicus.2 AC M63574.1/1465-1528
+#=GS R.norvegicus.3 AC AF390544.1/1076-1142
+#=GS R.norvegicus.4 AC AF072865.1/1887-1947
+#=GS R.norvegicus.5 AC X12367.1/703-764
+#=GS R.norvegicus.6 AC U25264.1/366-432
+#=GS R.norvegicus.7 AC L24896.1/600-665
+#=GS H.sapiens.1 AC AF201385.1/3055-3117
+#=GS H.sapiens.2 AC AL049837.4/130674-130738
+#=GS H.sapiens.3 AC U67171.1/375-442
+#=GS H.sapiens.4 AC AF195141.1/689-759
+#=GS H.sapiens.5 AC X53463.1/847-903
+#=GS H.sapiens.6 AC AF093774.1/5851-5916
+#=GS H.sapiens.7 AC X58295.1/1384-1453
+#=GS H.sapiens.8 AC AL833145.1/1479-1545
+#=GS H.sapiens.9 AC S48220.1/1731-1788
+#=GS H.sapiens.10 AC X71973.1/730-791
+#=GS H.sapiens.11 AC AF166127.1/1919-1981
+#=GS H.sapiens.12 AC U43286.1/2054-2120
+#=GS H.sapiens.13 AC BC003127.1/865-928
+#=GS H.sapiens.14 AC S79854.1/1605-1666
+#=GS H.sapiens.15 AC X13710.1/946-1008
+#=GS B.taurus.1 AC D88033.3/5711-5774
+#=GS B.taurus.2 AC D25220.1/1493-1556
+#=GS B.taurus.3 AC AB017534.1/661-726
+#=GS B.taurus.4 AC AB032826.1/1401-1464
+#=GS B.taurus.5 AC AB022283.1/1669-1729
+#=GS B.taurus.6 AC AF053984.1/1951-2017
+#=GS B.taurus.7 AC X13684.1/700-760
+#=GS O.aries.1 AC U67853.1/375-442
+#=GS S.scrofa.1 AC AF380118.1/366-433
+#=GS S.scrofa.2 AC L12743.1/694-758
+#=GS S.scrofa.3 AC AF532927.1/678-740
+#=GS S.scrofa.4 AC X76008.1/2709-2772
+#=GS C.elegans.1 AC U61947.2/4246-4309
+#=GS S.mansoni.1 AC L37762.1/2940-3006
+
+D.melanogaster.1 G.AGCC.CU...AUGAUCGAUGAUUGG.CAAA.UCCUCUC..GAGG..A.......ACCGAUC.G.U.UGAGAA..CCCCU.....UUGCCUU
+#=GR D.melanogaster.1 SS ................(((((((((((......((((......)))..)........)))))).).).)))......................
+D.melanogaster.2 C.AUUCAACU.UAUGAGGAUUAUUUCU.UAAA.GGCCUCU...GGC..U.......CGGAAAU.A.G.UCUGAA...CCU........UAUUG
+#=GR D.melanogaster.2 SS ................(((((((((((......((((......)))..)........)))))).).).)))......................
+D.melanogaster.3 G.UGGCGCU..UAUGACGCAGUUGUCU.UAAA.CUCGAAC..UCGA.GC........GGGCAA.U.U.GCUGAU...UACG...AUUAACCAC
+#=GR D.melanogaster.3 SS (.(((...(....((((((((((((((......((((......))).).........)))))).).).)).).)...)).....)....))))
+O.niloticus.1 G.UUUCUCA...GUGAAGGCUACAGAU.UAAA..CCUCU....GGC...........CUCUGG.A.G.CCAGAU..GCAUU.......GAAAC
+#=GR O.niloticus.1 SS ......(((...(((..(((((.((..........)).)....)))...........)((((.......))))....)))).......))...
+O.niloticus.2 U.GUUUAUU..AAUGACGGCUACAGAU.UAAA..CCUUU....AGC...........CUCUGG.A.G.CCAGAU..GCAUU......CAAACA
+#=GR O.niloticus.2 SS ..((((.....((((..(((((.((..........)).)....)))...........)((((.......))))....)))).......)))).
+O.niloticus.3 G.UGUCUCU...GUGAAGUUCGGUUUU.UAAA.AGGGUCA...UCC..A.......GAAAACC.G.ACACUGAU..GUUUC......CGACAC
+#=GR O.niloticus.3 SS (.((((..........(((((((((((.(......((.......))..........))))))).).).))).................)))))
+D.rerio.1 A.UGUGGUCUUUAUGAAGGCAGGUGCA.GAAA.CUAUGCA...CUA.GU........GGUGUC.U.G.UCUGAU..GUUUG.......GCCAU
+#=GR D.rerio.1 SS ...((((((.......(((((((..(.....(.(((........)).)).........)..)).).).))).........).......)))))
+X.laevis.1 G.UGUUUGCA.AAUGACGACCGAUUUU.GAAA.UGGUCUCACGGCC..A.......AAAACUC.GUG.UCCGAC...AUC........AACCC
+#=GR X.laevis.1 SS .................((((((.(((......(((((....))))..)........))).)).).).)).......................
+G.gallus.1 G.UGUGUUU...AUGAAGAGCACUAAC.AAAA.GAGUAAU.UGACU..C.......AGUUGGU.G.U.UCAGAU..GCU.........CUCAC
+#=GR G.gallus.1 SS (.((.(..(...((...((((((((((......((((......)))..)........)))))).).).))..))..)...........).)))
+G.gallus.2 U.AUUUGUC...AUGACAGUCACAGCA.UAAA..GCGCA....GAC...........GGCUGU.G.A.CCUGAU..UUUAG......AAAAUA
+#=GR G.gallus.2 SS ................((((((((((................................))))).).)..))).....................
+G.gallus.3 U.AUUUCUU..UGUGAUGACCGAUUUU.GAAA.UGGGUUU...CUC..UAAUGCCAGGAAAUC.GUG.UCUGAU...GUUG.....UCAAGUA
+#=GR G.gallus.3 SS ......(((...(..((((((((((((......((((((..........))).))).)))))).).).)).......)).......).)))..
+M.musculus.1 G.UCACCGA...AUGAUCUGCUCUGGU.CAAA.UCCUUCU...AUG..C......CAGCCAGG.G.U.GGUGAU..GACCC.......GUGAC
+#=GR M.musculus.1 SS (.((((.(....((.(((.((((((((..............................)))))).).).))).)).....)........)))))
+M.musculus.2 G.UUACAUU..AAUGAGAACAGAAACA.UAAA..CUAUGA.CCUAG.G.........GGUUUC.U.G.UUGGAU..AGCUU.......GUAAU
+#=GR M.musculus.2 SS (.(((((..........(((((((((........(((......)))............))))).).).))..........).......)))))
+M.musculus.3 G.GUUCUUC..CAUGAUGGUGUUUCCUCUAAA..UUUGC....ACG...........GAGAAA.C.A.CCUGAU.UUCCAG.....GAAAAUC
+#=GR M.musculus.3 SS (.(((.(((..(..((.((((((((.(((................)...........)))))).).).))......))..).....)))))))
+M.musculus.4 G.UGUGCGA...AUGAUAACUACUGAC.GAAA.GAGCUGU.CUGCU..C.......AGUCUGU.G.G.UUGGAU...GUAG......UCACAC
+#=GR M.musculus.4 SS (.(((((.........(((((((.(((......((((......)))..)........))).)).).).))).........).......)))))
+M.musculus.5 G.CCGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUUA...GAC..C.....UGUGGUCUU.U.C.CUCGAU..GUUCC......UGCGGC
+#=GR M.musculus.5 SS (.((((..(...((...((((((((((.(.....(((......)))..........))))))).).).))..))..)...........)))))
+M.musculus.6 G.UCAGAUG...AUGAUGGCCUGGGCA.GAAA.CCCCAUG..UGGG..C........CGCCCA.G.G.UUUGAA...CCC........CUGGC
+#=GR M.musculus.6 SS (.((((...........(((((((((..(.....(((......)))..).........))))).).).))..................)))))
+M.musculus.7 G.UGUCUCU...AUGAAGGAGGGGCCC.GAAG.CCCUUGU...GGG..C........GGGCCU.C.C.CCUGAG...CCCG....UCUGUGGU
+#=GR M.musculus.7 SS ................(((.(((((((....(.(((.......)))..)........)))))).)...)))..(...(((........).)))
+M.musculus.8 U.UUGCAUU..AAUGAGGAUUACACAG.AAAA.CCUUUGU..UAAG.GA.......CUUGUGU.AGA.UCUGAU..AAUUG.......GCAAA
+#=GR M.musculus.8 SS ..((((......((.(((.((((((((......((((......))).).........)))))).))..))).))..............)))).
+M.musculus.9 C.CGGCACU..CAUGAAGGUCUGCUUG.AAAA.CCAGCCU..GCUG.GU........GGGGCA.G.U.CCUGAG.GACCUG.......GCGUG
+#=GR M.musculus.9 SS (.(((..((..((....((.((((((.....(.((((......))).)).........))))).)...))))))...)).).......)....
+M.musculus.10 C.CGGCACU..CAUGAAGGUCUGCCUG.AAAA.CCAGCCU..GCUG.GU........GGGGCA.G.U.CCUGAG.GACCUG.......GCGUG
+#=GR M.musculus.10 SS (.(((..((..((....((.((((((.....(.((((......))).)).........))))).)...))))))...)).).......)....
+M.musculus.11 U.AUUUGUG..UAUGAUGGUCACAGUG.UAAA..GUUCC....CAC...........AGCUGU.G.A.CUUGAU..UUUUA....AAAAUGUC
+#=GR M.musculus.11 SS (.((((...........((((((((((.(...............))...........).)))).).).))................)))))..
+M.musculus.12 C.UCAGCAG..GAUGAUGAGAAGGGCU.GAAA.UGCUGCC..AAAC..C.......AGGUCCU.U.U.UCUGAU..GGUGG.......CUGGG
+#=GR M.musculus.12 SS (.(((((..........((((((((((......((....)..)..............)))))).).).))..........).......)))))
+M.musculus.13 C.AUGCGUC..CAUGAAGUCACUGGCC.UCAA.GCCCAA....GUG.GU........GGGCAG.U.G.ACAGAA...GA.........GCUGC
+#=GR M.musculus.13 SS (.(((......))))..(((((((.((......(((.........).))........)).))).).).)).......................
+M.musculus.14 C.UCUGAUA...AUGAUGUCUCUCCCU.CUAA.CUCCCAGUAAGGA..C........UGGGAG.A.G.GCUGAACAAACCU.......CAGAG
+#=GR M.musculus.14 SS (.(((((.........(((.((..(((.(.....(((((((....)..)........)))))).).).)..)))))....).......)))))
+R.norvegicus.1 A.UAUUUGUU.UAUGAUGGUCACAGUG.UAAA..GUUCA....CAC...........AGCUGU.G.A.CUUGAU..UUUUA.......AAAAU
+#=GR R.norvegicus.1 SS ....((((.........((((((((((.(...............))...........).)))).).).)).........)).......))...
+R.norvegicus.2 G.UUACAUU..GAUGAGAACAGAAACA.UAAA..CUAUGA.CCUAG.G.........GGUUUC.U.G.UUGGAU..AGCUC.......GUAAU
+#=GR R.norvegicus.2 SS ............((((((((((((((........(((......)))............))))).).).))........))).......))...
+R.norvegicus.3 U.UUGCAUU..AAUGAGGAUUACACAG.AAAA.CCUUUGU..UAAGGGU........UUGUGUCG.A.UCUGCU..AAUUG.......GCAAA
+#=GR R.norvegicus.3 SS ..((((..........(((((((((((.(....((((......)))).)........)))))).).).))).................)))).
+R.norvegicus.4 G.UCAGAUG...AUGACGGCCUGUGCA.GAAA.CCCCCAC.GUGGG..C........UGC.CA.G.G.UUUGAA...CCC........CUGGC
+#=GR R.norvegicus.4 SS (.(((........)))).(((..((...(.......)..).)..))..).........((.((.(.(............)........)))))
+R.norvegicus.5 G.UUUUUCC...AUGACGGUGUUUCCUCUAAA..UUUAC....AUG...........GAGAAA.C.A.CCUGAU.UUCCAG......AAAAAU
+#=GR R.norvegicus.5 SS (.((((((......(((((((((((.((((..............))...........)))))).).).)).).).)....)......))))))
+R.norvegicus.6 G.CCGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUCA.AAGAC..C.....UGUGGUCUU.U.C.UUCGAU..GUUCU.......GCGGC
+#=GR R.norvegicus.6 SS (.((((..(...((((..(((((((((.(.....(((......)))..........))))))).).).))).))..)...........)))))
+R.norvegicus.7 C.CGGCACU..CAUGACGGUCUGCCUG.AAAA.CCAGCCC..GCUG.GU........GGGGCA.G.U.CCCGAG.GACCUG.......GCGUG
+#=GR R.norvegicus.7 SS (.(((..((..(.....((.((((((.....(.((((......))).)).........))))).)...)).)))...)).).......)....
+H.sapiens.1 G.CCAGAUG...AUGACGACCUGGGUG.GAAA.CCUACCC.UGUGG..G........CACCCA.U.G.UCCGAG...CCCC.......CUGGC
+#=GR H.sapiens.1 SS (.((((...........(((.((((((......(((((....))))..)........))))))...).))..................)))))
+H.sapiens.2 G.UGUGCGG...AUGAUAACUACUGAC.GAAA.GAGUCAU.CGACU..C.......AGUUAGU.G.G.UUGGAU...GUAG......UCACAU
+#=GR H.sapiens.2 SS (.(((((.........(((((((((((......(((((....))))..)........)))))).).).))).........).......)))))
+H.sapiens.3 G.ACGCUUC...AUGAUAGGAAGGACU.GAAA.AGUCUUG.UGGAC..A.....CCUGGUCUU.U.C.CCUGAU..GUUCU......CGUGGC
+#=GR H.sapiens.3 SS ..(((...(...((.(..(((((((((.......(((......)))...........)))))).).).).).))..)..........)))...
+H.sapiens.4 G.ACUGACAU.UAUGAAGGCCUGUACU.GAAG.ACAGCAA..GCUG..U.......UAGUACA.G.A.CCAGAU..GCUUU..CUUGGCAGGC
+#=GR H.sapiens.4 SS ...(((.((.....(((((((((((((....(.((((......)))..).......))))))).)...........)))))..).)).)))..
+H.sapiens.5 U.UCACAGA...AUGAUGGCACCUUCC.UAA...ACCCU....CAU...........GGGUGG.U.G.UCUGAG..AGGC........GUGAA
+#=GR H.sapiens.5 SS ..((((...........((((((...........((((...................)))))).).).))..................)))).
+H.sapiens.6 G.UGUGCGG...AUGAUAACUACUGAC.GAAAGAGUCAUC...GAC..C.....UCAGUUAGU.G.G.UUGGAU...GUAG......UCACAU
+#=GR H.sapiens.6 SS (.(((((.........(((((((((((....((.(((......)))..).....)..)))))).).).))).........).......)))))
+H.sapiens.7 U.GGCGUCUU.CAUGAGGGAGGGGCCC..AAA.GCCCUUG..UGGG..C........GGACCU.C.C.CCUGAG...CCUGUCUGAGGGGCCA
+#=GR H.sapiens.7 SS ..(((.((((.((...((((((((.........((((......)))..)...............).).)))......)))...))))))))).
+H.sapiens.8 U.UUGCUUU..AAUGAGAAUAGAAACG.UAAA..CUAUGA.CCUAG.G.........GGUUUC.U.G.UUGGAU.AAUUAG.....CAGUUUA
+#=GR H.sapiens.8 SS ..(((((..........(((((((((........(((......)))............))))).).).)).........)).....)))....
+H.sapiens.9 U.AUUUGUU..UAUGAUGGCCACAGCC.UAAA..GUACA....CAC...........GGCUGU.G.A.CUUGAU...UCA........AAAGA
+#=GR H.sapiens.9 SS .............(((.((.(((((((..............................)))))).)...)).......))).............
+H.sapiens.10 C.CGGCACU..CAUGACGGCCUGCCUG.CAAA..CCUGC....UGG..U........GGGGCA.G.A.CCCGAA.AAUCCA.......GCGUG
+#=GR H.sapiens.10 SS ...((((....(......)..))))............((....(((..(........(((........))))......))).......))...
+H.sapiens.11 G.CCGGAUG...AUGACGACCUGGGUG.GAAA.CCUACCC.UGUGG..G........CACCCA.U.G.UCCGAG...CCCC.......CUGGC
+#=GR H.sapiens.11 SS (.((((...........(((.((((((......(((((....))))..)........))))))...).))..................)))))
+H.sapiens.12 C.UCUGUUA...AUGACGUCUCUCCCUCUAAA.CCCCAUU.AAGGA..C........UGGGAG.A.G.GCAGAGCAAGCCU.......CAGAG
+#=GR H.sapiens.12 SS (.((((.......((..(((((((((.......((........)).............))))).).).))....))............)))))
+H.sapiens.13 G.UCACUGC...AUGAUCCGCUCUGGU.CAAA.CCCUUCC...AGG..C......CAGCCAGA.G.U.GGGGAU..GGUCU.......GUGAC
+#=GR H.sapiens.13 SS (.((((.((.......(((((((((((......((.........))...........)))))).).).)))......)).........)))))
+H.sapiens.14 C.ACUGCUG...AUGACGAACUAUCUC.UAAC.UGGUCUU..GACC..A.......CGAGCUA.G.U.UCUGAA...UU.G.......CAGGG
+#=GR H.sapiens.14 SS ...((((.(...((...((((((.(((......((((......)))..)........))).)).).).))...)...)).).......)))..
+H.sapiens.15 U.UUUCAUC..UAUGAGGGUGUUUCCUCUAAA..CCUACG...AGG...........GAGGAA.C.A.CCUGAU...CUUA.....CAGAAAA
+#=GR H.sapiens.15 SS .......((..(.((((((((((.(((((................)...........)))))).).).)).......))))......)))...
+B.taurus.1 C.UUGCGUU..AAUGAGAACAGAAACG.UAAA..CUAUAA.CCUAG.G.........GGUUUC.U.G.UUGGAU..GGUUG.......GCAAC
+#=GR B.taurus.1 SS ......(((..(((.(.(((((((((........(((......)))............))))).).).))...)...)))).......))...
+B.taurus.2 C.UUGCGUU..AAUGAGAACAGAAACG.AAAA..CUAUAA.CCUAG.G.........GGUUUC.U.G.UUGGAU..GGUUG.......GCAAC
+#=GR B.taurus.2 SS ......(((..(((.(.(((((((((........(((......)))............))))).).).))...)...)))).......))...
+B.taurus.3 C.CCGGUGCC.UAUGACGGUCUGUCUG.AAAA.CCAGCCC...CUG.GU........GGGGCA.G.A.CCUGAG.AACCUG.......GCGUG
+#=GR B.taurus.3 SS (.(.(((..(.(.....(((((((((.....(.((((......))).)).........))))).).).))..))..))).).......)....
+B.taurus.4 ACUUGCGUU..AAUGAGAACAGAAACG.UAAA..CUAUAA.CCUAG.G.........GGUUUC.U.G.UUGGAU..GGUUG.......GCAA.
+#=GR B.taurus.4 SS ......(((..(((.(.(((((((((........(((......)))............))))).).).))...)...)))).......))...
+B.taurus.5 G.CCAGAUG...AUGAGGACCUGUGCG.GAAA.CCCCCCG..CGGG..C........UGCCCA.U.G.UCUGAG...CCC........CUGGC
+#=GR B.taurus.5 SS (.((((((....(((.((.((((((.(.(.......))))..)))).............)))).).).)))).)...)...............
+B.taurus.6 G.AUGCGUC..CAUGAAGUCACCAGCC.CCAA.GCCCCUC...GUG.GU........GGGUGG.U.G.AUGGAA.CCGUCA.....AAGCAGU
+#=GR B.taurus.6 SS (.(((..((..((.....((((((.((.(((.............)).).........)).))).).).)))))...)))).............
+B.taurus.7 U.UUUGCCC...AUGAAGGUGUUCCCUCUAAA..CCUAC....GUG...........GAGGAA.U.G.CCUGAU.GUCCAG.......GAAAA
+#=GR B.taurus.7 SS (.((((..(...((..(((((((((.((((..............))...........)))))).).).))).)).)..))).......))...
+O.aries.1 G.ACGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUCU.UGGAC.GC......CUGGUCCU.U.C.CUUGAU..GUUCU......CACGGC
+#=GR O.aries.1 SS (.(.((.((...(....((((((((((.(....((((......))).)........))))))).).).)))))...))..)......).....
+S.scrofa.1 G.ACGCUUC...AUGACAGGAAGGACU.GAAA.UGUCUUG.UGGAC.GC......CUGGUCCU.U.C.CCUGAU..GUUCU......CAUGGC
+#=GR S.scrofa.1 SS .......((...(((((((((((((((.(....((((......))).)........))))))).)...))))........)......))))).
+S.scrofa.2 C.UGGCACC..CAUGACAGUCUGCCUA.AAAA.CCAGCCC...CUG.GU........GGGGCA.G.A.CUCGAG.AACCUG.......GCGUG
+#=GR S.scrofa.2 SS .....((((..((.(.((((((((((.....(.((((......))).)).........))))).).).)).).....).)).......).)))
+S.scrofa.3 A.UUUUAUC..CAUGAAAGUGUUUCCUCUAAA..CCUAU....GUG...........GAGGAA.C.A.CCUGAU.GUCCAG......GAAAAU
+#=GR S.scrofa.3 SS ...........(((....))).((((((((..............))...........)))))).....((((......)))......).....
+S.scrofa.4 C.UGGCACC..CAUGACAGUCUGCCUA.AAAA.CCAGCC....CUG.GU........GGGGCA.G.A.CUCGAG.AACCUG.......GCGUG
+#=GR S.scrofa.4 SS .....((((..((.(.((((((((((.....(.(((........)).)).........))))).).).)).).....).)).......).)))
+C.elegans.1 G.AGGCAGCUUUGUGACGACCUUUGGC.UAAA.CUCCAUC..GUGA.GC........GCCUCU.G.G.UCUGAU...GC.........GCCUC
+#=GR C.elegans.1 SS (.((((.((...((.(.((((...(((......(((........)).).........)))....).).))).))...)).........)))))
+S.mansoni.1 C.UCGCUAU...AUGACGAUGGCAAUC.UCAA..AUGUU....CAU..U........GGUUGC.C.A.UUUGAU..GAAAUCAGUUUUGUGUG
+#=GR S.mansoni.1 SS ...(((.((...(.(((((((((((((..............................)))))).).).)).............))).))))))
+#=GC SS_cons <-<<<<-----------<<<<<<<<<<-------<<<______>>>----------->>>>>>->->->>------------------>>>>>
+#=GC RF g.ucucauu..uAUGAuGgccucuccc.uAAA.ucccuuu...ggg..c........gggaga.g.g.cCuGAU..gcuug.......gagac
+//
button by setting the embed parameter to true;<br>
<param name="embedded"
value="true"> </li>
- </ul>\r <p><strong><font size="2">** NEW FEATURES ** in Jalview 2.7.1</font></strong></p>\r <ul><li><font size="2">Jmol compatibility updated to Jmol 12.2.x series - <a href="JmolApplet-12.2.4.jar">download the JmolApplet here</a></font></li>\r<li>To use Jmol as the structure viewer for Jalview, you must include \r the jar file in the applet archive argument thus:<br>\r <pre>archive="jalviewApplet.jar,Jmol-12.2.4.jar"</pre></font>\r </li>\r <li>Jmol 12.2.x requires at least Java 1.6 to run in the clients web browser. If the client does not have \r Java 1.6, or if the Jmol-12.2.jar is not added to the archive, the \r original Jalview structure viewer will still be available. <br>\r </li>\r \r </ul>\r <p><strong><font size="2">**NEW FEATURES** in Jalview 2.7</font></strong></p>\r <ul>\r <li><font size="2">Javascript callbacks capabilities<ul><li>oninit parameter and methods for registering javascript handlers for selections, mouseovers and linking to Jmol applets on the page.</li>\r <li>To use javascript callbacks, ensure the applet tag includes the '<a href="http://download.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html">mayscript</a>' attribute - either as a parameter (<param name="mayscript" value="true"/;gt;) or as a bare attribute in the applet html tag).</li></ul></font>\r </li>\r <li><font size="2">New <a href="jalviewLiteJs.html">jalviewLite java api</a> methods for selecting, highlighting, scrolling and reordering sequences in an alignment view.\r </font></li></ul>\r <p><strong><font size="2">**NEW FEATURES** in Jalview 2.6</font></strong></p>\r <ul>\r <li><font size="2">Jmol compatibility updated to Jmol 12.1.x series</font></li>\r <li>Jalview 2.6 works only with Jmol version 12.1.13 or later. You can use the JmolApplet.jar from \r the Jmol binary distribution available at the Jmol Sourceforge site, \r or <a href="JmolApplet-12.1.13.jar">download the Jmol applet from here</a></li>\r <li><font size="2">Minimum recommended version of Java runtime for the applet is now 1.5 (JalviewLite v2.6 without the Jmol viewer may work ok on earlier Java environments but compatibility can no-longer be guaranteed).</font></li>\r </ul>
+ </ul>\r <p><strong><font size="2">**NEW FEATURES** in Jalview 2.8</font></strong></p>\r <ul>\r <li><font size="2">Normalised sequence logo display\r </font></li>\r <li><font size="2">RNA secondary structure annotation row\r </font></li>\r </ul>\r <p><strong><font size="2">**NEW FEATURES** in Jalview 2.7.1</font></strong></p>\r <ul>\r<li><font size="2">Jmol compatibility updated to Jmol 12.2.x series - <a href="JmolApplet-12.2.4.jar">download the JmolApplet here</a></font></li>\r<li>To use Jmol as the structure viewer for Jalview, you must include \r the jar file in the applet archive argument thus:<br>\r <pre>archive="jalviewApplet.jar,Jmol-12.2.4.jar"</pre></font>\r </li>\r <li>Jmol 12.2.x requires at least Java 1.6 to run in the clients web browser. If the client does not have \r Java 1.6, or if the Jmol-12.2.jar is not added to the archive, the \r original Jalview structure viewer will still be available. <br>\r </li>\r \r </ul>\r <p><strong><font size="2">**NEW FEATURES** in Jalview 2.7</font></strong></p>\r <ul>\r <li><font size="2">Javascript callbacks capabilities<ul><li>oninit parameter and methods for registering javascript handlers for selections, mouseovers and linking to Jmol applets on the page.</li>\r <li>To use javascript callbacks, ensure the applet tag includes the '<a href="http://download.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html">mayscript</a>' attribute - either as a parameter (<param name="mayscript" value="true"/;gt;) or as a bare attribute in the applet html tag).</li></ul></font>\r </li>\r <li><font size="2">New <a href="jalviewLiteJs.html">jalviewLite java api</a> methods for selecting, highlighting, scrolling and reordering sequences in an alignment view.\r </font></li></ul>\r <p><strong><font size="2">**NEW FEATURES** in Jalview 2.6</font></strong></p>\r <ul>\r <li><font size="2">Jmol compatibility updated to Jmol 12.1.x series</font></li>\r <li>Jalview 2.6 works only with Jmol version 12.1.13 or later. You can use the JmolApplet.jar from \r the Jmol binary distribution available at the Jmol Sourceforge site, \r or <a href="JmolApplet-12.1.13.jar">download the Jmol applet from here</a></li>\r <li><font size="2">Minimum recommended version of Java runtime for the applet is now 1.5 (JalviewLite v2.6 without the Jmol viewer may work ok on earlier Java environments but compatibility can no-longer be guaranteed).</font></li>\r </ul>
<br><strong><font size="2">**NEW FEATURES** in Jalview 2.5</font></strong></p>\r <ul>\r <li><font size="2">New parameters to control display of tree annotation, width of alignment columns, and to disable the jalview button and check for Jmol on startup.</font></li>\r </ul> \r <br><strong><font size="2">**NEW FEATURES** in Jalview 2.4</font></strong></p>
<ul>
<li><font size="2">New applet API methods for feature display control, views, and obtaining current selection via javascript.</font></li>
<td>true</td>
<td>Show the jalview button on the page. When false, JalviewLite will open immediately.</td>
</tr>\r </tr>\r <tr><td>sortByTree</td>\r <td>true or false (default is false)</td>\r <td>automatically sort the associated alignment view by the tree when a new tree is opened.</td>\r </tr>\r <tr>\r <td>showTreeBootstraps</td><td>true or false (default is true)</td><td>show or hide branch bootstraps</td>\r </tr>\r <tr><td>showTreeDistances</td><td>true or false (default is true)</td><td>show or hide branch lengths</td></tr>\r <tr><td>showUnlinkedTreeNodes</td><td>true or false (default is false)</td><td>indicate if unassociated nodes should be highlighted in the tree view</td>\r </tr>\r <tr><td>heightScale</td>\r <td>1.0 or greater</td>\r <td>Adjust the height of each cell in the alignment grid relative to the height of a character in the alignment font. (<em>since 2.5.1</em>)</td>\r </tr>
- <tr><td>widthScale</td>\r <td>1.0 or greater</td>\r <td>Adjust the width of each cell in the alignment grid relative to the width of a character in the alignment font. (<em>since 2.5.1</em>)</td>\r </tr>\r <tr><td>centrecolumnlabels</td>\r <td>true of false (default is false)</td>\r <td>When true, text labels associated with a column in the alignment will be shown centered with respect to the column. (<em>since 2.4</em>)</td>\r <tr><td>showUnconserved</td>\r <td>true of false (default is false)</td>\r <td>When true, only gaps and symbols different to the consensus sequence for a column will be shown. Useful for visualizing alignments exhibiting low sequence variation, where it is important to highlight mutations. (<em>since 2.5</em>)</td>\r </tr>\r <tr><td>upperCase</td>\r <td><em>bold</em> or other value</td>\r <td>Indicate a text style to apply to uppercase sequence symbols. Currently, only <strong>bold</strong> is supported.</td>\r </tr>\r <tr><td>automaticScrolling</td>\r <td>true of false (default is true)</td>\r <td>When true, alignment panels will automatically scroll to show any regions of the alignment highlighted due to javascript events or when mousing over a position in an associated structure. (<em>since 2.6</em>)</td>\r </tr>\r \r <tr><td>showGroupConsensus</td>\r <td>true of false (default is false)</td>\r <td>When true, shows consensus annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r </tr>\r \r <tr><td>showGroupConservation</td>\r <td>true of false (default is false)</td>\r <td>When true, shows amino-acid property conservation annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>showConsensusHistogram</td>\r <td>true of false (default is true)</td>\r <td>When true, shows the percentage occurence of the consensus symbol for each column as a histogram above the consensus sequence row. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>showSequenceLogo</td>\r <td>true of false (default is false)</td>\r <td>When true, shows a sequence logo above the consensus sequence (overlaid above the Consensus Histogram, if visible, with symbols coloured using the alignment's default colourscheme). (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>oninit</td>\r <td><em>after_init()</em></td>\r <td>name of javascript function that will be called after the jalviewLite instance has completed its initialisation. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>relaxedidmatch</td>\r <td><em>true or false (default is false)</em></td>\r <td>When true, use stem based matching to identify sequences that match features imported from a GFF or Jalview sequence features file, and for associating PDB data (passed on PDBfile parguments) with sequences (based on a given destination sequence ID). (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>alignpdbfiles</td>\r <td><em>true or false (default is false)</em></td>\r <td>When true, and jalviewLite is able to use jmol as a structure viewer, attempt to show a superposition of all structures loaded onto the alignment, superimposed using the aligned regions of corresponding sequences. [experimental] (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>externalstructureviewer</td>\r <td><em>true or false (default is false)</em></td>\r <td>re-route jmol colouring commands, selection and mouseover events to an external viewer using javascript callbacks. [experimental] (<em>since 2.7</em>)</td>\r \r </tr>\r <tr><td>annotationcolour_max</td>\r <td>colour name or RGB hex triplet (default is red)</td>\r <td>Default colour used for maximum value when shading by annotation. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>annotationcolour_min</td>\r <td>colour name or RGB hex triplet (default is orange)</td>\r <td>Default colour used for minimum value when shading by annotation. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>jalviewhelpurl</td>\r <td>absolute or relative url or javascript function prefixed by <em>javascript:</em> (default is http://www.jalview.org/help.html)</td>\r <td>Optional parameter allowing modification of the default Jalview Help URL normally opened when JalviewLite's 'Help' menu item is selected. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>resolvetocodebase</td>\r <td>True or False (False)</td>\r <td>Set to true to re-instate pre-JalviewLite 2.7 behaviour where relative URLs were prepended with the applet 'codebase' rather than the current document base URL before resolution. (<em>since 2.7</em>)</td>\r </tr>\r \r </table>
+ <tr><td>widthScale</td>\r <td>1.0 or greater</td>\r <td>Adjust the width of each cell in the alignment grid relative to the width of a character in the alignment font. (<em>since 2.5.1</em>)</td>\r </tr>\r <tr><td>centrecolumnlabels</td>\r <td>true of false (default is false)</td>\r <td>When true, text labels associated with a column in the alignment will be shown centered with respect to the column. (<em>since 2.4</em>)</td>\r <tr><td>showUnconserved</td>\r <td>true of false (default is false)</td>\r <td>When true, only gaps and symbols different to the consensus sequence for a column will be shown. Useful for visualizing alignments exhibiting low sequence variation, where it is important to highlight mutations. (<em>since 2.5</em>)</td>\r </tr>\r <tr><td>upperCase</td>\r <td><em>bold</em> or other value</td>\r <td>Indicate a text style to apply to uppercase sequence symbols. Currently, only <strong>bold</strong> is supported.</td>\r </tr>\r <tr><td>automaticScrolling</td>\r <td>true of false (default is true)</td>\r <td>When true, alignment panels will automatically scroll to show any regions of the alignment highlighted due to javascript events or when mousing over a position in an associated structure. (<em>since 2.6</em>)</td>\r </tr>\r \r <tr><td>showGroupConsensus</td>\r <td>true of false (default is false)</td>\r <td>When true, shows consensus annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r </tr>\r \r <tr><td>showGroupConservation</td>\r <td>true of false (default is false)</td>\r <td>When true, shows amino-acid property conservation annotation row for any groups on the alignment. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>showConsensusHistogram</td>\r <td>true of false (default is true)</td>\r <td>When true, shows the percentage occurence of the consensus symbol for each column as a histogram above the consensus sequence row. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>showSequenceLogo</td>\r <td>true of false (default is false)</td>\r <td>When true, shows a sequence logo above the consensus sequence (overlaid above the Consensus Histogram, if visible, with symbols coloured using the alignment's default colourscheme). (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>normaliseLogo</td>\r <td>true of false (default is false)</td>\r <td>When true, all sequence logos will be normalised (all symbol stacks add up to full height of annotation row), rather than being scaled according to the fraction of symbols identical to the consensus. (<em>since 2.7.1</em>)</td>\r </tr>\r <tr><td>oninit</td>\r <td><em>after_init()</em></td>\r <td>name of javascript function that will be called after the jalviewLite instance has completed its initialisation. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>relaxedidmatch</td>\r <td><em>true or false (default is false)</em></td>\r <td>When true, use stem based matching to identify sequences that match features imported from a GFF or Jalview sequence features file, and for associating PDB data (passed on PDBfile parguments) with sequences (based on a given destination sequence ID). (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>alignpdbfiles</td>\r <td><em>true or false (default is false)</em></td>\r <td>When true, and jalviewLite is able to use jmol as a structure viewer, attempt to show a superposition of all structures loaded onto the alignment, superimposed using the aligned regions of corresponding sequences. [experimental] (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>externalstructureviewer</td>\r <td><em>true or false (default is false)</em></td>\r <td>re-route jmol colouring commands, selection and mouseover events to an external viewer using javascript callbacks. [experimental] (<em>since 2.7</em>)</td>\r \r </tr>\r <tr><td>annotationcolour_max</td>\r <td>colour name or RGB hex triplet (default is red)</td>\r <td>Default colour used for maximum value when shading by annotation. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>annotationcolour_min</td>\r <td>colour name or RGB hex triplet (default is orange)</td>\r <td>Default colour used for minimum value when shading by annotation. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>jalviewhelpurl</td>\r <td>absolute or relative url or javascript function prefixed by <em>javascript:</em> (default is http://www.jalview.org/help.html)</td>\r <td>Optional parameter allowing modification of the default Jalview Help URL normally opened when JalviewLite's 'Help' menu item is selected. (<em>since 2.7</em>)</td>\r </tr>\r <tr><td>resolvetocodebase</td>\r <td>True or False (False)</td>\r <td>Set to true to re-instate pre-JalviewLite 2.7 behaviour where relative URLs were prepended with the applet 'codebase' rather than the current document base URL before resolution. (<em>since 2.7</em>)</td>\r </tr>\r \r </table>
<p align="center"> </p>
<!-- InstanceEndEditable --></td>\r </tr>\r </table>\r</div>\r</body>\r<!-- InstanceEnd --></html>\r
\ No newline at end of file
</table></td>
</tr>
</table>
- <p> </p>
- <table width="300" border="1" cellspacing="0" cellpadding="0">
- <tr>
- <td><table width="300" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="100"> <applet code="jalview.bin.JalviewLite"
- width="140" height="35"
- archive="jalviewApplet.jar">
- <param name="file" value="jpred_msa.fasta">
- <param name="jnetfile" value="jpred_msa.seq.concise">
- <param name="defaultColour" value="Clustal">
- <param name="showAnnotation" value="true">
- <param name="windowHeight" value="515">
- <param name="windowWidth" value="650">
- <param name="showConservation" value="false">
- <param name="showQuality" value="false">
- <param name="showConsensus" value="false">
- <param name="showFullId" value="false">
- <param name="RGB" value="F2F2FF">
- <param name="linkLabel_1" value="SRS">
- <param name="linkUrl_1" value="http://srs.ebi.ac.uk/srs7bin/cgi-bin/wgetz?-e+[uniprot-all:$SEQUENCE_ID$]+-vn+2">
- <param name="linkLabel_2" value="Uniprot">
- <param name="linkUrl_2" value="http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$">
- <param name="APPLICATION_URL" value="http://www.jalview.org/services/launchApp">
- </applet> </td>
- <td width="165">Displays a Multiple Sequence Alignment Based
- JNet Prediction for a Sequence</td>
- </tr>
- </table></td>
- </tr>
- </table>\r </div>\r <p> </p>\r <p>For more JalviewLite examples, follow the links below.\r <ul>\r <li><a href="embedded.html">JalviewLite embedded in the web page</a></li>\r <li><a href="formComplete.html">use Javascript to control and get data from JalviewLite</a></li>\r <li><a href="linkedapplets_ng.html">use Javascript to make two jalviewLite instances talk to each other</a></li>\r <li><a href="embeddedWJmol.html">configure JalviewLite to talk to a Jmol applet on the page.</a></li>\r </ul>
+ <p> </p>\r <table width="300" border="1" cellspacing="0" cellpadding="0">\r <tr>\r <td><table width="300" border="0" cellspacing="0"\r cellpadding="0">\r <tr>\r <td width="100"><applet code="jalview.bin.JalviewLite"\r width="140" height="35" archive="jalviewApplet.jar">\r <param name="file" value="jpred_msa.fasta">\r <param name="jnetfile" value="jpred_msa.seq.concise">\r <param name="defaultColour" value="Clustal">\r <param name="showAnnotation" value="true">\r <param name="windowHeight" value="515">\r <param name="windowWidth" value="650">\r <param name="showConservation" value="false">\r <param name="showQuality" value="false">\r <param name="showConsensus" value="false">\r <param name="showFullId" value="false">\r <param name="RGB" value="F2F2FF">\r <param name="linkLabel_1" value="SRS">\r <param name="linkUrl_1"\r value="http://srs.ebi.ac.uk/srs7bin/cgi-bin/wgetz?-e+[uniprot-all:$SEQUENCE_ID$]+-vn+2">\r <param name="linkLabel_2" value="Uniprot">\r <param name="linkUrl_2"\r value="http://us.expasy.org/cgi-bin/niceprot.pl?$SEQUENCE_ID$">\r <param name="APPLICATION_URL"\r value="http://www.jalview.org/services/launchApp">\r </applet></td>\r <td width="165">Displays a Multiple Sequence Alignment\r Based JNet Prediction for a Sequence</td>\r </tr>\r </table></td>\r </tr>\r </table>\r <p> </p>\r <table width="300" border="1" cellspacing="0" cellpadding="0">\r <tr>\r <td><table width="300" border="0" cellspacing="0" cellpadding="0">\r <tr>\r <td width="100"> <applet code="jalview.bin.JalviewLite"\r width="140" height="35"\r archive="jalviewApplet.jar">\r <param name="file" value="RF00031_folded.stk">\r <param name="defaultColour" value="Purine/Pyrimidine">\r <param name="showAnnotation" value="true">\r <param name="windowHeight" value="515">\r <param name="windowWidth" value="650">\r <param name="showConservation" value="false">\r <param name="showQuality" value="false">\r <param name="showConsensus" value="true">\r <param name="showFullId" value="false">\r <param name="RGB" value="F2F2FF">\r <param name="APPLICATION_URL" value="http://www.jalview.org/services/launchApp">\r </applet> </td>\r <td width="165">Displays an RFAM RNA fold family with secondary structure annotation</td>\r </tr>\r </table></td>\r </tr>\r </table>\r </div>\r <p> </p>\r <p>For more JalviewLite examples, follow the links below.\r <ul>\r <li><a href="embedded.html">JalviewLite embedded in the web page</a></li>\r <li><a href="formComplete.html">use Javascript to control and get data from JalviewLite</a></li>\r <li><a href="linkedapplets_ng.html">use Javascript to make two jalviewLite instances talk to each other</a></li>\r <li><a href="embeddedWJmol.html">configure JalviewLite to talk to a Jmol applet on the page.</a></li>\r </ul>
<!-- InstanceEndEditable --></td>\r </tr>\r </table>\r</div>\r</body>\r<!-- InstanceEnd --></html>\r
\ No newline at end of file
<mapID target="viewingpdbs" url="html/features/viewingpdbs.html"/>
<mapID target="pdbmcviewer" url="html/features/pdbviewer.html"/>
<mapID target="pdbjmol" url="html/features/jmol.html"/>
+ <mapID target="varna" url="html/features/varna.html"/>
<mapID target="preferences" url="html/features/preferences.html"/>
<mapID target="commandline" url="html/features/commandline.html"/>
<mapID target="clarguments" url="html/features/clarguments.html"/>
<mapID target="colours.abovepid" url="html/colourSchemes/abovePID.html"/>
<mapID target="colours.conservation" url="html/colourSchemes/conservation.html"/>
<mapID target="colours.annotation" url="html/colourSchemes/annotationColouring.html"/>
+ <mapID target="colours.purinepyrimidine" url="html/colourSchemes/purinepyrimidine.html"/>
+ <mapID target="colours.rnahelices" url="html/colourSchemes/rnahelicesColouring.html"/>
<mapID target="calcs.alquality" url="html/calculations/quality.html"/>
<mapID target="calcs.alconserv" url="html/calculations/conservation.html"/>
+ <mapID target="calcs.alstrconsensus" url="html/calculations/structureconsensus.html"/>
<mapID target="calcs.consensus" url="html/calculations/consensus.html"/>
+ <mapID target="nucleicAcids" url="html/na/index.html"/>
+
<mapID target="menus" url="html/menus/index.html"/>
<mapID target="desktopMenu" url="html/menus/desktopMenu.html"/>
<mapID target="alMenu" url="html/menus/alignmentMenu.html"/>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<toc version="1.0">
<tocitem text="Jalview Documentation" target="home" expand="true" >
<tocitem text="What's new" target="new" expand="true">
- <tocitem text="Enhanced Jmol/Jalview interaction" target="pdbjmol"/>
- <tocitem text="Multi-Harmony Alignment Analysis" target="shmrws"/>
- <tocitem text="Jalview News Reader" target="newsreader"/>
- <tocitem text="Sort alignments associated with tree" target="treeviewer"/>
- <tocitem text="Default Annotation preferences" target="colours.annotation"/>
- <tocitem text="Jaba Web Services" target="jabaws"/>
+ <tocitem text="Viewing RNA structure" target="varna" />
+ <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
+ <tocitem text="RNA Helices coloring" target="colours.rnahelices"/>
</tocitem>
<tocitem text="Editing Alignments" target ="edit"/>
<tocitem text="Cursor Mode" target="cursor"/>
<tocitem text="Multiple Views" target="multipleviews"/>
<tocitem text="Viewing Trees" target="treeviewer" expand="false"/>
<tocitem text="Fetching Sequences" target="seqfetch"/>
+ <tocitem text="Nucleic Acid Support" target="nucleicAcids" expand="false">
+ <tocitem text="Viewing RNA structure" target="varna" />
+ <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
+ <tocitem text="RNA Helices coloring" target="colours.rnahelices"/>
+ </tocitem>
<tocitem text="Sequence Features" target="seqfeatures" expand="false">
<tocitem text="Sequence Feature Settings" target="seqfeatures.settings"/>
<tocitem text="Sequence Features File" target="features.fileformat"/>
<tocitem text="Turn propensity" target="colours.turn"/>
<tocitem text="Buried index" target="colours.buried"/>
<tocitem text="Nucleotide colours" target="colours.nucleotide"/>
+ <tocitem text="Purine/Pyrimidine colours" target="colours.purinepyrimidine"/>
<tocitem text="Blosum62" target="colours.blosum"/>
<tocitem text="by Percentage Identity" target="colours.pid"/>
<tocitem text="User Defined" target="colours.user"/>
<tocitem text="Above Percentage Identity" target="colours.abovepid"/>
<tocitem text="By conservation" target="colours.conservation"/>
<tocitem text="By Annotation" target="colours.annotation"/>
+ <tocitem text="By RNA Helices" target="colours.rnahelices"/>
</tocitem>
<tocitem text="Calculations" target="calculations" expand="false">
<tocitem text="Sorting alignments" target="sorting"/>
<tocitem text="Remove Redundancy" target="redundancy"/>
</tocitem>
<tocitem text="Alignment Annotations" target ="alannotation" expand="false">
- <tocitem text="Conservation" target="calcs.alconserv"/>
+ <tocitem text="Conservation" target="calcs.alconserv"/>
<tocitem text="Quality" target="calcs.alquality"/>
<tocitem text="Consensus" target="calcs.consensus"/>
+ <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
<tocitem text="Annotations File Format" target="annotations.fileformat"/>
</tocitem>
<tocitem text="Viewing PDB Files" target="viewingpdbs" expand="false">
<tocitem text="Jmol Viewer" target="pdbjmol"/>
<tocitem text="Simple PDB Viewer" target="pdbmcviewer"/>
</tocitem>
+ <tocitem text="Viewing RNA structures" target="varna" expand="false"> </tocitem>
<tocitem text="VAMSAS Data Exchange" target="vamsas">
<!-- what can Jalview share with other apps -->
<!-- what other apps exist -->
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<p>Select the <strong>"Copy Consensus Sequence"</strong> entry from
the consensus annotation label to copy the alignment's consensus sequence to the
clipboard.
+
+<p><strong>Sequence logo</strong></p>
+By clicking on the label you can also activate the sequence logo. It
+indicates the relative amount of residues per column which can be
+estimated by it's size in the logo. The tooltip of a column gives the
+exact numbers for all occuring residues.
</p>
</body>
</html>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+-->
+<head><title>Alignment RNA Structure Consensus Annotation</title></head>
+<body><p><strong>Alignment RNA Structure Consensus Annotation</strong></p>
+
+<p>The RNA structure consensus displayed below the alignment is the
+percentage of valid base pairs per column. It is calculated in
+relation to a secondary structure and just paired columns are
+calculated. The canonical Watson-Crick base pairings (A-T/U, G-C) and
+the wobble base pair (G-T/U) are regarded as valid pairings.<br>
+The amount of valid base pairs is indicated by the profile in the
+Alignment Annotation row.<br>
+By default this calculation includes gaps in columns. You can choose
+to ignore gaps in the calculation by right clicking on the label
+"StrConsensus" to the left of the structure consensus bar
+chart.<br>
+
+<p><strong>Structure logo</strong></p>
+By clicking on the label you can also activate the structure logo. It is very
+similar to a sequence logo but counts the numbers of base pairs. There
+are two residues per column, the actual column and the interacting
+base. The opening bracket is always the one on the left side.<br>
+Like sequence logos the relative amount of a specific base pair can be
+estimated by it's size in the logo. The tool tip of a column gives the
+exact numbers for all occurring valid base pairs.
+</p>
+</body>
+</html>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<p>The default colour schemes are summarised in the table below:
<div align="center">
<p> </p>
+<p><strong>Protein Colour Schemes</strong></p>
<table border="1">
<tr>
<td>
</td>
</tr>
</table>
+<p> </p>
+<p><strong>Nucleotide Colour Schemes</strong></p>
+<table border="1">
+ <tr>
+ <td>
+ <table border="1">
+ <tr>
+ <td nowrap></td>
+ <td>A</td> <!--Adenine-->
+ <td>C</td> <!--Cytosine-->
+ <td>G</td> <!--Guanine-->
+ <td>T</td> <!--Thymine-->
+ <td>U</td> <!--Uracil-->
+ <td>I</td> <!--Inosine-->
+ <td>X</td> <!--Xanthine-->
+ <td>R</td> <!--Unknown Purine-->
+ <td>Y</td> <!--Unknown Pyrimidine-->
+ <td>N</td> <!--Unknown-->
+ <td>W</td> <!--Weak nucleotide (A or T)-->
+ <td>S</td> <!--Strong nucleotide (G or C)-->
+ <td>M</td> <!--Amino (A or C)-->
+ <td>K</td> <!--Keto (G or T)-->
+ <td>B</td> <!--Not A (G or C or T)-->
+ <td>H</td> <!--Not G (A or C or T)-->
+ <td>D</td> <!--Not C (A or G or T)-->
+ <td>V</td> <!--Not T (A or G or C-->
+ </tr>
+ <tr>
+ <td height="24">Nucleotide</td>
+ <td bgcolor="#64F73F"></td>
+ <td bgcolor="#FFB340"></td>
+ <td bgcolor="#EB413C"></td>
+ <td bgcolor="#3C88EE"></td>
+ <td bgcolor="#3C88EE"></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td height="24">Purine/Pyrimidine</td>
+ <td bgcolor="#FF83FA"></td>
+ <td bgcolor="#40E0D0"></td>
+ <td bgcolor="#FF83FA"></td>
+ <td bgcolor="#40E0D0"></td>
+ <td bgcolor="#40E0D0"></td>
+ <td></td>
+ <td></td>
+ <td bgcolor="#FF83FA"></td>
+ <td bgcolor="#40E0D0"></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+
</div>
<p align="center"> </p>
</body>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<td bgcolor="#FFB340">C</td>
<td bgcolor="#EB413C">G</td>
<td bgcolor="#3C88EE">T</td>
+ <td bgcolor="#3C88EE">U</td>
</tr>
</table>
</div>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+-->
+<head><title>Purine/Pyrimidine Colour Scheme</title>
+<style type="text/css">
+<!--
+td {
+ text-align: center;
+}
+-->
+</style>
+</head>
+
+<body>
+<p><em>Purine/Pyrimidine Colours</em></p>
+<div align="center">
+ <table width="200" border="1">
+ <tr>
+ <td bgcolor="#FF83FA">Purines <BR> A, G, R</td>
+ <td bgcolor="#40E0D0">Pyrimidines <BR> C, U, T, Y</td>
+ </tr>
+ </table>
+</div>
+</body>
+</html>
--- /dev/null
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+-->
+<head><title>RNA Helices Colouring</title></head>
+
+<body>
+<p><strong> RNA Helices Colouring </strong></p>
+<p>An RNA alignment loaded from a Stockholm file can be coloured
+ based on its helices. The helices are determined from the
+ secondary structure line in the Stockholm file (#GC SS_cons)
+ written in WUSS notation
+ that specifies base pairing. See <a href="http://en.wikipedia.org/wiki/Stockholm_format">
+ Wikipedia</a> or <a href="http://jalview-rnasupport.blogspot.com/2010/06/parsing-wuss-notation-of-rna-secondary.html">
+ Jalview RNA Support Blog</a> for more information about Stockholm files and WUSS notation.</p>
+Select "Colour" <strong>→</strong> "
+ By RNA Helices" to colour the alignment by RNA helices. <br>
+ <br>
+<p><em>Features</em></p>
+<ul>
+<li>Colours are generated randomly for the number of helices present.
+Reselect the "By RNA Helices" option to generate another set of random colors. </li>
+<li>Sequence logo is in <a href="purinepyrimidine.html">
+Purine/Pyrimidine colour scheme</a>. </li>
+<li>Line above the "Secondary Structure" line in annotation panel is WUSS notation present
+in the input file.</li>
+</ul>
+
+
+
+ <div align="center">
+ <img src="rnahelicescoloring.png" width="600" height="140"> </div>
+
+
+</body>
+</html>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<p><strong>The Jmol PDB Viewer</strong></p>\r
<p>Since Jalview 2.3, <a href="http://jmol.sourceforge.net/">Jmol</a>\r
has been integrated into Jalview for interactively viewing structures\r
-opened by selecting the <strong>"Sequence→View PDB\r
+opened by selecting the <strong>"Structure→View PDB\r
entry:"</strong> option in the <a href="../menus/popupMenu.html">sequence\r
id pop-up menu</a> (if you can't see this, then you need to <a\r
href="viewingpdbs.html">associate a PDB structure</a> with the\r
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
</head>
<body>
<p><strong>Sequence Fetcher</strong></p>
-<p>Jalview can retrieve sequences from certain databases using
-either the WSDBFetch service provided by the European Bioinformatics
-Institute, and, since Jalview 2.4, DAS servers capable of the <em>sequence</em>
-command (configured in <a href="dassettings.html">DAS settings</a>).</p>
-<img src="seqfetcher.gif" align="center"
- alt="The Jalview Sequence Fetcher Dialog Box">
-<p>The Sequence Fetcher dialog box can be opened via the
-"File" menu on the main desktop in order to retrieve sequences
-as a new alignment, or opened via the "File" menu of an
-existing alignment to import additional sequences. Please note, there
-will be a short delay when the sequence fetcher is first opened, whilst
-Jalview compiles the list of available sequence datasources from the
-currently defined DAS server registry.</strong></p>
-<p>First, select the database you want to retrieve sequences from.
-Then, enter one or more accession ids (as a semi-colon separated list),
-or press the "Example" button to paste the example accession
-for the currently selected database into the retrieval box. Finally,
-press "OK" to initiate the retrieval.</p>
-<p><em>Fetching Individual PDB Chains</em><br>
-If you are retrieving sequences from the PDB, you can retrieve specific
-chains by appending a colon and the chain id to the PDB id. For example
-:<br>
-<pre> 1GAQ:A</pre>
-</p>
-<p><em>Retrieving parts of large sequence records</em><br>
-When retrieving from DAS sequence sources, coordinate range arguments
-can be passed to the server using the standard DAS sequence command
-format:<pre>
- <AccessionId>:<start>,<end></pre> If you know a source
-understands this type of query format, then you should untick the
-checkbox for 'replace commas with semi-colons' so the range query can be
-passed to the server; otherwise, the query will be split into two (e.g
-'Mito:1' and '85779' rather than 'Mito:1,85779'). In most cases,
-however, a source that supports range queries will include a range
-qualification in its example query, and Jalview will then automatically
-disable the 'replace commas with semi-colons' option.<br>
-<em>The option to disable the comma to semi-colon translation was
-added in Jalview 2.6</em></p>
-<p>If you use the WSDBFetch sequence fetcher services (EMBL,
-Uniprot, PDB and PFAM) in work for publication, please cite:</p>
-<p>Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S.,
-Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez
-R. <br>
-SOAP-based services provided by the European Bioinformatics Institute.<br>
-Nucleic Acids Res. 33(1):W25-W28 (2005) <br>
-<br>
+<p>Jalview can retrieve sequences from certain databases using either the
+WSDBFetch service provided by the European Bioinformatics Institute, and, since Jalview 2.4, DAS servers capable of the <em>sequence</em> command (configured in <a href="dassettings.html">DAS settings</a>).</p>
+<img src="seqfetcher.gif" align="center" alt="The Jalview Sequence Fetcher Dialog Box">
+<p>The Sequence Fetcher dialog box can be opened via the "File"
+ menu on the main desktop in order to retrieve sequences as a new
+ alignment, or opened via the "File" menu of an existing alignment
+ to import additional sequences. Please note, there will be a short delay when the sequence fetcher is first opened,
+ whilst Jalview compiles the list of available sequence datasources from the
+ currently defined DAS server registry.</strong>
</p>
+<p>First, select the database you want to retrieve sequences from. Then, enter
+ one or more accession ids (as a semi-colon separated list), or press the
+ "Example" button to paste the example accession for the currently selected database into the retrieval box.
+ Finally, press "OK" to initiate the retrieval.</p>
+<p>
+ If you are retrieving sequences from the PDB, you can retrieve
+ specific chains by appending a colon and the chain id to the PDB
+ id. For example :<br><pre> 1GAQ:A</pre><br>When retrieving from DAS sequence sources,
+ coordinate range arguments can be passed to the server using the standard DAS
+ sequence command format (<strong>:<start>,<end></strong>)</p>
+<p>If you use the WSDBFetch sequence fetcher services (EMBL, Uniprot, PDB, PFAM, and RFAM)
+ in work for publication, please cite:</p>
+<p>Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar
+ S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R. <br>
+ SOAP-based services provided by the European Bioinformatics Institute.<br>
+ Nucleic Acids Res. 33(1):W25-W28 (2005) <br>
+ <br>
+ </p>
</body>
</html>
<html>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
--- /dev/null
+<html>\r
+<!--\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
+ * \r
+ * This file is part of Jalview.\r
+ * \r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
+ * \r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE. See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.\r
+-->\r
+<head>\r
+<title>The VARNA RNA Viewer</title>\r
+</head>\r
+<body>\r
+<p><strong>The VARNA RNA Viewer</strong></p>\r
+<p>Since Jalview\r
+2.7.1, <a href="http://varna.lri.fr/index.html">VARNA</a> has been\r
+integrated into Jalview for interactively viewing structures opened by\r
+selecting the <strong>"Structure→View\r
+Structure:"</strong> option in\r
+the <a href="../menus/popupMenu.html">sequence id pop-up menu</a> (if\r
+you can't see this, then no RNA structure is associated with your\r
+sequence or alignment. In the pop-up menu all structures that\r
+are associated with this sequence and all sequences that are\r
+associated with the alignment are available.\r
+\r
+<p><strong>Different structures</strong></p>\r
+<ul>\r
+ <li>\r
+ <b>Alignment structures</b>:\r
+ Structures associated with the alignment are marked by having "consensus" attached to their name. VARNA contains two different entries for consensus structures.\r
+ <ul>\r
+ <li>Consensus structure: the individual sequence folded into the consensus structure</li>\r
+ <li>Trimmed consensus structure: the individual sequence\r
+ folded into the the gap-free consensus structure. That means all\r
+ columns that contained gaps in the individual sequence were\r
+ removed. If this breaks a base-pair the pairing is removed also.\r
+ This can be considered as an approximation for the individual structure.\r
+ </ul>\r
+ </li>\r
+ <li>\r
+ <b>Individual structures</b>:\r
+ this is a structure associated with the individual sequence and therefore not related to the alignment \r
+ </li>\r
+\r
+<p><strong>Controls</strong><br>\r
+<ul>\r
+<li>Rotate view - Left Click and drag</li>\r
+<li>Zoom in - Press '+'</li>\r
+<li>Zoom out - Press '-'</li>\r
+<li>Choose a different structure - Left click on structure in the left hand panel</li>\r
+<li>Highlighting bases - Move mouse over columns in the Jalview alignment panel</li>\r
+</ul>\r
+\r
+<p><strong>Functionality provided by VARNA</strong></p>\r
+<p>VARNA's own functions are accessed by right-clicking in the\r
+structure display area. That will open the VARNA pop-up menu,\r
+which provides access to a number of features like different draw algorithm, color highlighting or annotations. \r
+</p>\r
+<p><strong>More Information</strong></p>\r
+<p>VARNA is a very powerful RNA viewer on its own. Only the\r
+essentials have been described here - the interested reader is\r
+referred to <a href="http://varna.lri.fr/usermanual.html">VARNA's own\r
+comprehensive online documentation</a>.</p>\r
+</body>\r
+</html>\r
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
</tr><tr><td width="17%">PFAM</td>
<td width="60%">SequenceName THISISASEQENCE</td>
<td width="23%">.pfam</td>
+</tr><tr>
+<td width="17%">Stockholm</td>
+<td width="60%"># STOCKHOLM VersionNumber<br>
+<em>...</em><br>//</td>
+<td width="23%">.stk, .sto</td>
</tr>
</table>
<p>The file extensions are used to associate jalview alignment icons
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<li><strong>File</strong>
<ul>
<li><strong>Fetch Sequence</strong><br> <em>Shows a
- dialog window in which you can select known ids from Uniprot,
- EMBL, EMBLCDS or PDB database using Web Services provided by the
+ dialog window in which you can retrieve known ids from Uniprot,
+ EMBL, EMBLCDS, PFAM, Rfam, or PDB database using Web Services provided by the
European Bioinformatics Institute. See <a
href="../features/seqfetch.html">Sequence Fetcher</a> </em>.</li>
<li><strong>Add Sequences</strong><em><br> Add
</ul></li>
</ul>
+ </li>
+
+ </ul>
</li>
<li><strong>Colour</strong>
<li>Colour Scheme options: <strong>None, ClustalX,
Blosum62 Score, Percentage Identity, Zappo, Taylor,
Hydrophobicity, Helix Propensity, Strand Propensity, Turn
- Propensity, Buried Index, Nucleotide, User Defined<br> </strong> <em>See
+ Propensity, Buried Index, Nucleotide, Purine/Pyrimidine, User Defined<br> </strong> <em>See
<a href="../colourSchemes/index.html">colours</a> for a
description of all colour schemes.</em><br></li>
<li><strong>By Conservation<br> </strong><em>See <a
the alignment on a per-column value from a specified annotation.
See <a href="../colourSchemes/annotationColouring.html">Annotation
Colouring</a>.</em><br></li>
+ <li><strong>By RNA Helices</strong><br>
+ <em>Colours the helices of an RNA alignment loaded from a Stockholm file. See
+ <a href="../colourSchemes/rnahelicesColouring.html">RNA Helices
+ Colouring</a>.</em><br>
+ </li>
</ul></li>
<li><strong>Calculate</strong>
<ul>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
</em></li>
<li>Colour Scheme options: <strong>None, ClustalX, Blosum62 Score, Percentage
Identity, Zappo, Taylor, Hydrophobicity, Helix Propensity, Strand Propensity,
- Turn Propensity, Buried Index, Nucleotide, User Defined<br>
+ Turn Propensity, Buried Index, Nucleotide, Purine/Pyrimidine, User Defined<br>
</strong> <em>See <a href="../colourSchemes/index.html">colours</a> for
a description of all colour schemes.</em><br>
</li>
<em>Colours the alignment on a per-column value from a specified annotation.
See <a href="../colourSchemes/annotationColouring.html">Annotation Colouring</a>.</em><br>
</li>
+ <li><strong>By RNA Helices</strong><br>
+ <em>Colours the helices of an RNA alignment loaded from a Stockholm file. See
+ <a href="../colourSchemes/rnahelicesColouring.html">RNA Helices
+ Colouring</a>.</em><br>
+ </li>
</ul>
</body>
</html>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<ul>
<li><strong>Fetch Sequence</strong><br>
<em>Shows a dialog window in which you can select known ids from
- Uniprot, EMBL, EMBLCDS or PDB database using Web Services provided by
+ Uniprot, EMBL, EMBLCDS, PDB, PFAM, or RFAM databases using Web Services provided by
the European Bioinformatics Institute. See <a
href="../features/seqfetch.html">Sequence Fetcher</a></em>.</li>
<li><strong>Add Sequences</strong><em><br>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+-->
+<head>
+<title>Nucleic Acid Support</title>
+<style type="text/css">
+<!--
+td {
+ font-family: "Courier New", Courier, mono;
+ font-style: normal;
+ font-size: medium;
+}
+-->
+</style>
+</head>
+<body>
+<p><strong>Nucleic Acid Support</strong></p>
+<p><em>Colour Schemes</em></p>
+<p>Jalview has color schemes for nucleic acid based sequences, ability to
+fetch sequences from RFAM and RNA secondary structure coloring</p>
+<p>Information on the <a href="../colourSchemes/nucleotide.html">Nucleotide
+colour scheme</a> and <a href="../colourSchemes/purinepyrimidine.html">
+Purine/Pyrimidine colour scheme</a> are available
+under the Colour Menu. See <a href="../colourSchemes/index.html">Colour
+Schemes</a>.</p>
+<p><em>RNA Support</em></p>
+<p>Sequences can be <a href="../features/seqfetch.html">fetched</a> from the
+RFAM database by accession number or ID.</p>
+<p>If an RNA alignment is loaded from a Stockholm file with secondary
+structure information in WUSS notation, the alignment can be coloured by
+the helices in the secondary structure. Helices are determined by the base-pairing
+in the secondary structure line. See <a href="../colourSchemes/rnahelicesColouring.html">
+RNA Helices Colouring</a>. Below is an example of this type of coloring</p>
+<p>Annotation panel shows the presence of RNA helices and WUSS notation from
+input file specifying secondary structure.<p>
+<div align="center">
+ <img src="../colourschemes/rnahelicescoloring.png" width="600" height="140"> </div>
+
+
+</div>
+<p align="center"> </p>
+</body>
+</html>
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<strong>What's new ?</strong>
</p>
<p>
- The Jalview 2.7 release features new web services, and important
- improvements to the way in which Jalview handles alignments and
- associated PDB structures, as well as numerous minor improvements and
- bug fixes. Version 2.7 of the JalviewLite applet also features a
- significantly enhanced Javascript API enabling it to be more easily
- integrated with javascript based web applications. <br /> For full
- details see the <a href="releases.html#Jalview2.7">Jalview 2.7
+ The Jalview 2.7.1 release features (tbc)
+ <br /> For full
+ details see the <a href="releases.html#Jalview2.7.1">Jalview 2.7.1
release history</a>.
</p>
<p>
- <strong>Highlights in Jalview Desktop Version 2.7</strong>
+ <strong>Highlights in Jalview Desktop Version 2.7.1</strong>
</p>
<ul>
- <li>New <a href="features/viewingpdbs.html">structure viewer
- options</a>:
- <ul>
- <li>Colour and superimpose 3D structures of complexes and
- multi-domain chains using several different alignments</li>
- <li>Drag and drop to associate PDB files with sequences that
- have the same name</li>
- <li>Open and superimpose all associated structures for the
- current selection</li>
- </ul>
- <li>New web services for <a href="webServices/shmr.html">alignment
- analysis</a></li>
- <li>Improved graphical user interface for <a
- href="http://www.compbio.dundee.ac.uk/jabaws">JABAWS</a>services.
- </li>
- <li>Sort associated alignment views option in tree viewer</li>
- <li>Default colours for <a
- href="colourSchemes/annotationColouring.html">shading alignment
- by quantitative annotation</a>.
- </li>
- <li><a href="webServices/newsreader.html">Jalview Desktop RSS
- reader</a> - following important updates at <a
- href="http://www.jalview.org/feeds/desktop/rss">http://www.jalview.org/feeds/desktop/rss</a>
+
+ <li>New Purine/Pyrimidine colour scheme</li>
+ <li>Colouring of RNA secondary structure by helices. See <a href="na/index.html">Nucleic Acid Support</a></li>
+ <li>Embedded <a href="http://www.varna.fr/">VARNA</a> RNA secondary structure viewer.
</ul>
<p>
<strong>Issues Resolved (a select list - see the <a
- href="releases.html#Jalview2.7">release history</a> for full details)
+ href="releases.html#Jalview2.7.1">release history</a> for full details)
</strong>
</p>
<p>
<strong>Issues in the Jalview Desktop</strong>
<ul>
- <li>Problems viewing associated structures for sequences
- retrieved from UNIPROT</li>
- <li>Problems viewing Jalview projects from older versions in
- version 2.6</li>
- <li>Preservation of hidden annotation rows and tree bootstrap
- values in projects</li>
- <li>Newly added JABAWS servers not always visible in web services
- menu</li>
</ul>
<strong>Issues specific to the JalviewLite Applet</strong>
<ul>
- <li>Layout problems when lots of annotation rows are displayed</li>
- <li><= shown as = in annotation row tooltip</li>
- <li>export features raises exception when no features exist</li>
- <li>relative URLs not handled properly when used in parameters
- and annotation files</li>
</ul>
<strong>Issues affecting both applet and application</strong>
<ul>
- <li>sequence numbering not preserved in MSF alignment output</li>
- <li>sequence associated secondary structure not correctly parsed
- in interleaved stockholm</li>
- <li>sequences containing lowercase letters are not properly
- associated with their pdb files</li>
- <li>Jalview PDB file reader does not extract sequence from deoxy
- nucleotide chains correctly</li>
- <li>Sequence length given in alignment properties window is off
- by 1</li>
</ul>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<?xml version="1.0" encoding="UTF-8"?><!--
Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
This file is part of Jalview.
file.reference.JmolApplet-12.2.4.jar=appletlib/JmolApplet-12.2.4.jar
file.reference.log4j-1.2.8.jar=lib/log4j-1.2.8.jar
file.reference.mail.jar=lib/mail.jar
-file.reference.min-jaba-client.jar=lib/min-jaba-client.jar
+file.reference.min-jaba-client.jar=lib/min-jaba-client-2.0.jar
file.reference.regex.jar=lib/regex.jar
file.reference.saaj.jar=lib/saaj.jar
file.reference.vamsas-client.jar=lib/vamsas-client.jar
<?xml version="1.0" encoding="UTF-8"?><!--
Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
This file is part of Jalview.
--- /dev/null
+YEAR=2011
+AUTHORS=J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+AUTHORFNAMES=Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton
+
\ No newline at end of file
<?xml version="1.0"?>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<?xml version="1.0"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<?xml version="1.0" encoding="UTF-8"?>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<?xml version="1.0" encoding="UTF-8"?>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<?xml version="1.0" encoding="UTF-8"?>\r
<!--\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
}
;
jalview.util.QuickSort.sort(vl, ca);
- rtnval[0] = 1;
+ rtnval[0] = 2;
+ rtnval[1]=0;
for (int c = ca.length - 1; profile[0][((char[]) ca[c])[0]] > 0; c--)
{
if (((char[]) ca[c])[0] != '-')
{
rtnval[rtnval[0]++] = ((char[]) ca[c])[0];
- rtnval[rtnval[0]++] = (int) (((float) profile[0][((char[]) ca[c])[0]]) * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+ rtnval[rtnval[0]] = (int) (((float) profile[0][((char[]) ca[c])[0]]) * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
: 0]);
+ rtnval[1]+=rtnval[rtnval[0]++];
}
}
return rtnval;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
* end residue position
*/
public Conservation(String name, Hashtable propHash, int threshold,
- Vector sequences, int start, int end)
+ List<SequenceI> sequences, int start, int end)
{
-
this.name = name;
this.propHash = propHash;
this.threshold = threshold;
try {
for (s = 0; s < sSize; s++)
{
- sarray[s] = (SequenceI) sequences.elementAt(s);
+ sarray[s] = (SequenceI) sequences.get(s);
if (sarray[s].getLength() > maxLength)
{
maxLength = sarray[s].getLength();
}
}
}
+
+ /**
+ * construct and call the calculation methods on a new Conservation object
+ * @param name - name of conservation
+ * @param consHash - hash table of properties for each amino acid (normally ResidueProperties.propHash)
+ * @param threshold - minimum number of conserved residues needed to indicate conservation (typically 3)
+ * @param seqs
+ * @param start first column in calculation window
+ * @param end last column in calculation window
+ * @param posOrNeg positive (true) or negative (false) conservation
+ * @param consPercGaps percentage of gaps tolerated in column
+ * @param calcQuality flag indicating if alignment quality should be calculated
+ * @return Conservation object ready for use in visualization
+ */
+ public static Conservation calculateConservation(String name,
+ Hashtable consHash, int threshold, List<SequenceI> seqs, int start, int end, boolean posOrNeg, int consPercGaps, boolean calcQuality)
+ {
+ Conservation cons = new Conservation(name, consHash, threshold, seqs, start,end);
+ return calculateConservation(cons, posOrNeg, consPercGaps, calcQuality);
+ }
+ /**
+ * @param b positive (true) or negative (false) conservation
+ * @param consPercGaps percentage of gaps tolerated in column
+ * @param calcQuality flag indicating if alignment quality should be calculated
+ * @return Conservation object ready for use in visualization
+ */
+ public static Conservation calculateConservation(Conservation cons, boolean b, int consPercGaps, boolean calcQuality)
+ {
+ cons.calculate();
+ cons.verdict(b, consPercGaps);
+
+ if (calcQuality)
+ {
+ cons.findQuality();
+ }
+
+ return cons;
+ }
}
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Author: Lauren Michelle Lui
+ * Methods are based on RALEE methods http://personalpages.manchester.ac.uk/staff/sam.griffiths-jones/software/ralee/
+ * */
+
+package jalview.analysis;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Stack;
+import java.util.Vector;
+
+import jalview.datamodel.SequenceFeature;
+
+public class Rna
+{
+ static Hashtable<Integer, Integer> pairHash = new Hashtable();
+ /**
+ * Based off of RALEE code ralee-get-base-pairs. Keeps track of open bracket
+ * positions in "stack" vector. When a close bracket is reached, pair this
+ * with the last element in the "stack" vector and store in "pairs" vector.
+ * Remove last element in the "stack" vector. Continue in this manner until
+ * the whole string is processed.
+ *
+ * @param line
+ * Secondary structure line of an RNA Stockholm file
+ * @return Array of SequenceFeature; type = RNA helix, begin is open base
+ * pair, end is close base pair
+ */
+ public static SequenceFeature[] GetBasePairs(CharSequence line) throws WUSSParseException
+ {
+ Stack stack = new Stack();
+ Vector pairs = new Vector();
+
+ int i = 0;
+ while (i < line.length())
+ {
+ char base = line.charAt(i);
+
+ if ((base == '<') || (base == '(') || (base == '{') || (base == '['))
+ {
+ stack.push(i);
+ }
+ else if ((base == '>') || (base == ')') || (base == '}')
+ || (base == ']'))
+ {
+
+ if (stack.isEmpty())
+ {
+ // error whilst parsing i'th position. pass back
+ throw new WUSSParseException("Mismatched closing bracket", i);
+ }
+ Object temp = stack.pop();
+ pairs.addElement(temp);
+ pairs.addElement(i);
+ }
+
+ i++;
+ }
+
+ int numpairs = pairs.size() / 2;
+ SequenceFeature[] outPairs = new SequenceFeature[numpairs];
+
+ // Convert pairs to array
+ for (int p = 0; p < pairs.size(); p += 2)
+ {
+ int begin = Integer.parseInt(pairs.elementAt(p).toString());
+ int end = Integer.parseInt(pairs.elementAt(p + 1).toString());
+
+ outPairs[p / 2] = new SequenceFeature("RNA helix", "", "", begin,
+ end, "");
+ //pairHash.put(begin, end);
+
+ }
+
+ return outPairs;
+ }
+
+
+ /**
+ * Function to get the end position corresponding to a given start position
+ * @param indice - start position of a base pair
+ * @return - end position of a base pair
+ */
+ /*makes no sense at the moment :(
+ public int findEnd(int indice){
+ //TODO: Probably extend this to find the start to a given end?
+ //could be done by putting everything twice to the hash
+ ArrayList<Integer> pair = new ArrayList<Integer>();
+ return pairHash.get(indice);
+ }*/
+
+
+ /**
+ * Figures out which helix each position belongs to and stores the helix
+ * number in the 'featureGroup' member of a SequenceFeature Based off of RALEE
+ * code ralee-helix-map.
+ *
+ * @param pairs
+ * Array of SequenceFeature (output from Rna.GetBasePairs)
+ */
+ public static void HelixMap(SequenceFeature[] pairs)
+ {
+
+ int helix = 0; // Number of helices/current helix
+ int lastopen = 0; // Position of last open bracket reviewed
+ int lastclose = 9999999; // Position of last close bracket reviewed
+ int i = pairs.length; // Number of pairs
+
+ int open; // Position of an open bracket under review
+ int close; // Position of a close bracket under review
+ int j; // Counter
+
+ Hashtable helices = new Hashtable(); // Keep track of helix number for each
+ // position
+
+ // Go through each base pair and assign positions a helix
+ for (i = 0; i < pairs.length; i++)
+ {
+
+ open = pairs[i].getBegin();
+ close = pairs[i].getEnd();
+
+ // System.out.println("open " + open + " close " + close);
+ // System.out.println("lastclose " + lastclose + " lastopen " + lastopen);
+
+ // we're moving from right to left based on closing pair
+ /*
+ * catch things like <<..>>..<<..>> |
+ */
+ if (open > lastclose)
+ {
+ helix++;
+ }
+
+ /*
+ * catch things like <<..<<..>>..<<..>>>> |
+ */
+ j = pairs.length - 1;
+ while (j >= 0)
+ {
+ int popen = pairs[j].getBegin();
+
+ // System.out.println("j " + j + " popen " + popen + " lastopen "
+ // +lastopen + " open " + open);
+ if ((popen < lastopen) && (popen > open))
+ {
+ if (helices.containsValue(popen)
+ && (((Integer) helices.get(popen)) == helix))
+ {
+ continue;
+ }
+ else
+ {
+ helix++;
+ break;
+ }
+ }
+
+ j -= 1;
+ }
+
+ // Put positions and helix information into the hashtable
+ helices.put(open, helix);
+ helices.put(close, helix);
+
+ // Record helix as featuregroup
+ pairs[i].setFeatureGroup(Integer.toString(helix));
+
+ lastopen = open;
+ lastclose = close;
+
+ }
+ }
+}
+
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package jalview.analysis;
+
+import java.util.*;
+
+import jalview.datamodel.*;
+
+/**
+ * Takes in a vector or array of sequences and column start and column end and
+ * returns a new Hashtable[] of size maxSeqLength, if Hashtable not supplied.
+ * This class is used extensively in calculating alignment colourschemes that
+ * depend on the amount of conservation in each alignment column.
+ *
+ * @author $author$
+ * @version $Revision$
+ */
+public class StructureFrequency
+{
+ // No need to store 1000s of strings which are not
+ // visible to the user.
+ public static final String MAXCOUNT = "C";
+
+ public static final String MAXRESIDUE = "R";
+
+ public static final String PID_GAPS = "G";
+
+ public static final String PID_NOGAPS = "N";
+
+ public static final String PROFILE = "P";
+
+ public static final String PAIRPROFILE = "B";
+
+ /**
+ * Returns the 3' position of a base pair
+ *
+ * @param pairs
+ * Secondary structure annotation
+ * @param indice
+ * 5' position of a base pair
+ * @return 3' position of a base pair
+ */
+ public static int findPair(SequenceFeature[] pairs, int indice)
+ {
+ for (int i = 0; i < pairs.length; i++)
+ {
+ if (pairs[i].getBegin() == indice)
+ {
+ return pairs[i].getEnd();
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Method to calculate a 'base pair consensus row', very similar to nucleotide
+ * consensus but takes into account a given structure
+ *
+ * @param sequences
+ * @param start
+ * @param end
+ * @param result
+ * @param profile
+ * @param rnaStruc
+ */
+ public static final void calculate(SequenceI[] sequences, int start,
+ int end, Hashtable[] result, boolean profile,
+ AlignmentAnnotation rnaStruc)
+ {
+ Hashtable residueHash;
+ String maxResidue;
+ char[] seq, struc = rnaStruc.getRNAStruc().toCharArray();
+ SequenceFeature[] rna = rnaStruc._rnasecstr;
+ char c, s, cEnd;
+ int count, nonGap = 0, i, bpEnd = -1, j, jSize = sequences.length;
+ int[] values;
+ int[][] pairs;
+ float percentage;
+
+ for (i = start; i < end; i++) // foreach column
+ {
+ residueHash = new Hashtable();
+ maxResidue = "-";
+ values = new int[255];
+ pairs = new int[255][255];
+ bpEnd = -1;
+ if (i < struc.length)
+ {
+ s = struc[i];
+ }
+ else
+ {
+ s = '-';
+ }
+ if (s == '.' || s == ' ')
+ {
+ s = '-';
+ }
+
+ if (s != '(')
+ {
+ if (s == '-')
+ {
+ values['-']++;
+ }
+ }
+ else
+ {
+ bpEnd = findPair(rna, i);
+ if (bpEnd>-1)
+ {
+ for (j = 0; j < jSize; j++) // foreach row
+ {
+ if (sequences[j] == null)
+ {
+ System.err
+ .println("WARNING: Consensus skipping null sequence - possible race condition.");
+ continue;
+ }
+ c = sequences[j].getCharAt(i);
+ {
+
+ // standard representation for gaps in sequence and structure
+ if (c == '.' || c == ' ')
+ {
+ c = '-';
+ }
+
+ if (c == '-')
+ {
+ values['-']++;
+ continue;
+ }
+ cEnd = sequences[j].getCharAt(bpEnd);
+ if (checkBpType(c, cEnd))
+ {
+ values['(']++; // H means it's a helix (structured)
+ }
+ pairs[c][cEnd]++;
+
+ maxResidue = "(";
+ }
+ }
+ }
+ // nonGap++;
+ }
+ // UPDATE this for new values
+ if (profile)
+ {
+ residueHash.put(PROFILE, new int[][]
+ { values, new int[]
+ { jSize, (jSize - values['-']) } });
+
+ residueHash.put(PAIRPROFILE, pairs);
+ }
+
+ count = values['('];
+
+ residueHash.put(MAXCOUNT, new Integer(count));
+ residueHash.put(MAXRESIDUE, maxResidue);
+
+ percentage = ((float) count * 100) / (float) jSize;
+ residueHash.put(PID_GAPS, new Float(percentage));
+
+ // percentage = ((float) count * 100) / (float) nongap;
+ // residueHash.put(PID_NOGAPS, new Float(percentage));
+ if (result[i] == null)
+ {
+ result[i] = residueHash;
+ }
+ if (bpEnd > 0)
+ {
+ values[')'] = values['('];
+ values['('] = 0;
+
+ residueHash = new Hashtable();
+ maxResidue = ")";
+
+ if (profile)
+ {
+ residueHash.put(PROFILE, new int[][]
+ { values, new int[]
+ { jSize, (jSize - values['-']) } });
+
+ residueHash.put(PAIRPROFILE, pairs);
+ }
+
+ residueHash.put(MAXCOUNT, new Integer(count));
+ residueHash.put(MAXRESIDUE, maxResidue);
+
+ percentage = ((float) count * 100) / (float) jSize;
+ residueHash.put(PID_GAPS, new Float(percentage));
+
+ result[bpEnd] = residueHash;
+ }
+ }
+ }
+
+ /**
+ * Method to check if a base-pair is a canonical or a wobble bp
+ *
+ * @param up
+ * 5' base
+ * @param down
+ * 3' base
+ * @return True if it is a canonical/wobble bp
+ */
+ public static boolean checkBpType(char up, char down)
+ {
+ if (up > 'Z')
+ {
+ up -= 32;
+ }
+ if (down > 'Z')
+ {
+ down -= 32;
+ }
+
+ switch (up)
+ {
+ case 'A':
+ switch (down)
+ {
+ case 'T':
+ return true;
+ case 'U':
+ return true;
+ }
+ break;
+ case 'C':
+ switch (down)
+ {
+ case 'G':
+ return true;
+ }
+ break;
+ case 'T':
+ switch (down)
+ {
+ case 'A':
+ return true;
+ case 'G':
+ return true;
+ }
+ break;
+ case 'G':
+ switch (down)
+ {
+ case 'C':
+ return true;
+ case 'T':
+ return true;
+ case 'U':
+ return true;
+ }
+ break;
+ case 'U':
+ switch (down)
+ {
+ case 'A':
+ return true;
+ case 'G':
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ /**
+ * Compute all or part of the annotation row from the given consensus
+ * hashtable
+ *
+ * @param consensus
+ * - pre-allocated annotation row
+ * @param hconsensus
+ * @param iStart
+ * @param width
+ * @param ignoreGapsInConsensusCalculation
+ * @param includeAllConsSymbols
+ */
+ public static void completeConsensus(AlignmentAnnotation consensus,
+ Hashtable[] hconsensus, int iStart, int width,
+ boolean ignoreGapsInConsensusCalculation,
+ boolean includeAllConsSymbols)
+ {
+ float tval, value;
+ if (consensus == null || consensus.annotations == null
+ || consensus.annotations.length < width)
+ {
+ // called with a bad alignment annotation row - wait for it to be
+ // initialised properly
+ return;
+ }
+ for (int i = iStart; i < width; i++)
+ {
+ if (i >= hconsensus.length)
+ {
+ // happens if sequences calculated over were shorter than alignment
+ // width
+ consensus.annotations[i] = null;
+ continue;
+ }
+ value = 0;
+ if (ignoreGapsInConsensusCalculation)
+ {
+ value = ((Float) hconsensus[i].get(StructureFrequency.PID_NOGAPS))
+ .floatValue();
+ }
+ else
+ {
+ value = ((Float) hconsensus[i].get(StructureFrequency.PID_GAPS))
+ .floatValue();
+ }
+
+ String maxRes = hconsensus[i].get(StructureFrequency.MAXRESIDUE)
+ .toString();
+ String mouseOver = hconsensus[i].get(StructureFrequency.MAXRESIDUE)
+ + " ";
+ if (maxRes.length() > 1)
+ {
+ mouseOver = "[" + maxRes + "] ";
+ maxRes = "+";
+ }
+ int[][] profile = (int[][]) hconsensus[i]
+ .get(StructureFrequency.PROFILE);
+ int[][] pairs = (int[][]) hconsensus[i]
+ .get(StructureFrequency.PAIRPROFILE);
+
+ if (pairs != null && includeAllConsSymbols) // Just responsible for the
+ // tooltip
+ // TODO Update tooltips for Structure row
+ {
+ mouseOver = "";
+
+ /* TODO It's not sure what is the purpose of the alphabet and wheter it is useful for structure?
+ *
+ * if (alphabet != null) { for (int c = 0; c < alphabet.length; c++) {
+ * tval = ((float) profile[0][alphabet[c]]) 100f / (float)
+ * profile[1][ignoreGapsInConsensusCalculation ? 1 : 0]; mouseOver +=
+ * ((c == 0) ? "" : "; ") + alphabet[c] + " " + ((int) tval) + "%"; } }
+ * else {
+ */
+ Object[] ca = new Object[625];
+ float[] vl = new float[625];
+ int x = 0;
+ for (int c = 65; c < 90; c++)
+ {
+ for (int d = 65; d < 90; d++)
+ {
+ ca[x] = new int[]
+ { c, d };
+ vl[x] = (float) pairs[c][d];
+ x++;
+ }
+ }
+ jalview.util.QuickSort.sort(vl, ca);
+ int p = 0;
+
+ for (int c = 624; c > 0; c--)
+ {
+ if (vl[c] > 0)
+ {
+ tval = ((float) vl[c] * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+ : 0]);
+ mouseOver += ((p == 0) ? "" : "; ") + (char) ((int[]) ca[c])[0]
+ + (char) ((int[]) ca[c])[1] + " " + ((int) tval) + "%";
+ p++;
+
+ }
+ }
+
+ // }
+ }
+ else
+ {
+ mouseOver += ((int) value + "%");
+ }
+ consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ',
+ value);
+ }
+ }
+
+ /**
+ * get the sorted base-pair profile for the given position of the consensus
+ *
+ * @param hconsensus
+ * @return profile of the given column
+ */
+ public static int[] extractProfile(Hashtable hconsensus,
+ boolean ignoreGapsInConsensusCalculation)
+ {
+ int[] rtnval = new int[52]; // 2*(5*5)+2
+ int[][] profile = (int[][]) hconsensus.get(StructureFrequency.PROFILE);
+ int[][] pairs = (int[][]) hconsensus
+ .get(StructureFrequency.PAIRPROFILE);
+
+ if (profile == null)
+ return null;
+
+ // TODO fix the object length, also do it in completeConsensus
+ Object[] ca = new Object[625];
+ float[] vl = new float[625];
+ int x = 0;
+ for (int c = 65; c < 90; c++)
+ {
+ for (int d = 65; d < 90; d++)
+ {
+ ca[x] = new int[]
+ { c, d };
+ vl[x] = (float) pairs[c][d];
+ x++;
+ }
+ }
+ jalview.util.QuickSort.sort(vl, ca);
+
+ rtnval[0] = 2;
+ rtnval[1] = 0;
+ for (int c = 624; c > 0; c--)
+ {
+ if (vl[c] > 0)
+ {
+ rtnval[rtnval[0]++] = ((int[]) ca[c])[0];
+ rtnval[rtnval[0]++] = ((int[]) ca[c])[1];
+ rtnval[rtnval[0]] = (int) ((float) vl[c] * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+ : 0]);
+ rtnval[1]+=rtnval[rtnval[0]++];
+ }
+ }
+
+ return rtnval;
+ }
+
+ public static void main(String args[])
+ {
+ // Short test to see if checkBpType works
+ ArrayList<String> test = new ArrayList<String>();
+ test.add("A");
+ test.add("c");
+ test.add("g");
+ test.add("T");
+ test.add("U");
+ for (String i : test)
+ {
+ for (String j : test)
+ {
+ System.out.println(i + "-" + j + ": "
+ + StructureFrequency.checkBpType(i.charAt(0), j.charAt(0)));
+ }
+ }
+ }
+}
--- /dev/null
+package jalview.analysis;
+
+public class WUSSParseException extends Exception {
+ private long problemPos;
+ public WUSSParseException(long problemPos)
+ {
+ this("Invalid WUSS Notation", problemPos);
+ }
+ public WUSSParseException(String message, long problemPos)
+ {
+ super(message+" at or near position "+problemPos);
+ this.problemPos=problemPos;
+ }
+ public long getProblemPos()
+ {
+ return problemPos;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package jalview.api;
+
+import java.util.List;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+public interface AlignCalcManagerI
+{
+
+
+ /**
+ * tell manager that a worker is initialised and has started to run
+ * @param worker
+ */
+ void notifyStart(AlignCalcWorkerI worker);
+
+ /**
+ * check if a calculation of this type is already active
+ * @param worker
+ * @return
+ */
+ boolean alreadyDoing(AlignCalcWorkerI worker);
+
+ /**
+ * tell manager that worker is now processing data
+ * @param worker
+ */
+ boolean notifyWorking(AlignCalcWorkerI worker);
+
+
+ /**
+ * notify manager that the worker has completed, and results may be ready to collect
+ * @param worker
+ */
+ void workerComplete(AlignCalcWorkerI worker);
+
+ /**
+ * indicate that a worker like this cannot run on the platform and shouldn't be started again
+ * @param worker
+ */
+ void workerCannotRun(AlignCalcWorkerI worker);
+
+ /**
+ * indicate that a worker like this may be run on the platform.
+ * @param worker of class to be removed from the execution blacklist
+ */
+ void workerMayRun(AlignCalcWorkerI worker);
+ /**
+ * launch a new worker
+ * @param worker
+ */
+ void startWorker(AlignCalcWorkerI worker);
+
+ /**
+ *
+ * @param worker
+ * @return
+ */
+ boolean isWorking(AlignCalcWorkerI worker);
+
+ /**
+ * if any worker thread is operational, return true!
+ * @return
+ */
+ boolean isWorking();
+
+
+ /**
+ * register a restartable worker
+ * @param worker
+ */
+ void registerWorker(AlignCalcWorkerI worker);
+
+ /**
+ * restart any registered workers
+ */
+ void restartWorkers();
+
+ /**
+ *
+ * @param alignmentAnnotation
+ * @return true if a currently registered and working worker indicates its involvement with the given alignmentAnnotation
+ */
+ boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
+
+ /**
+ * kick any known instances of the given worker class to update their annotation
+ * @param workerClass
+ */
+ void updateAnnotationFor(Class workerClass);
+
+ /**
+ * return any registered workers of the given class
+ * @param workerClass
+ * @return null or one or more workers of the given class
+ */
+ List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
+ Class workerClass);
+
+ /**
+ * start any workers of the given class
+ * @param workerClass
+ * @return false if no workers of given class were registered
+ * (note - blacklisted classes cannot be restarted, so this method will return true for blacklisted workers)
+ */
+ boolean startRegisteredWorkersOfClass(Class workerClass);
+
+}
--- /dev/null
+package jalview.api;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+public interface AlignCalcWorkerI extends Runnable
+{
+
+ public boolean involves(AlignmentAnnotation annot);
+
+ public void updateAnnotation();
+}
--- /dev/null
+/**
+ *
+ */
+package jalview.api;
+
+import java.util.Hashtable;
+
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.RNAHelicesColour;
+
+/**
+ * @author jimp
+ *
+ */
+public interface AlignViewportI
+{
+
+ int getCharWidth();
+
+ int getEndRes();
+
+ int getCharHeight();
+
+ boolean hasHiddenColumns();
+
+ boolean isValidCharWidth();
+
+ boolean isShowConsensusHistogram();
+
+ boolean isShowSequenceLogo();
+
+ boolean isNormaliseSequenceLogo();
+
+ ColourSchemeI getGlobalColourScheme();
+
+ AlignmentI getAlignment();
+
+ ColumnSelection getColumnSelection();
+
+ Hashtable[] getSequenceConsensusHash();
+
+ Hashtable[] getRnaStructureConsensusHash();
+
+ boolean getIgnoreGapsConsensus();
+
+ boolean getCentreColumnLabels();
+
+ boolean isCalculationInProgress(AlignmentAnnotation alignmentAnnotation);
+
+ AlignmentAnnotation getAlignmentQualityAnnot();
+
+ AlignmentAnnotation getAlignmentConservationAnnotation();
+ /**
+ * get the container for alignment consensus annotation
+ * @return
+ */
+ AlignmentAnnotation getAlignmentConsensusAnnotation();
+
+ /**
+ * Test to see if viewport is still open and active
+ * @return true indicates that all references to viewport should be dropped
+ */
+ boolean isClosed();
+ /**
+ * get the associated calculation thread manager for the view
+ * @return
+ */
+ AlignCalcManagerI getCalcManager();
+
+ /**
+ * get the percentage gaps allowed in a conservation calculation
+ *
+ */
+ public int getConsPercGaps();
+
+ /**
+ * set the consensus result object for the viewport
+ * @param hconsensus
+ */
+ void setSequenceConsensusHash(Hashtable[] hconsensus);
+
+ /**
+ *
+ * @return the alignment annotatino row for the structure consensus calculation
+ */
+ AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
+
+ /**
+ * set the Rna structure consensus result object for the viewport
+ * @param hStrucConsensus
+ */
+ void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
+
+ /**
+ * set global colourscheme
+ * @param rhc
+ */
+ void setGlobalColourScheme(ColourSchemeI rhc);
+
+}
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
* @author JimP
*
*/
-public interface AlignmentViewPanel
+public interface AlignmentViewPanel extends OOMHandlerI
{
AlignmentI getAlignment();
StructureSelectionManager getStructureSelectionManager();
+ /**
+ * repaint the alignment view after a datamodel update.
+ * @param updateOverview - if true, the overview panel will also be updated and repainted
+ */
+
+ void paintAlignment(boolean updateOverview);
+ /**
+ * automatically adjust annotation panel height for new annotation
+ * whilst ensuring the alignment is still visible.
+ */
+ void adjustAnnotationHeight();
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+package jalview.api;
+
+public interface OOMHandlerI
+{
+
+ void raiseOOMWarning(String string, OutOfMemoryError error);
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
showColourText.setState(sg.getColourText());
showBoxes.setState(sg.getDisplayBoxes());
displayNonconserved.setState(sg.getShowNonconserved());
- if (!ap.av.alignment.getGroups().contains(sg))
+ if (!ap.av.getAlignment().getGroups().contains(sg))
{
groupMenu.remove(unGroupMenuItem);
}
remove(seqMenu);
}
- if (!ap.av.hasHiddenRows)
+ if (!ap.av.hasHiddenRows())
{
remove(revealAll);
remove(revealSeq);
} else {
- final int index = ap.av.alignment.findIndex(seq);
+ final int index = ap.av.getAlignment().findIndex(seq);
if (ap.av.adjustForHiddenSeqs(index)
- ap.av.adjustForHiddenSeqs(index - 1) > 1)
EditCommand editCommand = new EditCommand("Edit Sequences",
EditCommand.REPLACE, dialog.getName().replace(' ',
ap.av.getGapCharacter()),
- sg.getSequencesAsArray(ap.av.hiddenRepSequences),
- sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
+ sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
+ sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
ap.alignFrame.addHistoryItem(editCommand);
Vector regions = new Vector();
if (sg != null)
{
- int start = sg.getStartRes();
- int end = sg.getEndRes() + 1;
-
- do
- {
- if (ap.av.hasHiddenColumns)
- {
- if (start == 0)
- {
- start = ap.av.colSel.adjustForHiddenColumns(start);
- }
-
- end = ap.av.colSel.getHiddenBoundaryRight(start);
- if (start == end)
- {
- end = sg.getEndRes() + 1;
- }
- if (end > sg.getEndRes())
- {
- end = sg.getEndRes() + 1;
- }
- }
-
- regions.addElement(new int[]
- { start, end });
-
- if (ap.av.hasHiddenColumns)
- {
- start = ap.av.colSel.adjustForHiddenColumns(end);
- start = ap.av.colSel.getHiddenBoundaryLeft(start) + 1;
- }
- } while (end < sg.getEndRes());
-
- int[][] startEnd = new int[regions.size()][2];
- for (int i = 0; i < regions.size(); i++)
- {
- startEnd[i] = (int[]) regions.elementAt(i);
- }
+ int[][] startEnd = ap.av.getVisibleRegionBoundaries(sg.getStartRes(),
+ sg.getEndRes() + 1);
String description;
int caseChange;
}
ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
- sg.getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
+ sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), startEnd,
caseChange);
ap.alignFrame.addHistoryItem(caseCommand);
frame.add(cap);
jalview.bin.JalviewLite.addFrame(frame,
"Selection output - " + e.getActionCommand(), 600, 500);
+ // JBPNote: getSelectionAsNewSequence behaviour has changed - this method now returns a full copy of sequence data
+ // TODO consider using getSequenceSelection instead here
cap.setText(new jalview.io.AppletFormatAdapter().formatSequences(
e.getActionCommand(),
{
SequenceGroup sg = getGroup();
sg.cs = new ClustalxColourScheme(
- sg.getSequences(ap.av.hiddenRepSequences),
- ap.av.alignment.getWidth());
+ sg.getSequences(ap.av.getHiddenRepSequences()),
+ ap.av.getAlignment().getWidth());
refresh();
}
if (abovePIDColour.getState())
{
sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), 0,
- ap.av.alignment.getWidth()));
+ sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth()));
int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
.getName());
SequenceGroup sg = getGroup();
sg.cs = new PIDColourScheme();
sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), 0,
- ap.av.alignment.getWidth()));
+ sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth()));
refresh();
}
sg.cs = new Blosum62ColourScheme();
sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), 0,
- ap.av.alignment.getWidth()));
+ sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth()));
refresh();
}
if (conservationMenuItem.getState())
{
- Conservation c = new Conservation("Group",
+ sg.cs.setConservation(Conservation.calculateConservation("Group",
ResidueProperties.propHash, 3,
- sg.getSequences(ap.av.hiddenRepSequences), 0,
- ap.av.alignment.getWidth());
-
- c.calculate();
- c.verdict(false, ap.av.ConsPercGaps);
-
- sg.cs.setConservation(c);
-
+ sg.getSequences(ap.av.getHiddenRepSequences()), 0,
+ ap.av.getAlignment().getWidth(),
+ false, ap.av.getConsPercGaps(),false));
SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
SliderPanel.showConservationSlider();
}
// this method won't add a new group if it already exists
if (sg != null)
{
- ap.av.alignment.addGroup(sg);
+ ap.av.getAlignment().addGroup(sg);
}
return sg;
void unGroupMenuItem_actionPerformed()
{
SequenceGroup sg = ap.av.getSelectionGroup();
- ap.av.alignment.deleteGroup(sg);
+ ap.av.getAlignment().deleteGroup(sg);
ap.av.setSelectionGroup(null);
ap.paintAlignment(true);
}
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
viewport.updateConsensus(alignPanel);\r
\r
annotationPanelMenuItem.setState(viewport.showAnnotation);\r
- displayNonconservedMenuItem.setState(viewport.getShowunconserved());\r
+ displayNonconservedMenuItem.setState(viewport.getShowUnconserved());\r
followMouseOverFlag.setState(viewport.getFollowHighlight());\r
- showGroupConsensus.setState(viewport.showGroupConsensus);\r
- showGroupConservation.setState(viewport.showGroupConservation);\r
- showConsensusHistogram.setState(viewport.showConsensusHistogram);\r
- showSequenceLogo.setState(viewport.showSequenceLogo);\r
+ showGroupConsensus.setState(viewport.isShowGroupConsensus());\r
+ showGroupConservation.setState(viewport.isShowGroupConservation());\r
+ showConsensusHistogram.setState(viewport.isShowConsensusHistogram());\r
+ showSequenceLogo.setState(viewport.isShowSequenceLogo());\r
\r
seqLimits.setState(viewport.showJVSuffix);\r
\r
}\r
\r
}\r
-\r
+ if (viewport.getAlignment().isNucleotide())\r
+ {\r
+ viewport.updateStrucConsensus(alignPanel);\r
+ if (viewport.getAlignment().hasRNAStructure())\r
+ {\r
+ RNAHelixColour.setEnabled(true);\r
+ }\r
+ else {\r
+ RNAHelixColour.setEnabled(false);\r
+ }\r
+ } else {\r
+ RNAHelixColour.setEnabled(false);\r
+ purinePyrimidineColour.setEnabled(false);\r
+ }\r
// Some JVMS send keyevents to Top frame or lowest panel,\r
// Havent worked out why yet. So add to both this frame and seqCanvas for\r
// now\r
try\r
{\r
featuresFile = new jalview.io.FeaturesFile(file, type)\r
- .parse(viewport.alignment,\r
+ .parse(viewport.getAlignment(),\r
alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours,\r
featureLinks, true, viewport.applet.getDefaultParameter("relaxedidmatch", false));\r
} catch (Exception ex)\r
// Hide everything by the current selection - this is a hack - we do the\r
// invert and then hide\r
// first check that there will be visible columns after the invert.\r
- if ((viewport.colSel != null && viewport.colSel.getSelected() != null && viewport.colSel\r
+ if ((viewport.getColumnSelection() != null && viewport.getColumnSelection().getSelected() != null && viewport.getColumnSelection()\r
.getSelected().size() > 0)\r
|| (sg != null && sg.getSize() > 0 && sg.getStartRes() <= sg\r
.getEndRes()))\r
\r
if (toggleSeqs)\r
{\r
- if (sg != null && sg.getSize() != viewport.alignment.getHeight())\r
+ if (sg != null && sg.getSize() != viewport.getAlignment().getHeight())\r
{\r
hide = true;\r
viewport.hideAllSelectedSeqs();\r
}\r
- else if (!(toggleCols && viewport.colSel.getSelected().size() > 0))\r
+ else if (!(toggleCols && viewport.getColumnSelection().getSelected().size() > 0))\r
{\r
viewport.showAllHiddenSeqs();\r
}\r
\r
if (toggleCols)\r
{\r
- if (viewport.colSel.getSelected().size() > 0)\r
+ if (viewport.getColumnSelection().getSelected().size() > 0)\r
{\r
viewport.hideSelectedColumns();\r
if (!toggleSeqs)\r
{\r
- viewport.selectionGroup = sg;\r
+ viewport.setSelectionGroup(sg);\r
}\r
}\r
else if (!hide)\r
}\r
else if (evt.getSource() == autoCalculate)\r
{\r
- viewport.autocalculateConsensus = autoCalculate.getState();\r
+ viewport.autoCalculateConsensus = autoCalculate.getState();\r
}\r
else if (evt.getSource() == sortByTree)\r
{\r
else if (source == alProperties)\r
{\r
StringBuffer contents = new jalview.io.AlignmentProperties(\r
- viewport.alignment).formatAsString();\r
+ viewport.getAlignment()).formatAsString();\r
CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this);\r
cap.setText(contents.toString());\r
Frame frame = new Frame();\r
{\r
abovePIDThreshold.setState(false);\r
changeColour(new ClustalxColourScheme(\r
- viewport.alignment.getSequences(),\r
- viewport.alignment.getWidth()));\r
+ viewport.getAlignment().getSequences(),\r
+ viewport.getAlignment().getWidth()));\r
}\r
else if (source == zappoColour)\r
{\r
{\r
changeColour(new NucleotideColourScheme());\r
}\r
+ else if (source == purinePyrimidineColour)\r
+ {\r
+ changeColour(new PurinePyrimidineColourScheme());\r
+ }\r
+ else if (source == RNAHelixColour)\r
+ {\r
+ new RNAHelicesColourChooser(viewport, alignPanel);\r
+ }\r
else if (source == modifyPID)\r
{\r
modifyPID_actionPerformed();\r
public String outputAnnotations(boolean displayTextbox)\r
{\r
String annotation = new AnnotationFile().printAnnotations(\r
- viewport.showAnnotation ? viewport.alignment\r
- .getAlignmentAnnotation() : null, viewport.alignment\r
+ viewport.showAnnotation ? viewport.getAlignment()\r
+ .getAlignmentAnnotation() : null, viewport.getAlignment()\r
.getGroups(),\r
- ((Alignment) viewport.alignment).alignmentProperties);\r
+ ((Alignment) viewport.getAlignment()).alignmentProperties);\r
\r
if (displayTextbox)\r
{\r
if (format.equalsIgnoreCase("Jalview"))\r
{\r
features = new FeaturesFile().printJalviewFormat(\r
- viewport.alignment.getSequencesArray(),\r
+ viewport.getAlignment().getSequencesArray(),\r
getDisplayedFeatureCols());\r
}\r
else\r
{\r
features = new FeaturesFile().printGFFFormat(\r
- viewport.alignment.getSequencesArray(),\r
+ viewport.getAlignment().getSequencesArray(),\r
getDisplayedFeatureCols());\r
}\r
\r
viewport.historyList.push(command);\r
viewport.redoList.removeAllElements();\r
updateEditMenuBar();\r
- viewport.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
+ viewport.updateHiddenColumns();\r
}\r
}\r
\r
command.undoCommand(null);\r
\r
AlignViewport originalSource = getOriginatingSource(command);\r
-\r
- originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
+ // JBPNote Test\r
+ if (originalSource!=viewport) {\r
+ System.err.println("Warning: Viewport object mismatch whilst undoing");\r
+ }\r
+ originalSource.updateHiddenColumns(); // originalSource.hasHiddenColumns = viewport.getColumnSelection().getHiddenColumns() != null;\r
updateEditMenuBar();\r
originalSource.firePropertyChange("alignment", null,\r
- originalSource.alignment.getSequences());\r
+ originalSource.getAlignment().getSequences());\r
}\r
\r
/**\r
command.doCommand(null);\r
\r
AlignViewport originalSource = getOriginatingSource(command);\r
- originalSource.hasHiddenColumns = viewport.colSel.getHiddenColumns() != null;\r
+ // JBPNote Test\r
+ if (originalSource!=viewport) {\r
+ System.err.println("Warning: Viewport object mismatch whilst re-doing");\r
+ }\r
+ originalSource.updateHiddenColumns(); //sethasHiddenColumns(); = viewport.getColumnSelection().getHiddenColumns() != null;\r
\r
updateEditMenuBar();\r
originalSource.firePropertyChange("alignment", null,\r
- originalSource.alignment.getSequences());\r
+ originalSource.getAlignment().getSequences());\r
}\r
\r
AlignViewport getOriginatingSource(CommandI command)\r
{\r
if (comps.elementAt(i) instanceof AlignmentPanel)\r
{\r
- if (al == ((AlignmentPanel) comps.elementAt(i)).av.alignment)\r
+ if (al == ((AlignmentPanel) comps.elementAt(i)).av.getAlignment())\r
{\r
originalSource = ((AlignmentPanel) comps.elementAt(i)).av;\r
break;\r
// the current view against the closed view first\r
if (al != null)\r
{\r
- PaintRefresher.validateSequences(al, viewport.alignment);\r
+ PaintRefresher.validateSequences(al, viewport.getAlignment());\r
}\r
\r
originalSource = viewport;\r
\r
if (up)\r
{\r
- for (int i = 1; i < viewport.alignment.getHeight(); i++)\r
+ for (int i = 1; i < viewport.getAlignment().getHeight(); i++)\r
{\r
- SequenceI seq = viewport.alignment.getSequenceAt(i);\r
+ SequenceI seq = viewport.getAlignment().getSequenceAt(i);\r
if (!sg.getSequences(null).contains(seq))\r
{\r
continue;\r
}\r
\r
- SequenceI temp = viewport.alignment.getSequenceAt(i - 1);\r
+ SequenceI temp = viewport.getAlignment().getSequenceAt(i - 1);\r
if (sg.getSequences(null).contains(temp))\r
{\r
continue;\r
}\r
\r
- viewport.alignment.getSequences().setElementAt(temp, i);\r
- viewport.alignment.getSequences().setElementAt(seq, i - 1);\r
+ viewport.getAlignment().getSequences().setElementAt(temp, i);\r
+ viewport.getAlignment().getSequences().setElementAt(seq, i - 1);\r
}\r
}\r
else\r
{\r
- for (int i = viewport.alignment.getHeight() - 2; i > -1; i--)\r
+ for (int i = viewport.getAlignment().getHeight() - 2; i > -1; i--)\r
{\r
- SequenceI seq = viewport.alignment.getSequenceAt(i);\r
- if (!sg.getSequences(viewport.hiddenRepSequences).contains(seq))\r
+ SequenceI seq = viewport.getAlignment().getSequenceAt(i);\r
+ if (!sg.getSequences(viewport.getHiddenRepSequences()).contains(seq))\r
{\r
continue;\r
}\r
\r
- SequenceI temp = viewport.alignment.getSequenceAt(i + 1);\r
- if (sg.getSequences(viewport.hiddenRepSequences).contains(temp))\r
+ SequenceI temp = viewport.getAlignment().getSequenceAt(i + 1);\r
+ if (sg.getSequences(viewport.getHiddenRepSequences()).contains(temp))\r
{\r
continue;\r
}\r
\r
- viewport.alignment.getSequences().setElementAt(temp, i);\r
- viewport.alignment.getSequences().setElementAt(seq, i + 1);\r
+ viewport.getAlignment().getSequences().setElementAt(temp, i);\r
+ viewport.getAlignment().getSequences().setElementAt(seq, i + 1);\r
}\r
}\r
\r
Vector sg = new Vector();\r
if (viewport.cursorMode)\r
{\r
- sg.addElement(viewport.alignment\r
+ sg.addElement(viewport.getAlignment()\r
.getSequenceAt(alignPanel.seqPanel.seqCanvas.cursorY));\r
}\r
else if (viewport.getSelectionGroup() != null\r
- && viewport.getSelectionGroup().getSize() != viewport.alignment\r
+ && viewport.getSelectionGroup().getSize() != viewport.getAlignment()\r
.getHeight())\r
{\r
sg = viewport.getSelectionGroup().getSequences(\r
- viewport.hiddenRepSequences);\r
+ viewport.getHiddenRepSequences());\r
}\r
\r
if (sg.size() < 1)\r
\r
Vector invertGroup = new Vector();\r
\r
- for (int i = 0; i < viewport.alignment.getHeight(); i++)\r
+ for (int i = 0; i < viewport.getAlignment().getHeight(); i++)\r
{\r
- if (!sg.contains(viewport.alignment.getSequenceAt(i)))\r
- invertGroup.addElement(viewport.alignment.getSequenceAt(i));\r
+ if (!sg.contains(viewport.getAlignment().getSequenceAt(i)))\r
+ invertGroup.addElement(viewport.getAlignment().getSequenceAt(i));\r
}\r
\r
SequenceI[] seqs1 = new SequenceI[sg.size()];\r
for (int i = 0; i < sg.getSize(); i++)\r
{\r
SequenceI seq = sg.getSequenceAt(i);\r
- int index = viewport.alignment.findIndex(seq);\r
+ int index = viewport.getAlignment().findIndex(seq);\r
orderedSeqs.put(index + "", seq);\r
}\r
\r
int index = 0, startRes, endRes;\r
char ch;\r
\r
- if (viewport.hasHiddenColumns && viewport.getSelectionGroup() != null)\r
+ if (viewport.hasHiddenColumns() && viewport.getSelectionGroup() != null)\r
{\r
copiedHiddenColumns = new Vector();\r
int hiddenOffset = viewport.getSelectionGroup().getStartRes();\r
{\r
for (int i = 0; i < seqs.length; i++)\r
{\r
- viewport.alignment.addSequence(seqs[i]);\r
+ viewport.getAlignment().addSequence(seqs[i]);\r
}\r
\r
// !newAlignment\r
addHistoryItem(new EditCommand("Add sequences", EditCommand.PASTE,\r
- seqs, 0, viewport.alignment.getWidth(), viewport.alignment));\r
+ seqs, 0, viewport.getAlignment().getWidth(), viewport.getAlignment()));\r
\r
- viewport.setEndSeq(viewport.alignment.getHeight());\r
- viewport.alignment.getWidth();\r
+ viewport.setEndSeq(viewport.getAlignment().getHeight());\r
+ viewport.getAlignment().getWidth();\r
viewport.firePropertyChange("alignment", null,\r
- viewport.alignment.getSequences());\r
+ viewport.getAlignment().getSequences());\r
\r
}\r
\r
}\r
\r
// If the cut affects all sequences, remove highlighted columns\r
- if (sg.getSize() == viewport.alignment.getHeight())\r
+ if (sg.getSize() == viewport.getAlignment().getHeight())\r
{\r
viewport.getColumnSelection().removeElements(sg.getStartRes(),\r
sg.getEndRes() + 1);\r
*/\r
addHistoryItem(new EditCommand("Cut Sequences", EditCommand.CUT, cut,\r
sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,\r
- viewport.alignment));\r
+ viewport.getAlignment()));\r
\r
viewport.setSelectionGroup(null);\r
- viewport.alignment.deleteGroup(sg);\r
+ viewport.getAlignment().deleteGroup(sg);\r
\r
viewport.firePropertyChange("alignment", null, viewport.getAlignment()\r
.getSequences());\r
viewport.getSequenceSelection(),\r
viewport.getAlignmentView(true).getSequenceStrings(\r
viewport.getGapCharacter()),\r
- viewport.alignment.getGroups());\r
- viewport.alignment.deleteAllGroups();\r
+ viewport.getAlignment().getGroups());\r
+ viewport.getAlignment().deleteAllGroups();\r
viewport.sequenceColours = null;\r
viewport.setSelectionGroup(null);\r
// set view properties for each group\r
{\r
// gps[g].setShowunconserved(viewport.getShowUnconserved());\r
gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());\r
- viewport.alignment.addGroup(gps[g]);\r
+ viewport.getAlignment().addGroup(gps[g]);\r
Color col = new Color((int) (Math.random() * 255),\r
(int) (Math.random() * 255), (int) (Math.random() * 255));\r
col = col.brighter();\r
\r
protected void deleteGroups_actionPerformed()\r
{\r
- viewport.alignment.deleteAllGroups();\r
+ viewport.getAlignment().deleteAllGroups();\r
viewport.sequenceColours = null;\r
viewport.setSelectionGroup(null);\r
\r
{\r
sg.addSequence(viewport.getAlignment().getSequenceAt(i), false);\r
}\r
- sg.setEndRes(viewport.alignment.getWidth() - 1);\r
+ sg.setEndRes(viewport.getAlignment().getWidth() - 1);\r
viewport.setSelectionGroup(sg);\r
alignPanel.paintAlignment(true);\r
PaintRefresher.Refresh(alignPanel, viewport.getSequenceSetId());\r
if (viewport.getSelectionGroup() != null)\r
{\r
seqs = viewport.getSelectionGroup().getSequencesAsArray(\r
- viewport.hiddenRepSequences);\r
+ viewport.getHiddenRepSequences());\r
}\r
else\r
{\r
- seqs = viewport.alignment.getSequencesArray();\r
+ seqs = viewport.getAlignment().getSequencesArray();\r
}\r
\r
TrimRegionCommand trimRegion;\r
{\r
trimRegion = new TrimRegionCommand("Remove Left",\r
TrimRegionCommand.TRIM_LEFT, seqs, column,\r
- viewport.alignment, viewport.colSel,\r
- viewport.selectionGroup);\r
+ viewport.getAlignment(), viewport.getColumnSelection(),\r
+ viewport.getSelectionGroup());\r
viewport.setStartRes(0);\r
}\r
else\r
{\r
trimRegion = new TrimRegionCommand("Remove Right",\r
TrimRegionCommand.TRIM_RIGHT, seqs, column,\r
- viewport.alignment, viewport.colSel,\r
- viewport.selectionGroup);\r
+ viewport.getAlignment(), viewport.getColumnSelection(),\r
+ viewport.getSelectionGroup());\r
}\r
\r
statusBar.setText("Removed " + trimRegion.getSize() + " columns.");\r
\r
addHistoryItem(trimRegion);\r
\r
- Vector groups = viewport.alignment.getGroups();\r
+ Vector groups = viewport.getAlignment().getGroups();\r
\r
for (int i = 0; i < groups.size(); i++)\r
{\r
if ((trimLeft && !sg.adjustForRemoveLeft(column))\r
|| (!trimLeft && !sg.adjustForRemoveRight(column)))\r
{\r
- viewport.alignment.deleteGroup(sg);\r
+ viewport.getAlignment().deleteGroup(sg);\r
}\r
}\r
\r
\r
public void removeGappedColumnMenuItem_actionPerformed()\r
{\r
- int start = 0, end = viewport.alignment.getWidth() - 1;\r
+ int start = 0, end = viewport.getAlignment().getWidth() - 1;\r
\r
SequenceI[] seqs;\r
if (viewport.getSelectionGroup() != null)\r
{\r
seqs = viewport.getSelectionGroup().getSequencesAsArray(\r
- viewport.hiddenRepSequences);\r
+ viewport.getHiddenRepSequences());\r
start = viewport.getSelectionGroup().getStartRes();\r
end = viewport.getSelectionGroup().getEndRes();\r
}\r
else\r
{\r
- seqs = viewport.alignment.getSequencesArray();\r
+ seqs = viewport.getAlignment().getSequencesArray();\r
}\r
\r
RemoveGapColCommand removeGapCols = new RemoveGapColCommand(\r
- "Remove Gapped Columns", seqs, start, end, viewport.alignment);\r
+ "Remove Gapped Columns", seqs, start, end, viewport.getAlignment());\r
\r
addHistoryItem(removeGapCols);\r
\r
\r
// This is to maintain viewport position on first residue\r
// of first sequence\r
- SequenceI seq = viewport.alignment.getSequenceAt(0);\r
+ SequenceI seq = viewport.getAlignment().getSequenceAt(0);\r
int startRes = seq.findPosition(viewport.startRes);\r
// ShiftList shifts;\r
// viewport.getAlignment().removeGaps(shifts=new ShiftList());\r
\r
public void removeAllGapsMenuItem_actionPerformed()\r
{\r
- int start = 0, end = viewport.alignment.getWidth() - 1;\r
+ int start = 0, end = viewport.getAlignment().getWidth() - 1;\r
\r
SequenceI[] seqs;\r
if (viewport.getSelectionGroup() != null)\r
{\r
seqs = viewport.getSelectionGroup().getSequencesAsArray(\r
- viewport.hiddenRepSequences);\r
+ viewport.getHiddenRepSequences());\r
start = viewport.getSelectionGroup().getStartRes();\r
end = viewport.getSelectionGroup().getEndRes();\r
}\r
else\r
{\r
- seqs = viewport.alignment.getSequencesArray();\r
+ seqs = viewport.getAlignment().getSequencesArray();\r
}\r
\r
// This is to maintain viewport position on first residue\r
// of first sequence\r
- SequenceI seq = viewport.alignment.getSequenceAt(0);\r
+ SequenceI seq = viewport.getAlignment().getSequenceAt(0);\r
int startRes = seq.findPosition(viewport.startRes);\r
\r
addHistoryItem(new RemoveGapsCommand("Remove Gaps", seqs, start, end,\r
- viewport.alignment));\r
+ viewport.getAlignment()));\r
\r
viewport.setStartRes(seq.findIndex(startRes) - 1);\r
\r
public AlignFrame newView(String viewtitle)\r
{\r
AlignmentI newal;\r
- if (viewport.hasHiddenRows)\r
+ if (viewport.hasHiddenRows())\r
{\r
newal = new Alignment(viewport.getAlignment().getHiddenSequences()\r
.getFullAlignment().getSequencesArray());\r
}\r
else\r
{\r
- newal = new Alignment(viewport.alignment.getSequencesArray());\r
+ newal = new Alignment(viewport.getAlignment().getSequencesArray());\r
}\r
\r
- if (viewport.alignment.getAlignmentAnnotation() != null)\r
+ if (viewport.getAlignment().getAlignmentAnnotation() != null)\r
{\r
- for (int i = 0; i < viewport.alignment.getAlignmentAnnotation().length; i++)\r
+ for (int i = 0; i < viewport.getAlignment().getAlignmentAnnotation().length; i++)\r
{\r
- if (!viewport.alignment.getAlignmentAnnotation()[i].autoCalculated)\r
+ if (!viewport.getAlignment().getAlignmentAnnotation()[i].autoCalculated)\r
{\r
- newal.addAnnotation(viewport.alignment.getAlignmentAnnotation()[i]);\r
+ newal.addAnnotation(viewport.getAlignment().getAlignmentAnnotation()[i]);\r
}\r
}\r
}\r
\r
AlignFrame newaf = new AlignFrame(newal, viewport.applet, "", false);\r
\r
- newaf.viewport.sequenceSetID = alignPanel.av.getSequenceSetId();\r
+ newaf.viewport.setSequenceSetId(alignPanel.av.getSequenceSetId());\r
PaintRefresher.Register(alignPanel, alignPanel.av.getSequenceSetId());\r
PaintRefresher.Register(newaf.alignPanel,\r
newaf.alignPanel.av.getSequenceSetId());\r
if (viewport.getConservationSelected())\r
{\r
\r
- Alignment al = (Alignment) viewport.alignment;\r
+ Alignment al = (Alignment) viewport.getAlignment();\r
Conservation c = new Conservation("All",\r
ResidueProperties.propHash, 3, al.getSequences(), 0,\r
al.getWidth() - 1);\r
\r
c.calculate();\r
- c.verdict(false, viewport.ConsPercGaps);\r
+ c.verdict(false, viewport.getConsPercGaps());\r
\r
cs.setConservation(c);\r
\r
cs.setConservation(null);\r
}\r
\r
- cs.setConsensus(viewport.hconsensus);\r
+ cs.setConsensus(viewport.getSequenceConsensusHash());\r
\r
}\r
viewport.setGlobalColourScheme(cs);\r
\r
if (viewport.getColourAppliesToAllGroups())\r
{\r
- Vector groups = viewport.alignment.getGroups();\r
+ Vector groups = viewport.getAlignment().getGroups();\r
for (int i = 0; i < groups.size(); i++)\r
{\r
SequenceGroup sg = (SequenceGroup) groups.elementAt(i);\r
if (cs instanceof ClustalxColourScheme)\r
{\r
sg.cs = new ClustalxColourScheme(\r
- sg.getSequences(viewport.hiddenRepSequences),\r
+ sg.getSequences(viewport.getHiddenRepSequences()),\r
sg.getWidth());\r
}\r
else\r
{\r
sg.cs.setThreshold(threshold, viewport.getIgnoreGapsConsensus());\r
sg.cs.setConsensus(AAFrequency.calculate(\r
- sg.getSequences(viewport.hiddenRepSequences), 0,\r
+ sg.getSequences(viewport.getHiddenRepSequences()), 0,\r
sg.getWidth()));\r
}\r
else\r
{\r
Conservation c = new Conservation("Group",\r
ResidueProperties.propHash, 3,\r
- sg.getSequences(viewport.hiddenRepSequences), 0,\r
- viewport.alignment.getWidth() - 1);\r
+ sg.getSequences(viewport.getHiddenRepSequences()), 0,\r
+ viewport.getAlignment().getWidth() - 1);\r
c.calculate();\r
- c.verdict(false, viewport.ConsPercGaps);\r
+ c.verdict(false, viewport.getConsPercGaps());\r
sg.cs.setConservation(c);\r
}\r
else\r
protected void modifyPID_actionPerformed()\r
{\r
if (viewport.getAbovePIDThreshold()\r
- && viewport.globalColourScheme != null)\r
+ && viewport.getGlobalColourScheme() != null)\r
{\r
SliderPanel.setPIDSliderSource(alignPanel,\r
viewport.getGlobalColourScheme(), "Background");\r
protected void modifyConservation_actionPerformed()\r
{\r
if (viewport.getConservationSelected()\r
- && viewport.globalColourScheme != null)\r
+ && viewport.getGlobalColourScheme() != null)\r
{\r
SliderPanel.setConservationSlider(alignPanel,\r
- viewport.globalColourScheme, "Background");\r
+ viewport.getGlobalColourScheme(), "Background");\r
SliderPanel.showConservationSlider();\r
}\r
}\r
.getAlignment().getSequenceAt(0), null);\r
\r
addHistoryItem(new OrderCommand("Pairwise Sort", oldOrder,\r
- viewport.alignment));\r
+ viewport.getAlignment()));\r
alignPanel.paintAlignment(true);\r
}\r
\r
{\r
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();\r
AlignmentSorter.sortByID(viewport.getAlignment());\r
- addHistoryItem(new OrderCommand("ID Sort", oldOrder, viewport.alignment));\r
+ addHistoryItem(new OrderCommand("ID Sort", oldOrder, viewport.getAlignment()));\r
alignPanel.paintAlignment(true);\r
}\r
\r
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();\r
AlignmentSorter.sortByLength(viewport.getAlignment());\r
addHistoryItem(new OrderCommand("Length Sort", oldOrder,\r
- viewport.alignment));\r
+ viewport.getAlignment()));\r
alignPanel.paintAlignment(true);\r
}\r
\r
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();\r
AlignmentSorter.sortByGroup(viewport.getAlignment());\r
addHistoryItem(new OrderCommand("Group Sort", oldOrder,\r
- viewport.alignment));\r
+ viewport.getAlignment()));\r
alignPanel.paintAlignment(true);\r
\r
}\r
public void PCAMenuItem_actionPerformed()\r
{\r
// are the sequences aligned?\r
- if (!viewport.alignment.isAligned(false))\r
+ if (!viewport.getAlignment().isAligned(false))\r
{\r
SequenceI current;\r
int Width = viewport.getAlignment().getWidth();\r
void NewTreePanel(String type, String pwType, String title)\r
{\r
// are the sequences aligned?\r
- if (!viewport.alignment.isAligned(false))\r
+ if (!viewport.getAlignment().isAligned(false))\r
{\r
SequenceI current;\r
int Width = viewport.getAlignment().getWidth();\r
\r
if ((viewport.getSelectionGroup() != null && viewport\r
.getSelectionGroup().getSize() > 1)\r
- || (viewport.getSelectionGroup() == null && viewport.alignment\r
+ || (viewport.getSelectionGroup() == null && viewport.getAlignment()\r
.getHeight() > 1))\r
{\r
final TreePanel tp = new TreePanel(alignPanel, type, pwType);\r
// addHistoryItem(new HistoryItem("Sort", viewport.alignment,\r
// HistoryItem.SORT));\r
addHistoryItem(new OrderCommand("Order by " + title, oldOrder,\r
- viewport.alignment));\r
+ viewport.getAlignment()));\r
alignPanel.paintAlignment(true);\r
}\r
\r
AlignmentSorter.sortBy(viewport.getAlignment(), alorder);\r
if (undoname!=null)\r
{\r
- addHistoryItem(new OrderCommand(undoname, oldOrder, viewport.alignment));\r
+ addHistoryItem(new OrderCommand(undoname, oldOrder, viewport.getAlignment()));\r
}\r
alignPanel.paintAlignment(true);\r
return true;\r
\r
MenuItem buriedColour = new MenuItem();\r
\r
+ MenuItem purinePyrimidineColour = new MenuItem();\r
+ MenuItem RNAHelixColour = new MenuItem();\r
+ \r
MenuItem userDefinedColour = new MenuItem();\r
\r
MenuItem PIDColour = new MenuItem();\r
turnColour.addActionListener(this);\r
buriedColour.setLabel("Buried Index");\r
buriedColour.addActionListener(this);\r
+ purinePyrimidineColour.setLabel("Purine/Pyrimidine");\r
+ purinePyrimidineColour.addActionListener(this);\r
+ RNAHelixColour.setLabel("by RNA Helices");\r
+ RNAHelixColour.addActionListener(this);\r
userDefinedColour.setLabel("User Defined...");\r
userDefinedColour.addActionListener(this);\r
PIDColour.setLabel("Percentage Identity");\r
colourMenu.add(turnColour);\r
colourMenu.add(buriedColour);\r
colourMenu.add(nucleotideColour);\r
+ colourMenu.add(purinePyrimidineColour);\r
colourMenu.add(userDefinedColour);\r
colourMenu.addSeparator();\r
colourMenu.add(conservationMenuItem);\r
colourMenu.add(abovePIDThreshold);\r
colourMenu.add(modifyPID);\r
colourMenu.add(annotationColour);\r
+ colourMenu.add(RNAHelixColour);\r
calculateMenu.add(sort);\r
calculateMenu.add(calculate);\r
calculateMenu.addSeparator();\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import java.awt.*;
import jalview.analysis.*;
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignViewportI;
import jalview.bin.*;
import jalview.datamodel.*;
import jalview.schemes.*;
import jalview.structure.SelectionSource;
-import jalview.structure.StructureSelectionManager;
import jalview.structure.VamsasSource;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.workers.ConservationThread;
+import jalview.workers.ConsensusThread;
-public class AlignViewport implements SelectionSource, VamsasSource
+public class AlignViewport extends AlignmentViewport implements AlignViewportI, SelectionSource, VamsasSource
{
int startRes;
boolean showAnnotation = true;
- boolean showConservation = true;
-
- boolean showQuality = true;
-
- boolean showConsensus = true;
-
boolean upperCasebold = false;
boolean colourAppliesToAllGroups = true;
- ColourSchemeI globalColourScheme = null;
-
boolean conservationColourSelected = false;
boolean abovePIDThreshold = false;
- SequenceGroup selectionGroup;
-
int charHeight;
int charWidth;
boolean validCharWidth = true;
- AlignmentI alignment;
-
- ColumnSelection colSel = new ColumnSelection();
-
int threshold;
int increment;
// currently visible, in the correct order or rendering
public Hashtable featuresDisplayed;
- boolean hasHiddenColumns = false;
-
- boolean hasHiddenRows = false;
boolean showHiddenMarkers = true;
- public Hashtable[] hconsensus;
-
- AlignmentAnnotation consensus;
-
- AlignmentAnnotation conservation;
-
- AlignmentAnnotation quality;
-
- AlignmentAnnotation[] groupConsensus;
-
- AlignmentAnnotation[] groupConservation;
-
- boolean autocalculateConsensus = true;
-
- public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
-
- private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
- this);
-
- boolean ignoreGapsInConsensusCalculation = false;
-
public jalview.bin.JalviewLite applet;
Hashtable sequenceColours;
Stack historyList = new Stack();
Stack redoList = new Stack();
-
- String sequenceSetID;
-
- Hashtable hiddenRepSequences;
-
+
public void finalize() {
applet=null;
quality=null;
public AlignViewport(AlignmentI al, JalviewLite applet)
{
+ calculator = new jalview.workers.AlignCalcManager();
this.applet = applet;
setAlignment(al);
+ // we always pad gaps
+ this.setPadGaps(true);
this.startRes = 0;
this.endRes = al.getWidth() - 1;
this.startSeq = 0;
followSelection = followHighlight;
showSequenceLogo = applet.getDefaultParameter("showSequenceLogo", showSequenceLogo);
-
+
+ normaliseSequenceLogo = applet.getDefaultParameter("normaliseSequenceLogo", normaliseSequenceLogo);
+
showGroupConsensus = applet.getDefaultParameter("showGroupConsensus", showGroupConsensus);
showGroupConservation = applet.getDefaultParameter("showGroupConservation", showGroupConservation);
.getParameter("userDefinedColour"));
}
}
- if (hconsensus == null)
- {
- if (!alignment.isNucleotide())
- {
- conservation = new AlignmentAnnotation("Conservation",
- "Conservation of total alignment less than " + ConsPercGaps
- + "% gaps", new Annotation[1], 0f, 11f,
- AlignmentAnnotation.BAR_GRAPH);
- conservation.hasText = true;
- conservation.autoCalculated = true;
-
- if (showConservation)
- {
- alignment.addAnnotation(conservation);
- }
-
- if (showQuality)
- {
- quality = new AlignmentAnnotation("Quality",
- "Alignment Quality based on Blosum62 scores",
- new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
- quality.hasText = true;
- quality.autoCalculated = true;
-
- alignment.addAnnotation(quality);
- }
- }
-
- consensus = new AlignmentAnnotation("Consensus", "PID",
- new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- consensus.hasText = true;
- consensus.autoCalculated = true;
-
- if (showConsensus)
- {
- alignment.addAnnotation(consensus);
- }
- }
+ initAutoAnnotation();
}
return showSequenceFeatures;
}
- class ConservationThread extends Thread
- {
- AlignmentPanel ap;
-
- public ConservationThread(AlignmentPanel ap)
- {
- this.ap = ap;
- }
-
- public void run()
- {
- try
- {
- updatingConservation = true;
-
- while (UPDATING_CONSERVATION)
- {
- try
- {
- if (ap != null)
- {
- ap.paintAlignment(false);
- }
- Thread.sleep(200);
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- UPDATING_CONSERVATION = true;
-
- int alWidth = (alignment==null) ? -1 : alignment.getWidth();
- if (alWidth < 0)
- {
- updatingConservation = false;
- UPDATING_CONSERVATION = false;
- return;
- }
-
- Conservation cons = new jalview.analysis.Conservation("All",
- jalview.schemes.ResidueProperties.propHash, 3,
- alignment.getSequences(), 0, alWidth - 1);
-
- cons.calculate();
- cons.verdict(false, ConsPercGaps);
-
- if (quality != null)
- {
- cons.findQuality();
- }
-
- char[] sequence = cons.getConsSequence().getSequence();
- float minR;
- float minG;
- float minB;
- float maxR;
- float maxG;
- float maxB;
- minR = 0.3f;
- minG = 0.0f;
- minB = 0f;
- maxR = 1.0f - minR;
- maxG = 0.9f - minG;
- maxB = 0f - minB; // scalable range for colouring both Conservation and
- // Quality
-
- float min = 0f;
- float max = 11f;
- float qmin = 0f;
- float qmax = 0f;
-
- char c;
-
- conservation.annotations = new Annotation[alWidth];
-
- if (quality != null)
- {
- quality.graphMax = cons.qualityRange[1].floatValue();
- quality.annotations = new Annotation[alWidth];
- qmin = cons.qualityRange[0].floatValue();
- qmax = cons.qualityRange[1].floatValue();
- }
-
- for (int i = 0; i < alWidth; i++)
- {
- float value = 0;
-
- c = sequence[i];
-
- if (Character.isDigit(c))
- {
- value = (int) (c - '0');
- }
- else if (c == '*')
- {
- value = 11;
- }
- else if (c == '+')
- {
- value = 10;
- }
- // TODO - refactor to use a graduatedColorScheme to calculate the
- // histogram colors.
- float vprop = value - min;
- vprop /= max;
- conservation.annotations[i] = new Annotation(String.valueOf(c),
- String.valueOf(value), ' ', value, new Color(minR
- + (maxR * vprop), minG + (maxG * vprop), minB
- + (maxB * vprop)));
-
- // Quality calc
- if (quality != null)
- {
- value = ((Double) cons.quality.elementAt(i)).floatValue();
- vprop = value - qmin;
- vprop /= qmax;
- quality.annotations[i] = new Annotation(" ",
- String.valueOf(value), ' ', value, new Color(minR
- + (maxR * vprop), minG + (maxG * vprop), minB
- + (maxB * vprop)));
- }
- }
- } catch (OutOfMemoryError error)
- {
- System.out.println("Out of memory calculating conservation!!");
- conservation = null;
- quality = null;
- System.gc();
- }
-
- UPDATING_CONSERVATION = false;
- updatingConservation = false;
-
- if (ap != null)
- {
- ap.paintAlignment(true);
- }
-
- }
- }
-
- ConservationThread conservationThread;
-
- ConsensusThread consensusThread;
-
- boolean consUpdateNeeded = false;
-
- static boolean UPDATING_CONSENSUS = false;
-
- static boolean UPDATING_CONSERVATION = false;
-
- boolean updatingConsensus = false;
-
- boolean updatingConservation = false;
-
- /**
- * DOCUMENT ME!
- */
- public void updateConservation(final AlignmentPanel ap)
- {
- if (alignment.isNucleotide() || conservation == null)
- {
- return;
- }
-
- conservationThread = new ConservationThread(ap);
- conservationThread.start();
- }
-
- /**
- * DOCUMENT ME!
- */
- public void updateConsensus(final AlignmentPanel ap)
- {
- consensusThread = new ConsensusThread(ap);
- consensusThread.start();
- }
-
- class ConsensusThread extends Thread
- {
- AlignmentPanel ap;
-
- public ConsensusThread(AlignmentPanel ap)
- {
- this.ap = ap;
- }
-
- public void run()
- {
- updatingConsensus = true;
- while (UPDATING_CONSENSUS)
- {
- try
- {
- if (ap != null)
- {
- ap.paintAlignment(false);
- }
-
- Thread.sleep(200);
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- UPDATING_CONSENSUS = true;
-
- try
- {
- int aWidth = alignment==null ? -1 : alignment.getWidth();
- if (aWidth < 0)
- {
- UPDATING_CONSENSUS = false;
- updatingConsensus = false;
- return;
- }
-
- consensus.annotations = null;
- consensus.annotations = new Annotation[aWidth];
-
- hconsensus = new Hashtable[aWidth];
- AAFrequency.calculate(alignment.getSequencesArray(), 0,
- alignment.getWidth(), hconsensus, true); // always calculate the
- // full profile
- updateAnnotation(true);
- //AAFrequency.completeConsensus(consensus, hconsensus, 0, aWidth,
- // ignoreGapsInConsensusCalculation,
- // true);
-
- if (globalColourScheme != null)
- {
- globalColourScheme.setConsensus(hconsensus);
- }
-
- } catch (OutOfMemoryError error)
- {
- alignment.deleteAnnotation(consensus);
-
- consensus = null;
- hconsensus = null;
- System.out.println("Out of memory calculating consensus!!");
- System.gc();
- }
- UPDATING_CONSENSUS = false;
- updatingConsensus = false;
-
- if (ap != null)
- {
- ap.paintAlignment(true);
- }
- }
-
- /**
- * update the consensus annotation from the sequence profile data using
- * current visualization settings.
- */
- public void updateAnnotation()
- {
- updateAnnotation(false);
- }
-
- protected void updateAnnotation(boolean immediate)
- {
- // TODO: make calls thread-safe, so if another thread calls this method,
- // it will either return or wait until one calculation is finished.
- if (immediate
- || (!updatingConsensus && consensus != null && hconsensus != null))
- {
- AAFrequency.completeConsensus(consensus, hconsensus, 0,
- hconsensus.length, ignoreGapsInConsensusCalculation,
- showSequenceLogo);
- }
- }
- }
/**
* get the consensus sequence as displayed under the PID consensus annotation
return sq;
}
- public SequenceGroup getSelectionGroup()
- {
- return selectionGroup;
- }
-
- public void setSelectionGroup(SequenceGroup sg)
- {
- selectionGroup = sg;
- }
-
public boolean getConservationSelected()
{
return conservationColourSelected;
return startSeq;
}
- public void setGlobalColourScheme(ColourSchemeI cs)
- {
- globalColourScheme = cs;
- }
-
- public ColourSchemeI getGlobalColourScheme()
- {
- return globalColourScheme;
- }
-
public void setStartRes(int res)
{
this.startRes = res;
return increment;
}
- public void setHiddenColumns(ColumnSelection colsel)
- {
- this.colSel = colsel;
- if (colSel.getHiddenColumns() != null)
- {
- hasHiddenColumns = true;
- }
- }
-
- public ColumnSelection getColumnSelection()
- {
- return colSel;
- }
-
public void resetSeqLimits(int height)
{
setEndSeq(height / getCharHeight());
}
}
- /**
- * Property change listener for changes in alignment
- *
- * @param listener
- * DOCUMENT ME!
- */
- public void addPropertyChangeListener(
- java.beans.PropertyChangeListener listener)
- {
- changeSupport.addPropertyChangeListener(listener);
- }
- /**
- * DOCUMENT ME!
- *
- * @param listener
- * DOCUMENT ME!
- */
- public void removePropertyChangeListener(
- java.beans.PropertyChangeListener listener)
- {
- changeSupport.removePropertyChangeListener(listener);
- }
+
- /**
- * Property change listener for changes in alignment
- *
- * @param prop
- * DOCUMENT ME!
- * @param oldvalue
- * DOCUMENT ME!
- * @param newvalue
- * DOCUMENT ME!
- */
- public void firePropertyChange(String prop, Object oldvalue,
- Object newvalue)
- {
- changeSupport.firePropertyChange(prop, oldvalue, newvalue);
- }
-
- public boolean getIgnoreGapsConsensus()
- {
- return ignoreGapsInConsensusCalculation;
- }
-
- public void hideSelectedColumns()
- {
- if (colSel.size() < 1)
- {
- return;
- }
-
- colSel.hideSelectedColumns();
- setSelectionGroup(null);
-
- hasHiddenColumns = true;
- }
-
- public void invertColumnSelection()
- {
- for (int i = 0; i < alignment.getWidth(); i++)
- {
- if (colSel.contains(i))
- {
- colSel.removeElement(i);
- }
- else
- {
- if (!hasHiddenColumns || colSel.isVisible(i))
- {
- colSel.addElement(i);
- }
- }
- }
- }
-
- public void hideColumns(int start, int end)
- {
- if (start == end)
- {
- colSel.hideColumns(start);
- }
- else
- {
- colSel.hideColumns(start, end);
- }
-
- hasHiddenColumns = true;
- }
-
- public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)
- {
- int sSize = sg.getSize();
- if (sSize < 2)
- {
- return;
- }
-
- if (hiddenRepSequences == null)
- {
- hiddenRepSequences = new Hashtable();
- }
-
- hiddenRepSequences.put(repSequence, sg);
-
- // Hide all sequences except the repSequence
- SequenceI[] seqs = new SequenceI[sSize - 1];
- int index = 0;
- for (int i = 0; i < sSize; i++)
- {
- if (sg.getSequenceAt(i) != repSequence)
- {
- if (index == sSize - 1)
- {
- return;
- }
-
- seqs[index++] = sg.getSequenceAt(i);
- }
- }
-
- hideSequence(seqs);
-
- }
-
- public void hideAllSelectedSeqs()
- {
- if (selectionGroup == null || selectionGroup.getSize() < 1)
- {
- return;
- }
-
- SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
-
- hideSequence(seqs);
-
- setSelectionGroup(null);
- }
-
- public void hideSequence(SequenceI[] seq)
- {
- if (seq != null)
- {
- for (int i = 0; i < seq.length; i++)
- {
- alignment.getHiddenSequences().hideSequence(seq[i]);
- }
-
- hasHiddenRows = true;
- firePropertyChange("alignment", null, alignment.getSequences());
- }
- }
- public void showSequence(int index)
- {
- Vector tmp = alignment.getHiddenSequences().showSequence(index,
- hiddenRepSequences);
- if (tmp.size() > 0)
- {
- if (selectionGroup == null)
- {
- selectionGroup = new SequenceGroup();
- selectionGroup.setEndRes(alignment.getWidth() - 1);
- }
-
- for (int t = 0; t < tmp.size(); t++)
- {
- selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
- }
- firePropertyChange("alignment", null, alignment.getSequences());
- sendSelection();
- }
-
- if (alignment.getHiddenSequences().getSize() < 1)
- {
- hasHiddenRows = false;
- }
- }
- public void showColumn(int col)
- {
- colSel.revealHiddenColumns(col);
- if (colSel.getHiddenColumns() == null)
- {
- hasHiddenColumns = false;
- }
- }
-
- public void showAllHiddenColumns()
- {
- colSel.revealAllHiddenColumns();
- hasHiddenColumns = false;
- }
-
- public void showAllHiddenSeqs()
- {
- if (alignment.getHiddenSequences().getSize() > 0)
- {
- if (selectionGroup == null)
- {
- selectionGroup = new SequenceGroup();
- selectionGroup.setEndRes(alignment.getWidth() - 1);
- }
- Vector tmp = alignment.getHiddenSequences().showAll(
- hiddenRepSequences);
- for (int t = 0; t < tmp.size(); t++)
- {
- selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
- }
- firePropertyChange("alignment", null, alignment.getSequences());
- hasHiddenRows = false;
- hiddenRepSequences = null;
- sendSelection();
- }
- }
-
- public int adjustForHiddenSeqs(int alignmentIndex)
- {
- return alignment.getHiddenSequences().adjustForHiddenSeqs(
- alignmentIndex);
- }
-
- /**
- * This method returns the a new SequenceI [] with the selection sequence and
- * start and end points adjusted
- *
- * @return String[]
- */
- public SequenceI[] getSelectionAsNewSequence()
- {
- SequenceI[] sequences;
-
- if (selectionGroup == null)
- {
- sequences = alignment.getSequencesArray();
- }
- else
- {
- sequences = selectionGroup.getSelectionAsNewSequences(alignment);
- }
-
- return sequences;
- }
-
- /**
- * get the currently selected sequence objects or all the sequences in the
- * alignment.
- *
- * @return array of references to sequence objects
- */
- public SequenceI[] getSequenceSelection()
- {
- SequenceI[] sequences = null;
- if (selectionGroup != null)
- {
- sequences = selectionGroup.getSequencesInOrder(alignment);
- }
- if (sequences == null)
- {
- sequences = alignment.getSequencesArray();
- }
- return sequences;
- }
-
- /**
- * This method returns the visible alignment as text, as seen on the GUI, ie
- * if columns are hidden they will not be returned in the result. Use this for
- * calculating trees, PCA, redundancy etc on views which contain hidden
- * columns.
- *
- * @return String[]
- */
- public jalview.datamodel.CigarArray getViewAsCigars(
- boolean selectedRegionOnly)
- {
- return new jalview.datamodel.CigarArray(alignment, (hasHiddenColumns ? colSel : null), (selectedRegionOnly ? selectionGroup : null));
- }
-
- /**
- * return a compact representation of the current alignment selection to pass
- * to an analysis function
- *
- * @param selectedOnly
- * boolean true to just return the selected view
- * @return AlignmentView
- */
- jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly)
- {
- return getAlignmentView(selectedOnly, false);
- }
-
- /**
- * return a compact representation of the current alignment selection to pass
- * to an analysis function
- *
- * @param selectedOnly
- * boolean true to just return the selected view
- * @param markGroups
- * boolean true to annotate the alignment view with groups on the alignment (and intersecting with selected region if selectedOnly is true)
- * @return AlignmentView
- */
- public jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups)
- {
- return new AlignmentView(alignment, colSel, selectionGroup, hasHiddenColumns, selectedOnly, markGroups);
- }
- /**
- * This method returns the visible alignment as text, as seen on the GUI, ie
- * if columns are hidden they will not be returned in the result. Use this for
- * calculating trees, PCA, redundancy etc on views which contain hidden
- * columns.
- *
- * @return String[]
- */
- public String[] getViewAsString(boolean selectedRegionOnly)
- {
- String[] selection = null;
- SequenceI[] seqs = null;
- int i, iSize;
- int start = 0, end = 0;
- if (selectedRegionOnly && selectionGroup != null)
- {
- iSize = selectionGroup.getSize();
- seqs = selectionGroup.getSequencesInOrder(alignment);
- start = selectionGroup.getStartRes();
- end = selectionGroup.getEndRes() + 1;
- }
- else
- {
- iSize = alignment.getHeight();
- seqs = alignment.getSequencesArray();
- end = alignment.getWidth();
- }
-
- selection = new String[iSize];
-
- for (i = 0; i < iSize; i++)
- {
- if (hasHiddenColumns)
- {
- StringBuffer visibleSeq = new StringBuffer();
- Vector regions = colSel.getHiddenColumns();
-
- int blockStart = start, blockEnd = end;
- int[] region;
- int hideStart, hideEnd;
-
- for (int j = 0; j < regions.size(); j++)
- {
- region = (int[]) regions.elementAt(j);
- hideStart = region[0];
- hideEnd = region[1];
-
- if (hideStart < start)
- {
- continue;
- }
-
- blockStart = Math.min(blockStart, hideEnd + 1);
- blockEnd = Math.min(blockEnd, hideStart);
-
- if (blockStart > blockEnd)
- {
- break;
- }
-
- visibleSeq.append(seqs[i].getSequence(blockStart, blockEnd));
-
- blockStart = hideEnd + 1;
- blockEnd = end;
- }
-
- if (end > blockStart)
- {
- visibleSeq.append(seqs[i].getSequence(blockStart, end));
- }
-
- selection[i] = visibleSeq.toString();
- }
- else
- {
- selection[i] = seqs[i].getSequenceAsString(start, end);
- }
- }
-
- return selection;
- }
public boolean getShowHiddenMarkers()
{
}
}
- public String getSequenceSetId()
- {
- if (sequenceSetID == null)
- {
- sequenceSetID = alignment.hashCode() + "";
- }
-
- return sequenceSetID;
- }
- /**
- * unique viewId for synchronizing state (e.g. with stored Jalview Project)
- *
- */
- private String viewId = null;
-
- public String getViewId()
- {
- if (viewId == null)
- {
- viewId = this.getSequenceSetId() + "." + this.hashCode() + "";
- }
- return viewId;
- }
-
- public void alignmentChanged(AlignmentPanel ap)
- {
- alignment.padGaps();
-
- if (hconsensus != null && autocalculateConsensus)
- {
- updateConsensus(ap);
- updateConservation(ap);
- }
-
- // Reset endRes of groups if beyond alignment width
- int alWidth = alignment.getWidth();
- Vector groups = alignment.getGroups();
- if (groups != null)
- {
- for (int i = 0; i < groups.size(); i++)
- {
- SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
- if (sg.getEndRes() > alWidth)
- {
- sg.setEndRes(alWidth - 1);
- }
- }
- }
-
- if (selectionGroup != null && selectionGroup.getEndRes() > alWidth)
- {
- selectionGroup.setEndRes(alWidth - 1);
- }
-
- resetAllColourSchemes();
-
- // AW alignment.adjustSequenceAnnotations();
- }
-
- void resetAllColourSchemes()
- {
- ColourSchemeI cs = globalColourScheme;
- if (cs != null)
- {
- if (cs instanceof ClustalxColourScheme)
- {
- ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
- alignment.getWidth());
- }
-
- cs.setConsensus(hconsensus);
- if (cs.conservationApplied())
- {
- Alignment al = (Alignment) alignment;
- Conservation c = new Conservation("All",
- ResidueProperties.propHash, 3, al.getSequences(), 0,
- al.getWidth() - 1);
- c.calculate();
- c.verdict(false, ConsPercGaps);
-
- cs.setConservation(c);
- }
- }
-
- int s, sSize = alignment.getGroups().size();
- for (s = 0; s < sSize; s++)
- {
- SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
- if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
- {
- ((ClustalxColourScheme) sg.cs).resetClustalX(
- sg.getSequences(hiddenRepSequences), sg.getWidth());
- }
- sg.recalcConservation();
- }
- }
-
boolean centreColumnLabels;
public boolean getCentreColumnLabels()
SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
if (sg.idColour != null)
{
- Vector sqs = sg.getSequences(hiddenRepSequences);
+ Vector sqs = sg.getSequences(getHiddenRepSequences());
for (int s = 0, sSize = sqs.size(); s < sSize; s++)
{
this.setSequenceColour((SequenceI) sqs.elementAt(s), sg.idColour);
{
return followSelection;
}
-
- private long sgrouphash = -1, colselhash = -1;
-
- /**
- * checks current SelectionGroup against record of last hash value, and
- * updates record.
- *
- * @return true if SelectionGroup changed since last call
- */
- boolean isSelectionGroupChanged()
- {
- int hc = (selectionGroup == null) ? -1 : selectionGroup.hashCode();
- if (hc != sgrouphash)
- {
- sgrouphash = hc;
- return true;
- }
- return false;
- }
-
- /**
- * checks current colsel against record of last hash value, and updates
- * record.
- *
- * @return true if colsel changed since last call
- */
- boolean isColSelChanged()
- {
- int hc = (colSel == null) ? -1 : colSel.hashCode();
- if (hc != colselhash)
- {
- colselhash = hc;
- return true;
- }
- return false;
- }
public void sendSelection()
{
jalview.structure.StructureSelectionManager
/**
- * show non-conserved residues only
- */
- public boolean showUnconserved = false;
-
- /**
- * when set, alignment should be reordered according to a newly opened tree
- */
- public boolean sortByTree = false;
-
- /**
- * @return the showUnconserved
- */
- public boolean getShowunconserved()
- {
- return showUnconserved;
- }
-
- /**
- * @param showNonconserved
- * the showUnconserved to set
- */
- public void setShowunconserved(boolean displayNonconserved)
- {
- this.showUnconserved = displayNonconserved;
- }
-
- /**
- * should conservation rows be shown for groups
- */
- boolean showGroupConservation = false;
-
- /**
- * should consensus rows be shown for groups
- */
- boolean showGroupConsensus = false;
-
- /**
- * should consensus profile be rendered by default
- */
- public boolean showSequenceLogo = false;
-
- /**
- * should consensus histograms be rendered by default
- */
- public boolean showConsensusHistogram = true;
-
- /**
- * @return the showConsensusProfile
- */
- public boolean isShowSequenceLogo()
- {
- return showSequenceLogo;
- }
-
- /**
- * @param showSequenceLogo
- * the new value
- */
- public void setShowSequenceLogo(boolean showSequenceLogo)
- {
- if (showSequenceLogo != this.showSequenceLogo)
- {
- // TODO: decouple settings setting from calculation when refactoring
- // annotation update method from alignframe to viewport
- this.showSequenceLogo = showSequenceLogo;
- if (consensusThread != null)
- {
- consensusThread.updateAnnotation();
- }
- }
- this.showSequenceLogo = showSequenceLogo;
- }
-
- /**
- * @param showConsensusHistogram
- * the showConsensusHistogram to set
- */
- public void setShowConsensusHistogram(boolean showConsensusHistogram)
- {
- this.showConsensusHistogram = showConsensusHistogram;
- }
-
- /**
- * @return the showGroupConservation
- */
- public boolean isShowGroupConservation()
- {
- return showGroupConservation;
- }
-
- /**
- * @param showGroupConservation
- * the showGroupConservation to set
- */
- public void setShowGroupConservation(boolean showGroupConservation)
- {
- this.showGroupConservation = showGroupConservation;
- }
-
- /**
- * @return the showGroupConsensus
- */
- public boolean isShowGroupConsensus()
- {
- return showGroupConsensus;
- }
-
- /**
- * @param showGroupConsensus
- * the showGroupConsensus to set
- */
- public void setShowGroupConsensus(boolean showGroupConsensus)
- {
- this.showGroupConsensus = showGroupConsensus;
- }
-
- /**
- *
- * @return flag to indicate if the consensus histogram should be rendered by
- * default
- */
- public boolean isShowConsensusHistogram()
- {
- return this.showConsensusHistogram;
- }
-
- /**
* synthesize a column selection if none exists so it covers the given
* selection group. if wholewidth is false, no column selection is made if the
* selection group covers the whole alignment width.
}
}
}
+
+ @Override
+ public boolean hasHiddenColumns()
+ {
+ return hasHiddenColumns;
+ }
+
+ public boolean isNormaliseSequenceLogo()
+ {
+ return normaliseSequenceLogo;
+ }
+
+ public void setNormaliseSequenceLogo(boolean state)
+ {
+ normaliseSequenceLogo = state;
+ }
+
+ /**
+ *
+ * @return true if alignment characters should be displayed
+ */
+ public boolean isValidCharWidth()
+ {
+ return validCharWidth;
+ }
+
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
// do we need to scroll the panel?
if (results != null && results.getSize() > 0)
{
- int seqIndex = av.alignment.findIndex(results);
+ AlignmentI alignment=av.getAlignment();
+ int seqIndex = alignment.findIndex(results);
if (seqIndex == -1)
{
return false;
}
- SequenceI seq = av.alignment.getSequenceAt(seqIndex);
- int[] r = results.getResults(seq, 0,av.alignment.getWidth());
+ SequenceI seq = alignment.getSequenceAt(seqIndex);
+ int[] r = results.getResults(seq, 0,alignment.getWidth());
if (r == null)
{
if (av.applet.debug) {// DEBUG
int startv, endv, starts, ends, width;
int start=-1;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
start = av.getColumnSelection().findColumnPosition(ostart);
end = av.getColumnSelection().findColumnPosition(end);
if (start == end)
{
- if (!scrollToNearest && !av.colSel.isVisible(ostart))
+ if (!scrollToNearest && !av.getColumnSelection().isVisible(ostart))
{
// don't scroll - position isn't visible
return false;
|| (av.getEndRes() < start)
|| ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
{
- if (start > av.alignment.getWidth() - hextent)
+ if (start > av.getAlignment().getWidth() - hextent)
{
- start = av.alignment.getWidth() - hextent;
+ start = av.getAlignment().getWidth() - hextent;
if (start < 0)
{
start = 0;
}
}
- if (seqIndex > av.alignment.getHeight() - vextent)
+ if (seqIndex > av.getAlignment().getHeight() - vextent)
{
- seqIndex = av.alignment.getHeight() - vextent;
+ seqIndex = av.getAlignment().getHeight() - vextent;
if (seqIndex < 0)
{
seqIndex = 0;
public void setScrollValues(int x, int y)
{
- int width = av.alignment.getWidth();
- int height = av.alignment.getHeight();
+ int width = av.getAlignment().getWidth();
+ int height = av.getAlignment().getHeight();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
width = av.getColumnSelection().findColumnPosition(width);
}
av.setStartSeq(y);
int endSeq = y + vextent;
- if (endSeq > av.alignment.getHeight())
+ if (endSeq > av.getAlignment().getHeight())
{
- endSeq = av.alignment.getHeight();
+ endSeq = av.getAlignment().getHeight();
}
av.setEndSeq(endSeq);
if (av.getWrapAlignment())
{
- int maxwidth = av.alignment.getWidth();
+ int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
// remove old automatic annotation
// add any new annotation
- Vector gr = av.alignment.getGroups(); // OrderedBy(av.alignment.getSequencesArray());
+ Vector gr = av.getAlignment().getGroups(); // OrderedBy(av.alignment.getSequencesArray());
// intersect alignment annotation with alignment groups
- AlignmentAnnotation[] aan = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aan = av.getAlignment().getAlignmentAnnotation();
Hashtable oldrfs = new Hashtable();
if (aan != null)
{
if (aan[an].autoCalculated && aan[an].groupRef != null)
{
oldrfs.put(aan[an].groupRef, aan[an].groupRef);
- av.alignment.deleteAnnotation(aan[an]);
+ av.getAlignment().deleteAnnotation(aan[an]);
aan[an] = null;
}
}
if (conv)
{
updateCalcs = true;
- av.alignment.addAnnotation(sg.getConservationRow(), 0);
+ av.getAlignment().addAnnotation(sg.getConservationRow(), 0);
}
if (cons)
{
updateCalcs = true;
- av.alignment.addAnnotation(sg.getConsensus(), 0);
+ av.getAlignment().addAnnotation(sg.getConsensus(), 0);
}
// refresh the annotation rows
if (updateCalcs)
@Override
public AlignmentI getAlignment()
{
- return av.alignment;
+ return av.getAlignment();
}
@Override
public StructureSelectionManager getStructureSelectionManager()
{
return StructureSelectionManager.getStructureSelectionManager(av.applet);
}
+ @Override
+ public void raiseOOMWarning(String string, OutOfMemoryError error)
+ {
+ // TODO: JAL-960
+ System.err.println("Out of memory whilst '"+string+"'");
+ error.printStackTrace();
+ }
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
}
oldcs = av.getGlobalColourScheme();
- if (av.alignment.getGroups() != null)
+ if (av.getAlignment().getGroups() != null)
{
oldgroupColours = new Hashtable();
- Vector allGroups = ap.av.alignment.getGroups();
+ Vector allGroups = ap.av.getAlignment().getGroups();
SequenceGroup sg;
for (int g = 0; g < allGroups.size(); g++)
{
slider.addAdjustmentListener(this);
slider.addMouseListener(this);
- if (av.alignment.getAlignmentAnnotation() == null)
+ if (av.getAlignment().getAlignmentAnnotation() == null)
{
return;
}
Vector list = new Vector();
int index = 1;
- for (int i = 0; i < av.alignment.getAlignmentAnnotation().length; i++)
+ for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
{
- String label = av.alignment.getAlignmentAnnotation()[i].label;
+ String label = av.getAlignment().getAlignmentAnnotation()[i].label;
if (!list.contains(label))
list.addElement(label);
else
return;
}
- currentAnnotation = av.alignment.getAlignmentAnnotation()[annotations
+ currentAnnotation = av.getAlignment().getAlignmentAnnotation()[annotations
.getSelectedIndex()];
int aboveThreshold = -1;
av.setGlobalColourScheme(acg);
- if (av.alignment.getGroups() != null)
+ if (av.getAlignment().getGroups() != null)
{
- Vector allGroups = ap.av.alignment.getGroups();
+ Vector allGroups = ap.av.getAlignment().getGroups();
SequenceGroup sg;
for (int g = 0; g < allGroups.size(); g++)
{
void reset()
{
av.setGlobalColourScheme(oldcs);
- if (av.alignment.getGroups() != null)
+ if (av.getAlignment().getGroups() != null)
{
- Vector allGroups = ap.av.alignment.getGroups();
+ Vector allGroups = ap.av.getAlignment().getGroups();
SequenceGroup sg;
for (int g = 0; g < allGroups.size(); g++)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
int getSelectedRow(int y)
{
int row = -2;
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
public void actionPerformed(ActionEvent evt)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (evt.getActionCommand().equals(ADDNEW))
{
AlignmentAnnotation newAnnotation = new AlignmentAnnotation("", null,
- new Annotation[ap.av.alignment.getWidth()]);
+ new Annotation[ap.av.getAlignment().getWidth()]);
if (!editLabelDescription(newAnnotation))
{
return;
}
- ap.av.alignment.addAnnotation(newAnnotation);
- ap.av.alignment.setAnnotationIndex(newAnnotation, 0);
+ ap.av.getAlignment().addAnnotation(newAnnotation);
+ ap.av.getAlignment().setAnnotationIndex(newAnnotation, 0);
}
else if (evt.getActionCommand().equals(EDITNAME))
{
if (row > -1)
{
- ParseHtmlBodyAndLinks phb = new ParseHtmlBodyAndLinks(av.alignment.getAlignmentAnnotation()[row].getDescription(true), true, "\n");
+ ParseHtmlBodyAndLinks phb = new ParseHtmlBodyAndLinks(av.getAlignment().getAlignmentAnnotation()[row].getDescription(true), true, "\n");
if (tooltip == null)
{
tooltip = new Tooltip(phb.getNonHtmlContent(), this);
if (start>-1 && start != end)
{
// Swap these annotations
- AlignmentAnnotation startAA = ap.av.alignment
+ AlignmentAnnotation startAA = ap.av.getAlignment()
.getAlignmentAnnotation()[start];
if (end == -1)
{
- end = ap.av.alignment.getAlignmentAnnotation().length - 1;
+ end = ap.av.getAlignment().getAlignmentAnnotation().length - 1;
}
- AlignmentAnnotation endAA = ap.av.alignment
+ AlignmentAnnotation endAA = ap.av.getAlignment()
.getAlignmentAnnotation()[end];
- ap.av.alignment.getAlignmentAnnotation()[end] = startAA;
- ap.av.alignment.getAlignmentAnnotation()[start] = endAA;
+ ap.av.getAlignment().getAlignmentAnnotation()[end] = startAA;
+ ap.av.getAlignment().getAlignmentAnnotation()[start] = endAA;
}
}
resizePanel = false;
// todo: move below to mouseClicked ?
selectedRow = getSelectedRow(evt.getY() + scrollOffset);
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
// DETECT RIGHT MOUSE BUTTON IN AWT
if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
jalview.appletgui.AlignFrame.copiedSequences.append(sq.getName() + "\t"
+ sq.getStart() + "\t" + sq.getEnd() + "\t"
+ sq.getSequenceAsString() + "\n");
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
jalview.appletgui.AlignFrame.copiedHiddenColumns = new Vector();
for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++)
g.translate(0, -scrollOffset);
g.setColor(Color.black);
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
int y = 0, fy = g.getFont().getSize();
int x = 0, offset;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import jalview.analysis.AAFrequency;
import jalview.datamodel.*;
+import jalview.renderer.AnnotationRenderer;
+import jalview.renderer.AwtRenderPanelI;
import jalview.schemes.ColourSchemeI;
-public class AnnotationPanel extends Panel implements AdjustmentListener,
+public class AnnotationPanel extends Panel implements AwtRenderPanelI, AdjustmentListener,
ActionListener, MouseListener, MouseMotionListener
{
AlignViewport av;
Vector activeRes;
- static String HELIX = "Helix";
+ final String HELIX = "Helix";
- static String SHEET = "Sheet";
+ final String SHEET = "Sheet";
+
+ /**
+ * For RNA secondary structure "stems" aka helices
+ */
+ final String STEM = "RNA Helix";
- static String LABEL = "Label";
+ final String LABEL = "Label";
- static String REMOVE = "Remove Annotation";
+ final String REMOVE = "Remove Annotation";
- static String COLOUR = "Colour";
+ final String COLOUR = "Colour";
- static Color HELIX_COLOUR = Color.red.darker();
+ final Color HELIX_COLOUR = Color.red.darker();
- static Color SHEET_COLOUR = Color.green.darker().darker();
+ final Color SHEET_COLOUR = Color.green.darker().darker();
Image image;
boolean MAC = false;
+ public final AnnotationRenderer renderer;
+
public AnnotationPanel(AlignmentPanel ap)
{
MAC = new jalview.util.Platform().isAMac();
addMouseListener(this);
// ap.annotationScroller.getVAdjustable().addAdjustmentListener( this );
+ renderer = new AnnotationRenderer();
}
public AnnotationPanel(AlignViewport av)
{
this.av = av;
+ renderer = new AnnotationRenderer();
}
public void adjustmentValueChanged(AdjustmentEvent evt)
*/
public void actionPerformed(ActionEvent evt)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
return;
}
String label = "";
- if (av.colSel != null && av.colSel.size() > 0
- && anot[av.colSel.getMin()] != null)
+ if (av.getColumnSelection() != null && av.getColumnSelection().size() > 0
+ && anot[av.getColumnSelection().getMin()] != null)
label = anot[av.getColumnSelection().getMin()].displayCharacter;
if (evt.getActionCommand().equals(REMOVE))
{
int index = av.getColumnSelection().columnAt(i);
- if (!av.colSel.isVisible(index))
+ if (!av.getColumnSelection().isVisible(index))
continue;
if (anot[index] == null)
{
int index = av.getColumnSelection().columnAt(i);
- if (!av.colSel.isVisible(index))
+ if (!av.getColumnSelection().isVisible(index))
continue;
if (anot[index] == null)
symbol = "\u03B2";
}
+ // Added by LML to color stems
+ else if (evt.getActionCommand().equals(STEM))
+ {
+ type = 'S';
+ symbol = "\u03C3";
+ }
+
if (!aa[activeRow].hasIcons)
{
aa[activeRow].hasIcons = true;
{
int index = av.getColumnSelection().columnAt(i);
- if (!av.colSel.isVisible(index))
+ if (!av.getColumnSelection().isVisible(index))
continue;
if (anot[index] == null)
}
}
+ aa[activeRow].validateRangeAndDisplay();
+
adjustPanelHeight();
repaint();
public void mousePressed(MouseEvent evt)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
return;
}
PopupMenu pop = new PopupMenu("Structure type");
- MenuItem item = new MenuItem(HELIX);
- item.addActionListener(this);
- pop.add(item);
- item = new MenuItem(SHEET);
- item.addActionListener(this);
- pop.add(item);
+ MenuItem item;
+ /*
+ * Just display the needed structure options
+ */
+ if (av.getAlignment().isNucleotide() == true)
+ {
+ item = new MenuItem(STEM);
+ item.addActionListener(this);
+ pop.add(item);
+ } else {
+ item = new MenuItem(HELIX);
+ item.addActionListener(this);
+ pop.add(item);
+ item = new MenuItem(SHEET);
+ item.addActionListener(this);
+ pop.add(item);
+ }
item = new MenuItem(LABEL);
item.addActionListener(this);
pop.add(item);
{
if (graphStretch > -1)
{
- av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
+ av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
- evt.getY();
- if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
+ if (av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight < 0)
{
- av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
+ av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight = 0;
}
graphStretchY = evt.getY();
calcPanelHeight();
public void mouseMoved(MouseEvent evt)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
return;
int res = evt.getX() / av.getCharWidth() + av.getStartRes();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
public int calcPanelHeight()
{
// setHeight of panels
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
int height = 0;
if (aa != null)
{
if (activeRow == -1)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
return;
public void fastPaint(int horizontal)
{
- if (horizontal == 0 || av.alignment.getAlignmentAnnotation() == null
- || av.alignment.getAlignmentAnnotation().length < 1)
+ if (horizontal == 0 || av.getAlignment().getAlignmentAnnotation() == null
+ || av.getAlignment().getAlignmentAnnotation().length < 1)
{
repaint();
return;
fm = g.getFontMetrics();
}
- if ((av.alignment.getAlignmentAnnotation() == null)
- || (av.alignment.getAlignmentAnnotation().length < 1))
+ if ((av.getAlignment().getAlignmentAnnotation() == null)
+ || (av.getAlignment().getAlignmentAnnotation().length < 1))
{
g.setColor(Color.white);
g.fillRect(0, 0, getSize().width, getSize().height);
return;
}
-
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
g.translate(0, -scrollOffset);
- int x = 0;
- int y = 0;
- int column = 0;
- char lastSS;
- int lastSSX;
- int iconOffset = av.charHeight / 2;
- boolean validRes = false;
- boolean validEnd = false;
- boolean labelAllCols = false;
- boolean centreColLabels, centreColLabelsDef = av
- .getCentreColumnLabels();
- boolean scaleColLabel = false;
- boolean[] graphGroupDrawn = new boolean[aa.length];
- int charOffset = 0; // offset for a label
- float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a
- // column.
- // \u03B2 \u03B1
- for (int i = 0; i < aa.length; i++)
- {
- AlignmentAnnotation row = aa[i];
-
- if (!row.visible)
- {
- continue;
- }
- centreColLabels = row.centreColLabels || centreColLabelsDef;
- labelAllCols = row.showAllColLabels;
- scaleColLabel = row.scaleColLabel;
- lastSS = ' ';
- lastSSX = 0;
-
- if (row.graph > 0)
- {
- if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
- {
- continue;
- }
-
- // this is so that we draw the characters below the graph
- y += row.height;
-
- if (row.hasText)
- {
- iconOffset = av.charHeight - fm.getDescent();
- y -= av.charHeight;
- }
- }
- // TODO: else is the logic used in application, applet had no 'else'
- else if (row.hasText)
- {
- iconOffset = av.charHeight - fm.getDescent();
-
- }
- else
- {
- iconOffset = 0;
- }
-
- x = 0;
- while (x < endRes - startRes)
- {
- if (av.hasHiddenColumns)
- {
- column = av.getColumnSelection().adjustForHiddenColumns(
- startRes + x);
- if (column > row.annotations.length - 1)
- {
- break;
- }
- }
- else
- {
- column = startRes + x;
- }
-
- if ((row.annotations.length <= column)
- || (row.annotations[column] == null))
- {
- validRes = false;
- }
- else
- {
- validRes = true;
- }
-
- if (activeRow == i)
- {
- g.setColor(Color.red);
-
- if (av.getColumnSelection() != null)
- {
- for (int n = 0; n < av.getColumnSelection().size(); n++)
- {
- int v = av.getColumnSelection().columnAt(n);
-
- if (v == column)
- {
- g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
- }
- }
- }
- }
-
- if (av.validCharWidth
- && validRes
- && (row.annotations[column].displayCharacter != null && row.annotations[column].displayCharacter
- .length() > 0))
- {
-
- if (centreColLabels || scaleColLabel)
- {
- fmWidth = (float) fm.charsWidth(
- row.annotations[column].displayCharacter.toCharArray(),
- 0, row.annotations[column].displayCharacter.length());
-
- if (scaleColLabel)
- {
- // justify the label and scale to fit in column
- if (fmWidth > av.charWidth)
- {
- // scale only if the current font isn't already small enough
- fmScaling = av.charWidth;
- fmScaling /= fmWidth;
- // not 1.1 // g.setFont(new
- // Font(ofont,AffineTransform.getScaleInstance(fmScaling,
- // 1.0)));
- // and update the label's width to reflect the scaling.
- fmWidth = av.charWidth;
- }
- }
- }
- else
- {
- fmWidth = (float) fm
- .charWidth(row.annotations[column].displayCharacter
- .charAt(0));
- }
- charOffset = (int) ((av.charWidth - fmWidth) / 2f);
-
- if (row.annotations[column].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(row.annotations[column].colour);
-
- if (column == 0 || row.graph > 0)
- {
- g.drawString(row.annotations[column].displayCharacter,
- (x * av.charWidth) + charOffset, y + iconOffset + 3); // +
- // 3?
- }
- else if (row.annotations[column - 1] == null
- || (labelAllCols
- || !row.annotations[column].displayCharacter
- .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
- .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
- {
- g.drawString(row.annotations[column].displayCharacter,
- (x * av.charWidth) + charOffset, y + iconOffset + 3); // +3?
- }
- g.setFont(ofont);
- }
-
- if (row.hasIcons)
- {
- if (!validRes
- || (row.annotations[column].secondaryStructure != lastSS))
- {
- switch (lastSS)
- {
- case 'H':
- g.setColor(HELIX_COLOUR);
- if (MAC)
- {
- // Off by 1 offset when drawing rects and ovals
- // to offscreen image on the MAC
- g.fillRoundRect(lastSSX, y + 4 + iconOffset,
- (x * av.charWidth) - lastSSX, 7, 8, 8);
- break;
- }
-
- int sCol = (lastSSX / av.charWidth) + startRes;
- int x1 = lastSSX;
- int x2 = (x * av.charWidth);
-
- if (sCol == 0
- || row.annotations[sCol - 1] == null
- || row.annotations[sCol - 1].secondaryStructure != 'H')
- {
- g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
- 180);
- x1 += av.charWidth / 2;
- }
-
- if (!validRes || row.annotations[column] == null
- || row.annotations[column].secondaryStructure != 'H')
- {
- g.fillArc((x * av.charWidth) - av.charWidth, y + 4
- + iconOffset, av.charWidth, 8, 270, 180);
- x2 -= av.charWidth / 2;
- }
-
- g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
- break;
-
- case 'E':
- g.setColor(SHEET_COLOUR);
- g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
- - lastSSX - 4, 7);
- g.fillPolygon(new int[]
- { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
- (x * av.charWidth) }, new int[]
- { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
- 3);
-
- break;
-
- default:
- g.setColor(Color.gray);
- g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
- - lastSSX, 2);
-
- break;
- }
-
- if (validRes)
- {
- lastSS = row.annotations[column].secondaryStructure;
- }
- else
- {
- lastSS = ' ';
- }
-
- lastSSX = (x * av.charWidth);
- }
- }
-
- column++;
- x++;
- }
-
- if (column >= row.annotations.length)
- {
- column = row.annotations.length - 1;
- validEnd = false;
- }
- else
- {
- validEnd = true;
- }
-
- // x ++;
-
- if (row.hasIcons)
- {
- switch (lastSS)
- {
- case 'H':
- g.setColor(HELIX_COLOUR);
- if (MAC)
- {
- // Off by 1 offset when drawing rects and ovals
- // to offscreen image on the MAC
- g.fillRoundRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
- - lastSSX, 7, 8, 8);
- break;
- }
-
- int sCol = (lastSSX / av.charWidth) + startRes;
- int x1 = lastSSX;
- int x2 = (x * av.charWidth);
-
- if (sCol == 0 || row.annotations[sCol - 1] == null
- || row.annotations[sCol - 1].secondaryStructure != 'H')
- {
- g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
- x1 += av.charWidth / 2;
- }
-
- if (row.annotations[column] == null
- || row.annotations[column].secondaryStructure != 'H')
- {
- g.fillArc((x * av.charWidth) - av.charWidth,
- y + 4 + iconOffset, av.charWidth, 8, 270, 180);
- x2 -= av.charWidth / 2;
- }
-
- g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
-
- break;
-
- case 'E':
- g.setColor(SHEET_COLOUR);
-
- if (!validEnd || row.annotations[endRes] == null
- || row.annotations[endRes].secondaryStructure != 'E')
- {
- g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
- - lastSSX - 4, 7);
- g.fillPolygon(new int[]
- { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
- (x * av.charWidth) }, new int[]
- { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, 3);
- }
- else
- {
- g.fillRect(lastSSX, y + 4 + iconOffset, x * av.charWidth
- - lastSSX, 7);
- }
- break;
-
- default:
- g.setColor(Color.gray);
- if (!av.wrapAlignment || endRes == av.endRes)
- {
- g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
- - lastSSX, 2);
- }
-
- break;
- }
- }
-
- if (row.graph > 0 && row.graphHeight > 0)
- {
- if (row.graph == AlignmentAnnotation.LINE_GRAPH)
- {
- if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
- {
- float groupmax = -999999, groupmin = 9999999;
- for (int gg = 0; gg < aa.length; gg++)
- {
- if (aa[gg].graphGroup != row.graphGroup)
- {
- continue;
- }
-
- if (aa[gg] != row)
- {
- aa[gg].visible = false;
- }
-
- if (aa[gg].graphMax > groupmax)
- {
- groupmax = aa[gg].graphMax;
- }
- if (aa[gg].graphMin < groupmin)
- {
- groupmin = aa[gg].graphMin;
- }
- }
-
- for (int gg = 0; gg < aa.length; gg++)
- {
- if (aa[gg].graphGroup == row.graphGroup)
- {
- drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
- groupmax, row.graphHeight);
- }
- }
-
- graphGroupDrawn[row.graphGroup] = true;
- }
- else
- {
- drawLineGraph(g, row, startRes, endRes, y, row.graphMin,
- row.graphMax, row.graphHeight);
- }
- }
- else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
- {
- drawBarGraph(g, row, startRes, endRes, row.graphMin,
- row.graphMax, y);
- }
- }
-
- if (row.graph > 0 && row.hasText)
- {
- y += av.charHeight;
- }
-
- if (row.graph == 0)
- {
- y += aa[i].height;
- }
- }
+ renderer.drawComponent(this, av, g, activeRow, startRes, endRes);
g.translate(0, +scrollOffset);
}
+
+ int scrollOffset = 0;
- public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes,
- int eRes, int y, float min, float max, int graphHeight)
- {
- if (sRes > aa.annotations.length)
- {
- return;
- }
-
- int x = 0;
-
- // Adjustment for fastpaint to left
- if (eRes < av.endRes)
- {
- eRes++;
- }
-
- eRes = Math.min(eRes, aa.annotations.length);
-
- int y1 = y, y2 = y;
- float range = max - min;
-
- // //Draw origin
- if (min < 0)
- {
- y2 = y - (int) ((0 - min / range) * graphHeight);
- }
-
- g.setColor(Color.gray);
- g.drawLine(x - av.charWidth, y2, (eRes - sRes) * av.charWidth, y2);
-
- eRes = Math.min(eRes, aa.annotations.length);
-
- int column;
- int aaMax = aa.annotations.length - 1;
-
- while (x < eRes - sRes)
- {
- column = sRes + x;
- if (av.hasHiddenColumns)
- {
- column = av.getColumnSelection().adjustForHiddenColumns(column);
- }
-
- if (column > aaMax)
- {
- break;
- }
-
- if (aa.annotations[column] == null) // || coaa.annotations[column - 1] ==
- // null)
- {
- x++;
- continue;
- }
-
- if (aa.annotations[column].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(aa.annotations[column].colour);
- if (column == 0 || aa.annotations[column - 1] == null)
- {
- y1 = y
- - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
- }
- else
- {
- y1 = y
- - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
- }
- y2 = y
- - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
-
- g.drawLine(x * av.charWidth - av.charWidth / 2, y1, x * av.charWidth
- + av.charWidth / 2, y2);
- x++;
- }
-
- if (aa.threshold != null)
- {
- g.setColor(aa.threshold.colour);
-
- y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
- g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
- }
- }
-
- public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes,
- int eRes, float min, float max, int y)
+ public void setScrollOffset(int value)
{
- ColourSchemeI profcolour = av.getGlobalColourScheme();
- if (profcolour == null)
- {
- profcolour = new jalview.schemes.ZappoColourScheme();
- }
- if (sRes > aa.annotations.length)
- {
- return;
- }
- Font ofont = g.getFont();
- eRes = Math.min(eRes, aa.annotations.length);
-
- int x = 0, y1 = y, y2 = y;
-
- float range = max - min;
-
- if (min < 0)
- {
- y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
- }
-
- g.setColor(Color.gray);
-
- g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
-
- int column;
- int aaMax = aa.annotations.length - 1;
- boolean renderHistogram = true, renderProfile = false;
- if (aa.autoCalculated && aa.label.startsWith("Consensus"))
- { // TODO: generalise this to have render styles for consensus/profile data
- if (aa.groupRef != null)
- {
- renderHistogram = aa.groupRef.isShowConsensusHistogram();
- renderProfile = aa.groupRef.isShowSequenceLogo();
- }
- else
- {
- renderHistogram = av.isShowConsensusHistogram();
- renderProfile = av.isShowSequenceLogo();
- }
- }
-
- while (x < eRes - sRes)
- {
- column = sRes + x;
- if (av.hasHiddenColumns)
- {
- column = av.getColumnSelection().adjustForHiddenColumns(column);
- }
-
- if (column > aaMax)
- {
- break;
- }
-
- if (aa.annotations[column] == null)
- {
- x++;
- continue;
- }
-
- if (aa.annotations[column].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(aa.annotations[column].colour);
-
- y1 = y
- - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
-
- if (renderHistogram)
- {
- if (y1 - y2 > 0)
- {
- g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
- }
- else
- {
- g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
- }
- }
- // draw profile if available
- if (aa.annotations[column].value != 0 && renderProfile)
- {
- int profl[] = getProfileFor(aa, column);
- int ht = y1, htn = y2 - y1;// aa.graphHeight;
- float wdth;
- double ht2 = 0;
- char[] dc = new char[1];
- LineMetrics lm;
- for (int c = 1; profl != null && c < profl[0];)
- {
- dc[0] = (char) profl[c++];
- wdth = av.charWidth;
- wdth /= (float) fm.charsWidth(dc, 0, 1);
-
- if (c > 2)
- {
- ht += (int) ht2;
- }
- { // not java 1.1 compatible: Bug # 0060064
- g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(
- wdth, (ht2 = (htn * ((double) profl[c++]) / 100.0))
- / av.charHeight)));
- lm = g.getFontMetrics().getLineMetrics(dc, 0, 1, g);
- g.setColor(profcolour.findColour(dc[0]));
- g.drawChars(dc, 0, 1, x * av.charWidth,
- (int) (ht + lm.getHeight()));
- }
- }
- g.setFont(ofont);
- }
-
- x++;
-
- }
- if (aa.threshold != null)
- {
- g.setColor(aa.threshold.colour);
- y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
- g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
- }
+ scrollOffset = value;
+ repaint();
}
- private int[] getProfileFor(AlignmentAnnotation aa, int column)
+ @Override
+ public FontMetrics getFontMetrics()
{
- // if (aa.autoCalculated && aa.label.startsWith("Consensus")) {
- if (aa.groupRef != null && aa.groupRef.consensusData != null)
- {
- // && aa.groupRef.isShowSequenceLogo()) {
- return AAFrequency.extractProfile(aa.groupRef.consensusData[column],
- aa.groupRef.getIgnoreGapsConsensus());
- }
- // TODO extend annotation row to enable dynamic and static profile data to
- // be stored
- if (aa.groupRef == null && aa.sequenceRef == null)
- // && av.isShowSequenceLogo())
- {
- return AAFrequency.extractProfile(av.hconsensus[column],
- av.getIgnoreGapsConsensus());
- }
- // }
- return null;
+ return fm;
}
- // used by overview window
- public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
- int y, int sRes, int eRes)
+ @Override
+ public Image getFadedImage()
{
- eRes = Math.min(eRes, aa.annotations.length);
- g.setColor(Color.white);
- g.fillRect(0, 0, width, y);
- g.setColor(new Color(0, 0, 180));
-
- int x = 0, height;
-
- for (int j = sRes; j < eRes; j++)
- {
- if (aa.annotations[j].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(aa.annotations[j].colour);
-
- height = (int) ((aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);
- if (height > y)
- {
- height = y;
- }
- g.fillRect(x, y - height, av.charWidth, height);
- x += av.charWidth;
- }
+ return image;
}
- int scrollOffset = 0;
-
- public void setScrollOffset(int value)
+ @Override
+ public int getFadedImageWidth()
{
- scrollOffset = value;
- repaint();
+ return imgWidth;
}
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
MenuItem turn = new MenuItem("Turn Propensity");
MenuItem buried = new MenuItem("Buried Index");
+
+ MenuItem purinepyrimidine = new MenuItem("Purine/Pyrimidine");
MenuItem user = new MenuItem("User Defined Colours");
strand.addActionListener(this);
turn.addActionListener(this);
buried.addActionListener(this);
+ purinepyrimidine.addActionListener(this);
user.addActionListener(this);
jmolHelp.addActionListener(this);
coloursMenu.add(strand);
coloursMenu.add(turn);
coloursMenu.add(buried);
+ coloursMenu.add(purinepyrimidine);
coloursMenu.add(user);
coloursMenu.add(jmolColour);
helpMenu.add(jmolHelp);
setEnabled(buried);
jmb.setJalviewColourScheme(new BuriedColourScheme());
}
+ else if(evt.getSource() == purinepyrimidine)
+ {
+ jmb.setJalviewColourScheme(new PurinePyrimidineColourScheme());
+ }
else if (evt.getSource() == user)
{
setEnabled(user);
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
else if (annotationImport)
{
if (new AnnotationFile().readAnnotationFile(
- alignFrame.viewport.alignment, textarea.getText(),
+ alignFrame.viewport.getAlignment(), textarea.getText(),
jalview.io.AppletFormatAdapter.PASTE))
{
alignFrame.alignPanel.fontChanged();
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
av.featuresDisplayed = new Hashtable();
Vector allfeatures = new Vector();
minmax = new Hashtable();
-
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment=av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- SequenceFeature[] features = av.alignment.getSequenceAt(i)
+ SequenceFeature[] features = alignment.getSequenceAt(i)
.getSequenceFeatures();
if (features == null)
ArrayList allGroups = new ArrayList();
SequenceFeature[] tmpfeatures;
String group;
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment=av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+ if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
{
continue;
}
alignmentHasFeatures = true;
- tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+ tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
int index = 0;
while (index < tmpfeatures.length)
{
Vector allFeatures = new Vector();
SequenceFeature[] tmpfeatures;
String group;
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment=av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+ if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
{
continue;
}
alignmentHasFeatures = true;
- tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+ tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
int index = 0;
while (index < tmpfeatures.length)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
SequenceFeature[] tmpfeatures;
String group = null, type;
Vector visibleChecks = new Vector();
-
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment=av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+ if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
{
continue;
}
- tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+ tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
int index = 0;
while (index < tmpfeatures.length)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
((i - starty) * charHeight) + ypos + charHeight
- (charHeight / 5));
- if (av.hasHiddenRows && av.showHiddenMarkers)
+ if (av.hasHiddenRows() && av.showHiddenMarkers)
{
drawMarker(i, starty, ypos);
}
if (av.getWrapAlignment())
{
- int maxwidth = av.alignment.getWidth();
- int alheight = av.alignment.getHeight();
+ int maxwidth = av.getAlignment().getWidth();
+ int alheight = av.getAlignment().getHeight();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
for (int i = starty; i < alheight; i++)
{
- SequenceI s = av.alignment.getSequenceAt(i);
+ SequenceI s = av.getAlignment().getSequenceAt(i);
gg.setFont(italic);
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
setHiddenFont(s);
}
for (int i = starty; i < endy; i++)
{
- seq = av.alignment.getSequenceAt(i);
+ seq = av.getAlignment().getSequenceAt(i);
if (seq == null)
{
continue;
}
gg.setFont(italic);
// boolean isrep=false;
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
// isrep =
setHiddenFont(seq);
(((i - starty) * av.charHeight) + av.charHeight)
- (av.charHeight / 5));
- if (av.hasHiddenRows && av.showHiddenMarkers)
+ if (av.hasHiddenRows() && av.showHiddenMarkers)
{
drawMarker(i, starty, 0);
}
void drawMarker(int i, int starty, int yoffset)
{
- SequenceI[] hseqs = av.alignment.getHiddenSequences().hiddenSequences;
+ SequenceI[] hseqs = av.getAlignment().getHiddenSequences().hiddenSequences;
// Use this method here instead of calling hiddenSeq adjust
// 3 times.
int hSize = hseqs.length;
Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
.getSize());
- if (av.hiddenRepSequences != null
- && av.hiddenRepSequences.containsKey(seq))
+ if (av.getHiddenRepSequences() != null
+ && av.getHiddenRepSequences().containsKey(seq))
{
gg.setFont(bold);
return true;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
}
if (mouseDragging && e.getY() >= getSize().height
- && av.alignment.getHeight() > av.getEndSeq())
+ && av.getAlignment().getHeight() > av.getEndSeq())
{
scrollThread = new ScrollThread(false);
}
{
av.setSelectionGroup(new SequenceGroup());
av.getSelectionGroup().setStartRes(0);
- av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+ av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
}
if (e.isShiftDown() && lastid != -1)
return;
}
- int index = av.alignment.findIndex((SequenceI) found.elementAt(0));
+ int index = av.getAlignment().findIndex((SequenceI) found.elementAt(0));
// do we need to scroll the panel?
if (av.getStartSeq() > index || av.getEndSeq() < index)
{
selectSeqs(lastid - 1, seq);
}
- else if (seq > lastid && seq < av.alignment.getHeight())
+ else if (seq > lastid && seq < av.getAlignment().getHeight())
{
selectSeqs(lastid + 1, seq);
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
*/
package jalview.appletgui;
+import jalview.datamodel.AlignmentI;
+
import java.awt.*;
import java.awt.event.*;
sr.forOverview = true;
fr = new FeatureRenderer(av);
fr.overview = true;
-
+
// scale the initial size of overviewpanel to shape of alignment
- float initialScale = (float) av.alignment.getWidth()
- / (float) av.alignment.getHeight();
+ float initialScale = (float) av.getAlignment().getWidth()
+ / (float) av.getAlignment().getHeight();
- if (av.hconsensus == null)
+ if (av.getSequenceConsensusHash() == null)
{
graphHeight = 0;
}
- if (av.alignment.getWidth() > av.alignment.getHeight())
+ if (av.getAlignment().getWidth() > av.getAlignment().getHeight())
{
// wider
width = 400;
if (boxX > (width - boxWidth))
{
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
// Try smallest possible box
boxWidth = (int) ((av.endRes - av.startRes + 1) * av.getCharWidth() * scalew);
int col = (int) (boxX / scalew / av.getCharWidth());
int row = (int) (boxY / scaleh / av.getCharHeight());
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
if (!av.getColumnSelection().isVisible(col))
{
col = av.getColumnSelection().findColumnPosition(col);
}
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- row = av.alignment.getHiddenSequences().findIndexWithoutHiddenSeqs(
+ row = av.getAlignment().getHiddenSequences().findIndexWithoutHiddenSeqs(
row);
}
public void run()
{
miniMe = null;
- int alwidth = av.alignment.getWidth();
- int alheight = av.alignment.getHeight();
+ int alwidth = av.getAlignment().getWidth();
+ int alheight = av.getAlignment().getHeight();
if (av.showSequenceFeatures)
{
int row, col, sameRow = 0, sameCol = 0;
jalview.datamodel.SequenceI seq;
boolean hiddenRow = false;
+ AlignmentI alignment=av.getAlignment();
for (row = 0; row <= sequencesHeight; row++)
{
if ((int) (row * sampleRow) == lastrow)
}
hiddenRow = false;
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- seq = av.alignment.getHiddenSequences().getHiddenSequence(lastrow);
+ seq = alignment.getHiddenSequences().getHiddenSequence(lastrow);
if (seq == null)
{
- int index = av.alignment.getHiddenSequences()
+ int index = alignment.getHiddenSequences()
.findIndexWithoutHiddenSeqs(lastrow);
- seq = av.alignment.getSequenceAt(index);
+ seq = alignment.getSequenceAt(index);
}
else
{
}
else
{
- seq = av.alignment.getSequenceAt(lastrow);
+ seq = alignment.getSequenceAt(lastrow);
}
for (col = 0; col < width; col++)
}
if (hiddenRow
- || (av.hasHiddenColumns && !av.getColumnSelection()
+ || (av.hasHiddenColumns() && !av.getColumnSelection()
.isVisible(lastcol)))
{
color = color.darker().darker();
sameRow = 1;
}
- if (av.conservation != null)
+ if (av.getAlignmentConservationAnnotation()!= null)
{
for (col = 0; col < width; col++)
{
lastcol = (int) (col * sampleCol);
{
mg.translate(col, sequencesHeight);
- ap.annotationPanel.drawGraph(mg, av.conservation,
+ ap.annotationPanel.renderer.drawGraph(mg, av.getAlignmentConservationAnnotation(),
(int) (sampleCol) + 1, graphHeight,
(int) (col * sampleCol), (int) (col * sampleCol) + 1);
mg.translate(-col, -sequencesHeight);
public void setBoxPosition()
{
- int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth();
- int fullsizeHeight = (av.alignment.getHeight() + av.alignment
+ int fullsizeWidth = av.getAlignment().getWidth() * av.getCharWidth();
+ int fullsizeHeight = (av.getAlignment().getHeight() + av.getAlignment()
.getHiddenSequences().getSize()) * av.getCharHeight();
int startRes = av.getStartRes();
int endRes = av.getEndRes();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
startRes = av.getColumnSelection().adjustForHiddenColumns(startRes);
endRes = av.getColumnSelection().adjustForHiddenColumns(endRes);
int startSeq = av.startSeq;
int endSeq = av.endSeq;
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- startSeq = av.alignment.getHiddenSequences().adjustForHiddenSeqs(
+ startSeq = av.getAlignment().getHiddenSequences().adjustForHiddenSeqs(
startSeq);
- endSeq = av.alignment.getHiddenSequences()
+ endSeq = av.getAlignment().getHiddenSequences()
.adjustForHiddenSeqs(endSeq);
}
boxX = (int) (startRes * av.getCharWidth() * scalew);
boxY = (int) (startSeq * av.getCharHeight() * scaleh);
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
boxWidth = (int) ((endRes - startRes + 1) * av.getCharWidth() * scalew);
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
seqstrings = av.getAlignmentView(av.getSelectionGroup() != null);
if (av.getSelectionGroup() == null)
{
- seqs = av.alignment.getSequencesArray();
+ seqs = av.getAlignment().getSequencesArray();
}
else
{
- seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+ seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
}
SeqCigar sq[] = seqstrings.getSequences();
int length = sq[0].getWidth();
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
else if (validateSequences && comp instanceof AlignmentPanel
&& source instanceof AlignmentPanel)
{
- validateSequences(((AlignmentPanel) source).av.alignment,
- ((AlignmentPanel) comp).av.alignment);
+ validateSequences(((AlignmentPanel) source).av.getAlignment(),
+ ((AlignmentPanel) comp).av.getAlignment());
}
if (comp instanceof AlignmentPanel && alignmentChanged)
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
if (ap.av.getSelectionGroup() == null)
{
- seqs = ap.av.alignment.getSequencesArray();
+ seqs = ap.av.getAlignment().getSequencesArray();
}
else
{
- seqs = ap.av.getSelectionGroup().getSequencesInOrder(ap.av.alignment);
+ seqs = ap.av.getSelectionGroup().getSequencesInOrder(ap.av.getAlignment());
}
float scores[][] = new float[seqs.length][seqs.length];
double totscore = 0;
int count = ap.av.getSelectionGroup().getSize();
- String type = (ap.av.alignment.isNucleotide()) ? AlignSeq.DNA
+ String type = (ap.av.getAlignment().isNucleotide()) ? AlignSeq.DNA
: AlignSeq.PEP;
Sequence seq;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public class RedundancyPanel extends SliderPanel implements Runnable,
WindowListener
{
- AlignmentPanel ap;
-
Stack historyList = new Stack(); // simpler than synching with alignFrame.
float[] redundancy;
if ((sg != null) && (sg.getSize() >= 1))
{
- originalSequences = sg.getSequencesInOrder(ap.av.alignment);
+ originalSequences = sg.getSequencesInOrder(ap.av.getAlignment());
start = sg.getStartRes();
end = sg.getEndRes();
}
else
{
- originalSequences = ap.av.alignment.getSequencesArray();
+ originalSequences = ap.av.getAlignment().getSequencesArray();
start = 0;
- end = ap.av.alignment.getWidth();
+ end = ap.av.getAlignment().getWidth();
}
height = originalSequences.length;
}
EditCommand cut = new EditCommand("Remove Redundancy",
- EditCommand.CUT, deleted, 0, width, ap.av.alignment);
-
+ EditCommand.CUT, deleted, 0, width, ap.av.getAlignment());
+ AlignmentI alignment=ap.av.getAlignment();
for (int i = 0; i < del.size(); i++)
{
- ap.av.alignment.deleteSequence(deleted[i]);
+ alignment.deleteSequence(deleted[i]);
PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true);
if (sg != null)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
if (av.getSelectionGroup() != null)
{
av.getSelectionGroup().addOrRemove(found, true);
- av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+ av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
}
else
{
av.setSelectionGroup(new SequenceGroup());
av.getSelectionGroup().addOrRemove(found, true);
- av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+ av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
}
PaintRefresher.Refresh(this, av.getSequenceSetId());
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
int x = (evt.getX() / av.getCharWidth()) + av.getStartRes();
final int res;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(x);
}
{
av.hideColumns(res, res);
if (av.getSelectionGroup() != null
- && av.getSelectionGroup().getSize() == av.alignment
+ && av.getSelectionGroup().getSize() == av.getAlignment()
.getHeight())
{
av.setSelectionGroup(null);
av.getColumnSelection().addElement(res);
SequenceGroup sg = new SequenceGroup();
- for (int i = 0; i < av.alignment.getSequences().size(); i++)
+ for (int i = 0; i < av.getAlignment().getSequences().size(); i++)
{
- sg.addSequence(av.alignment.getSequenceAt(i), false);
+ sg.addSequence(av.getAlignment().getSequenceAt(i), false);
}
sg.setStartRes(res);
int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
- if (res > av.alignment.getWidth())
+ if (res > av.getAlignment().getWidth())
{
- res = av.alignment.getWidth() - 1;
+ res = av.getAlignment().getWidth() - 1;
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
res = 0;
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
- if (res > av.alignment.getWidth())
+ if (res > av.getAlignment().getWidth())
{
- res = av.alignment.getWidth() - 1;
+ res = av.getAlignment().getWidth() - 1;
}
if (res < min)
public void mouseMoved(MouseEvent evt)
{
- if (!av.hasHiddenColumns)
+ if (!av.hasHiddenColumns())
{
return;
}
for (int i = 0; i < cs.size(); i++)
{
int sel = cs.columnAt(i);
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
sel = av.getColumnSelection().findColumnPosition(sel);
}
}
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
gg.setColor(Color.blue);
int res;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
for (int i = scalestartx; i < endx; i += 10)
{
int value = i;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
value = av.getColumnSelection().adjustForHiddenColumns(value);
}
{
FontMetrics fm = getFontMetrics(av.getFont());
ypos += av.charHeight;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
startx = av.getColumnSelection().adjustForHiddenColumns(startx);
endx = av.getColumnSelection().adjustForHiddenColumns(endx);
}
- int maxwidth = av.alignment.getWidth();
- if (av.hasHiddenColumns)
+ int maxwidth = av.getAlignment().getWidth();
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
// WEST SCALE
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ for (int i = 0; i < av.getAlignment().getHeight(); i++)
{
- SequenceI seq = av.alignment.getSequenceAt(i);
+ SequenceI seq = av.getAlignment().getSequenceAt(i);
int index = startx;
int value = -1;
continue;
}
- value = av.alignment.getSequenceAt(i).findPosition(index);
+ value = av.getAlignment().getSequenceAt(i).findPosition(index);
break;
}
{
ypos += av.charHeight;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
endx = av.getColumnSelection().adjustForHiddenColumns(endx);
}
SequenceI seq;
// EAST SCALE
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ for (int i = 0; i < av.getAlignment().getHeight(); i++)
{
- seq = av.alignment.getSequenceAt(i);
+ seq = av.getAlignment().getSequenceAt(i);
int index = endx;
int value = -1;
String mask = "0";
int maxWidth = 0;
int tmp;
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment=av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- tmp = av.alignment.getSequenceAt(i).getEnd();
+ tmp = alignment.getSequenceAt(i).getEnd();
if (tmp > maxWidth)
{
maxWidth = tmp;
int endx;
int ypos = hgap;
- int maxwidth = av.alignment.getWidth() - 1;
+ int maxwidth = av.getAlignment().getWidth() - 1;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
{
drawNorthScale(g, startRes, endx, ypos);
}
- if (av.hasHiddenColumns && av.showHiddenMarkers)
+ if (av.hasHiddenColumns() && av.showHiddenMarkers)
{
g.setColor(Color.blue);
int res;
void drawPanel(Graphics g1, int startRes, int endRes, int startSeq,
int endSeq, int offset)
{
- if (!av.hasHiddenColumns)
+ if (!av.hasHiddenColumns())
{
draw(g1, startRes, endRes, startSeq, endSeq, offset);
}
// ///////////////////////////
for (int i = startSeq; i < endSeq; i++)
{
- nextSeq = av.alignment.getSequenceAt(i);
+ nextSeq = av.getAlignment().getSequenceAt(i);
if (nextSeq == null)
{
continue;
}
- sr.drawSequence(nextSeq, av.alignment.findAllGroups(nextSeq),
+ sr.drawSequence(nextSeq, av.getAlignment().findAllGroups(nextSeq),
startRes, endRes, offset + ((i - startSeq) * av.charHeight));
if (av.showSequenceFeatures)
}
if (av.getSelectionGroup() != null
- || av.alignment.getGroups().size() > 0)
+ || av.getAlignment().getGroups().size() > 0)
{
drawGroupsBoundaries(g, startRes, endRes, startSeq, endSeq, offset);
}
int ex = -1;
int groupIndex = -1;
- if ((group == null) && (av.alignment.getGroups().size() > 0))
+ if ((group == null) && (av.getAlignment().getGroups().size() > 0))
{
- group = (SequenceGroup) av.alignment.getGroups().elementAt(0);
+ group = (SequenceGroup) av.getAlignment().getGroups().elementAt(0);
groupIndex = 0;
}
boolean inGroup = false;
int top = -1;
int bottom = -1;
- int alHeight = av.alignment.getHeight() - 1;
+ int alHeight = av.getAlignment().getHeight() - 1;
for (i = startSeq; i < endSeq; i++)
{
if ((sx <= (endRes - startRes) * av.charWidth)
&& group.getSequences(null).contains(
- av.alignment.getSequenceAt(i)))
+ av.getAlignment().getSequenceAt(i)))
{
if ((bottom == -1)
&& (i >= alHeight || !group.getSequences(null)
- .contains(av.alignment.getSequenceAt(i + 1))))
+ .contains(av.getAlignment().getSequenceAt(i + 1))))
{
bottom = sy + av.charHeight;
}
{
if (((top == -1) && (i == 0))
|| !group.getSequences(null).contains(
- av.alignment.getSequenceAt(i - 1)))
+ av.getAlignment().getSequenceAt(i - 1)))
{
top = sy;
}
groupIndex++;
- if (groupIndex >= av.alignment.getGroups().size())
+ if (groupIndex >= av.getAlignment().getGroups().size())
{
break;
}
- group = (SequenceGroup) av.alignment.getGroups().elementAt(
+ group = (SequenceGroup) av.getAlignment().getGroups().elementAt(
groupIndex);
- } while (groupIndex < av.alignment.getGroups().size());
+ } while (groupIndex < av.getAlignment().getGroups().size());
}
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
{
seqCanvas.cursorX += dx;
seqCanvas.cursorY += dy;
- if (av.hasHiddenColumns && !av.colSel.isVisible(seqCanvas.cursorX))
+ if (av.hasHiddenColumns() && !av.getColumnSelection().isVisible(seqCanvas.cursorX))
{
int original = seqCanvas.cursorX - dx;
- int maxWidth = av.alignment.getWidth();
+ int maxWidth = av.getAlignment().getWidth();
- while (!av.colSel.isVisible(seqCanvas.cursorX)
+ while (!av.getColumnSelection().isVisible(seqCanvas.cursorX)
&& seqCanvas.cursorX < maxWidth && seqCanvas.cursorX > 0)
{
seqCanvas.cursorX += dx;
}
if (seqCanvas.cursorX >= maxWidth
- || !av.colSel.isVisible(seqCanvas.cursorX))
+ || !av.getColumnSelection().isVisible(seqCanvas.cursorX))
{
seqCanvas.cursorX = original;
}
{
seqCanvas.cursorX = 0;
}
- else if (seqCanvas.cursorX > av.alignment.getWidth() - 1)
+ else if (seqCanvas.cursorX > av.getAlignment().getWidth() - 1)
{
- seqCanvas.cursorX = av.alignment.getWidth() - 1;
+ seqCanvas.cursorX = av.getAlignment().getWidth() - 1;
}
if (seqCanvas.cursorY < 0)
{
seqCanvas.cursorY = 0;
}
- else if (seqCanvas.cursorY > av.alignment.getHeight() - 1)
+ else if (seqCanvas.cursorY > av.getAlignment().getHeight() - 1)
{
- seqCanvas.cursorY = av.alignment.getHeight() - 1;
+ seqCanvas.cursorY = av.getAlignment().getHeight() - 1;
}
endEditing();
{
ap.scrollUp(false);
}
- while (seqCanvas.cursorX < av.colSel
+ while (seqCanvas.cursorX < av.getColumnSelection()
.adjustForHiddenColumns(av.startRes))
{
break;
}
}
- while (seqCanvas.cursorX > av.colSel
+ while (seqCanvas.cursorX > av.getColumnSelection()
.adjustForHiddenColumns(av.endRes))
{
if (!ap.scrollRight(true))
}
}
}
- setStatusMessage(av.alignment.getSequenceAt(seqCanvas.cursorY),
+ setStatusMessage(av.getAlignment().getSequenceAt(seqCanvas.cursorY),
seqCanvas.cursorX, seqCanvas.cursorY);
seqCanvas.repaint();
if (av.getSelectionGroup() != null)
{
- SequenceGroup sg = av.selectionGroup;
+ SequenceGroup sg = av.getSelectionGroup();
// Find the top and bottom of this group
- int min = av.alignment.getHeight(), max = 0;
+ int min = av.getAlignment().getHeight(), max = 0;
for (int i = 0; i < sg.getSize(); i++)
{
- int index = av.alignment.findIndex(sg.getSequenceAt(i));
+ int index = av.getAlignment().findIndex(sg.getSequenceAt(i));
if (index > max)
{
max = index;
sg.getSequences(null).removeAllElements();
for (int i = min; i < max; i++)
{
- sg.addSequence(av.alignment.getSequenceAt(i), false);
+ sg.addSequence(av.getAlignment().getSequenceAt(i), false);
}
}
}
+ sequence.getName());
Object obj = null;
- if (av.alignment.isNucleotide())
+ if (av.getAlignment().isNucleotide())
{
obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res)
+ "");
public void mouseClicked(MouseEvent evt)
{
- SequenceI sequence = av.alignment.getSequenceAt(findSeq(evt));
+ SequenceI sequence = av.getAlignment().getSequenceAt(findSeq(evt));
if (evt.getClickCount() > 1)
{
if (av.getSelectionGroup()!=null && av.getSelectionGroup().getSize() == 1
res = (x / av.getCharWidth()) + av.getStartRes();
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
y -= hgap;
seq = Math.min((y % cHeight) / av.getCharHeight(),
- av.alignment.getHeight() - 1);
+ av.getAlignment().getHeight() - 1);
if (seq < 0)
{
seq = -1;
else
{
seq = Math.min((y / av.getCharHeight()) + av.getStartSeq(),
- av.alignment.getHeight() - 1);
+ av.getAlignment().getHeight() - 1);
if (seq < 0)
{
seq = -1;
+ sequence.getName());
Object obj = null;
- if (av.alignment.isNucleotide())
+ if (av.getAlignment().isNucleotide())
{
obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res)
+ "");
ap.alignFrame.statusBar.setText(text.toString());
StringBuffer tooltipText = new StringBuffer();
- SequenceGroup[] groups = av.alignment.findAllGroups(sequence);
+ SequenceGroup[] groups = av.getAlignment().findAllGroups(sequence);
if (groups != null)
{
for (int g = 0; g < groups.length; g++)
boolean fixedColumns = false;
SequenceGroup sg = av.getSelectionGroup();
- SequenceI seq = av.alignment.getSequenceAt(startseq);
+ SequenceI seq = av.getAlignment().getSequenceAt(startseq);
- if (!groupEditing && av.hasHiddenRows)
+ if (!groupEditing && av.hasHiddenRows())
{
- if (av.hiddenRepSequences != null
- && av.hiddenRepSequences.containsKey(seq))
+ if (av.isHiddenRepSequence(seq))
{
- sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+ sg = (SequenceGroup) av.getRepresentedSequences(seq);
groupEditing = true;
}
}
// Are we editing within a selection group?
if (groupEditing
- || (sg != null && sg.getSequences(av.hiddenRepSequences)
+ || (sg != null && sg.getSequences(av.getHiddenRepSequences())
.contains(seq)))
{
fixedColumns = true;
// but the sequence represents a group
if (sg == null)
{
- if (av.hiddenRepSequences == null
- || !av.hiddenRepSequences.containsKey(seq))
+ if (!av.isHiddenRepSequence(seq))
{
endEditing();
return;
}
- sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+ sg = av.getRepresentedSequences(seq);
}
fixedLeft = sg.getStartRes();
}
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
fixedColumns = true;
int y1 = av.getColumnSelection().getHiddenBoundaryLeft(startres);
if (groupEditing)
{
- Vector vseqs = sg.getSequences(av.hiddenRepSequences);
+ Vector vseqs = sg.getSequences(av.getHiddenRepSequences());
int g, groupSize = vseqs.size();
SequenceI[] groupSeqs = new SequenceI[groupSize];
for (g = 0; g < groupSeqs.length; g++)
// If the user has selected the whole sequence, and is dragging to
// the right, we can still extend the alignment and selectionGroup
if (sg.getStartRes() == 0 && sg.getEndRes() == fixedRight
- && sg.getEndRes() == av.alignment.getWidth() - 1)
+ && sg.getEndRes() == av.getAlignment().getWidth() - 1)
{
- sg.setEndRes(av.alignment.getWidth() + startres - lastres);
+ sg.setEndRes(av.getAlignment().getWidth() + startres - lastres);
fixedRight = sg.getEndRes();
}
if (!blank)
{
- if (sg.getSize() == av.alignment.getHeight())
+ if (sg.getSize() == av.getAlignment().getHeight())
{
- if ((av.hasHiddenColumns && startres < av.getColumnSelection()
+ if ((av.hasHiddenColumns() && startres < av.getColumnSelection()
.getHiddenBoundaryRight(startres)))
{
endEditing();
return;
}
- int alWidth = av.alignment.getWidth();
- if (av.hasHiddenRows)
+ int alWidth = av.getAlignment().getWidth();
+ if (av.hasHiddenRows())
{
- int hwidth = av.alignment.getHiddenSequences().getWidth();
+ int hwidth = av.getAlignment().getHiddenSequences().getWidth();
if (hwidth > alWidth)
{
alWidth = hwidth;
else
{
editCommand.appendEdit(EditCommand.INSERT_GAP, groupSeqs,
- startres, startres - lastres, av.alignment, true);
+ startres, startres - lastres, av.getAlignment(), true);
}
}
else
else
{
editCommand.appendEdit(EditCommand.DELETE_GAP, groupSeqs,
- startres, lastres - startres, av.alignment, true);
+ startres, lastres - startres, av.getAlignment(), true);
}
}
else
{
editCommand.appendEdit(EditCommand.INSERT_GAP, new SequenceI[]
- { seq }, lastres, startres - lastres, av.alignment, true);
+ { seq }, lastres, startres - lastres, av.getAlignment(), true);
}
}
else
if (max > 0)
{
editCommand.appendEdit(EditCommand.DELETE_GAP, new SequenceI[]
- { seq }, startres, max, av.alignment, true);
+ { seq }, startres, max, av.getAlignment(), true);
}
}
}
}
editCommand.appendEdit(EditCommand.DELETE_GAP, seq, blankColumn, 1,
- av.alignment, true);
+ av.getAlignment(), true);
- editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.alignment,
+ editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.getAlignment(),
true);
}
void deleteChar(int j, SequenceI[] seq, int fixedColumn)
{
- editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.alignment,
+ editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.getAlignment(),
true);
editCommand.appendEdit(EditCommand.INSERT_GAP, seq, fixedColumn, 1,
- av.alignment, true);
+ av.getAlignment(), true);
}
// ////////////////////////////////////////
if (stretchGroup == null)
{
- stretchGroup = av.alignment.findGroup(sequence);
+ stretchGroup = av.getAlignment().findGroup(sequence);
if (stretchGroup != null && res > stretchGroup.getStartRes()
&& res < stretchGroup.getEndRes())
{
{
stretchGroup = null;
- SequenceGroup[] allGroups = av.alignment.findAllGroups(sequence);
+ SequenceGroup[] allGroups = av.getAlignment().findAllGroups(sequence);
if (allGroups != null)
{
if (stretchGroup.cs instanceof ClustalxColourScheme)
{
((ClustalxColourScheme) stretchGroup.cs).resetClustalX(
- stretchGroup.getSequences(av.hiddenRepSequences),
+ stretchGroup.getSequences(av.getHiddenRepSequences()),
stretchGroup.getWidth());
}
mouseDragging = true;
- if (y > av.alignment.getHeight())
+ if (y > av.getAlignment().getHeight())
{
- y = av.alignment.getHeight() - 1;
+ y = av.getAlignment().getHeight() - 1;
}
- if (res >= av.alignment.getWidth())
+ if (res >= av.getAlignment().getWidth())
{
- res = av.alignment.getWidth() - 1;
+ res = av.getAlignment().getWidth() - 1;
}
if (stretchGroup.getEndRes() == res)
dragDirection = -1;
}
- while ((y != oldSeq) && (oldSeq > -1) && (y < av.alignment.getHeight()))
+ while ((y != oldSeq) && (oldSeq > -1) && (y < av.getAlignment().getHeight()))
{
// This routine ensures we don't skip any sequences, as the
// selection is quite slow.
}
if (mouseDragging && evt.getY() >= getSize().height
- && av.alignment.getHeight() > av.getEndSeq())
+ && av.getAlignment().getHeight() > av.getEndSeq())
{
running = ap.scrollUp(false);
}
// rules are: colsel is copied if there is a real intersection between
// sequence selection
boolean repaint = false, copycolsel = true;
- if (av.selectionGroup == null || !av.isSelectionGroupChanged())
+ if (av.getSelectionGroup() == null || !av.isSelectionGroupChanged(true))
{
SequenceGroup sgroup = null;
if (seqsel != null && seqsel.getSize()>0)
{
- if (av.alignment == null)
+ if (av.getAlignment() == null)
{
System.out
.println("Selection message: alignviewport av SeqSetId="
+ " 's alignment is NULL! returning immediatly.");
return;
}
- sgroup = seqsel.intersect(av.alignment,
- (av.hasHiddenRows) ? av.hiddenRepSequences : null);
+ sgroup = seqsel.intersect(av.getAlignment(),
+ (av.hasHiddenRows()) ? av.getHiddenRepSequences() : null);
if ((sgroup == null || sgroup.getSize() == 0)
&& (colsel == null || colsel.size() == 0))
{
{
av.setSelectionGroup(null);
}
- repaint = av.isSelectionGroupChanged();
+ repaint = av.isSelectionGroupChanged(true);
}
- if (copycolsel && (av.colSel == null || !av.isColSelChanged()))
+ if (copycolsel && (av.getColumnSelection() == null || !av.isColSelChanged(true)))
{
// the current selection is unset or from a previous message
// so import the new colsel.
if (colsel == null || colsel.size() == 0)
{
- if (av.colSel != null)
+ if (av.getColumnSelection() != null)
{
- av.colSel.clear();
+ av.getColumnSelection().clear();
}
}
else
{
// TODO: shift colSel according to the intersecting sequences
- if (av.colSel == null)
+ if (av.getColumnSelection() == null)
{
- av.colSel = new ColumnSelection(colsel);
+ av.setColumnSelection(new ColumnSelection(colsel));
}
else
{
- av.colSel.setElementsFrom(colsel);
+ av.getColumnSelection().setElementsFrom(colsel);
}
}
- repaint |= av.isColSelChanged();
+ repaint |= av.isColSelChanged(true);
}
- if (copycolsel && av.hasHiddenColumns
- && (av.colSel == null || av.colSel.getHiddenColumns() == null))
+ if (copycolsel && av.hasHiddenColumns()
+ && (av.getColumnSelection() == null || av.getColumnSelection().getHiddenColumns() == null))
{
System.err.println("Bad things");
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public Color getResidueBoxColour(SequenceI seq, int i)
{
- allGroups = av.alignment.findAllGroups(seq);
+ allGroups = av.getAlignment().findAllGroups(seq);
if (inCurrentSequenceGroup(i))
{
}
else if (av.getShowBoxes())
{
- getBoxColour(av.globalColourScheme, seq, i);
+ getBoxColour(av.getGlobalColourScheme(), seq, i);
}
return resBoxColour;
public Color findSequenceColour(SequenceI seq, int i)
{
- allGroups = av.alignment.findAllGroups(seq);
+ allGroups = av.getAlignment().findAllGroups(seq);
drawBoxes(seq, i, i, 0);
return resBoxColour;
}
{
// cheat - use this if we have a consensus for each group: s =
// getDisplayChar(currentSequenceGroup.getConsensus(), i, s, '.');
- s = getDisplayChar(av.consensus, i, s, '.');
+ s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
}
}
else
graphics.setColor(resBoxColour);
}
}
- if (av.getShowunconserved())
+ if (av.getShowUnconserved())
{
- s = getDisplayChar(av.consensus, i, s, '.');
+ s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
}
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
conservationSlider.setTitle("Conservation Colour Increment (" + source
+ ")");
- if (ap.av.alignment.getGroups() != null)
+ if (ap.av.getAlignment().getGroups() != null)
{
sp.setAllGroupsCheckEnabled(true);
}
}
PIDSlider.setTitle("Percentage Identity Threshold (" + source + ")");
- if (ap.av.alignment.getGroups() != null)
+ if (ap.av.getAlignment().getGroups() != null)
{
pid.setAllGroupsCheckEnabled(true);
}
if (allGroupsCheck.getState())
{
- allGroups = ap.av.alignment.getGroups();
+ allGroups = ap.av.getAlignment().getGroups();
groupIndex = allGroups.size() - 1;
}
else
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
av.setSelectionGroup(selected);
}
- selected.setEndRes(av.alignment.getWidth() - 1);
+ selected.setEndRes(av.getAlignment().getWidth() - 1);
selected.addOrRemove(sequence, true);
}
setColor(tree.getTopNode(), Color.black);
av.setSelectionGroup(null);
- av.alignment.deleteAllGroups();
+ av.getAlignment().deleteAllGroups();
av.sequenceColours = null;
colourGroups();
}
else
{
- cs = ColourSchemeProperty.getColour(sequences, av.alignment
+ cs = ColourSchemeProperty.getColour(sequences, av.getAlignment()
.getWidth(), ColourSchemeProperty.getColourName(av
.getGlobalColourScheme()));
}
}
SequenceGroup sg = new SequenceGroup(sequences, "", cs, true, true,
- false, 0, av.alignment.getWidth() - 1);
+ false, 0, av.getAlignment().getWidth() - 1);
sg.setName("JTreeGroup:" + sg.hashCode());
sg.setIdColour(col);
sg.getStartRes(), sg.getEndRes());
c.calculate();
- c.verdict(false, av.ConsPercGaps);
+ c.verdict(false, av.getConsPercGaps());
cs.setConservation(c);
sg.cs = cs;
}
- av.alignment.addGroup(sg);
+ av.getAlignment().addGroup(sg);
}
ap.updateAnnotation();
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
{
if (odata == null)
{
- tree = new NJTree(av.alignment.getSequencesArray(), newtree);
+ tree = new NJTree(av.getAlignment().getSequencesArray(), newtree);
}
else
{
- tree = new NJTree(av.alignment.getSequencesArray(), odata,
+ tree = new NJTree(av.getAlignment().getSequencesArray(), odata,
newtree);
}
if (av.getSelectionGroup() == null)
{
start = 0;
- end = av.alignment.getWidth();
- seqs = av.alignment.getSequencesArray();
+ end = av.getAlignment().getWidth();
+ seqs = av.getAlignment().getSequencesArray();
}
else
{
start = av.getSelectionGroup().getStartRes();
end = av.getSelectionGroup().getEndRes() + 1;
- seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+ seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
}
tree = new NJTree(seqs, seqStrings, type, pwtype, start, end);
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
* histogram.</li>
* <li>SHOW_CONSENSUS_LOGO (false) Show consensus annotation row's sequence
* logo.</li>
+ * <li>NORMALISE_CONSENSUS_LOGO (false) Show consensus annotation row's sequence
+ * logo normalised to row height rather than histogram height.</li>
* <li>FOLLOW_SELECTIONS (true) Controls whether a new alignment view should
* respond to selections made in other alignments containing the same sequences.
* </li>
System.setProperty("http.proxyPort", getDefault("PROXY_PORT", null));
}
+ // LOAD THE AUTHORS FROM THE authors.props file
+ try
+ {
+ String authorDetails = "jar:".concat(Cache.class.getProtectionDomain()
+ .getCodeSource().getLocation().toString()
+ .concat("!/authors.props"));
+
+ java.net.URL localJarFileURL = new java.net.URL(authorDetails);
+
+ InputStream in = localJarFileURL.openStream();
+ applicationProperties.load(in);
+ in.close();
+ } catch (Exception ex)
+ {
+ System.out.println("Error reading author details: " + ex);
+ applicationProperties.remove("AUTHORS");
+ applicationProperties.remove("AUTHORFNAMES");
+ applicationProperties.remove("YEAR");
+ }
+
// FIND THE VERSION NUMBER AND BUILD DATE FROM jalview.jar
// MUST FOLLOW READING OF LOCAL PROPERTIES FILE AS THE
// VERSION MAY HAVE CHANGED SINCE LAST USING JALVIEW
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
boolean seqlimits = suffix.equalsIgnoreCase("true");\r
if (alf.viewport.getSelectionGroup() != null)\r
{\r
+ // JBPNote: getSelectionAsNewSequence behaviour has changed - this method now returns a full copy of sequence data\r
+ // TODO consider using getSequenceSelection instead here\r
String reply = new AppletFormatAdapter().formatSequences(format,\r
new Alignment(alf.viewport.getSelectionAsNewSequence()),\r
seqlimits);\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public static final int PASTE = 3;
public static final int REPLACE = 4;
+
+ public static final int INSERT_NUC=5;
Edit[] edits;
case REPLACE:
replace(edits[e]);
break;
+ //TODO:add deleteNuc for UNDO
+// case INSERT_NUC:
+// insertNuc(edits[e]);
+// break;
}
}
}
case REPLACE:
replace(edits[e]);
break;
- }
+ }
}
}
{
command.seqs[s].insertCharAt(command.position, command.number,
command.gapChar);
+// System.out.println("pos: "+command.position+" number: "+command.number);
}
adjustAnnotations(command, true, false, null);
}
+//
+// final void insertNuc(Edit command)
+// {
+//
+// for (int s = 0; s < command.seqs.length; s++)
+// {
+// System.out.println("pos: "+command.position+" number: "+command.number);
+// command.seqs[s].insertCharAt(command.position, command.number,'A');
+// }
+//
+// adjustAnnotations(command, true, false, null);
+// }
final void deleteGap(Edit command)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public static final int PROTEIN = 0;
public static final int NUCLEOTIDE = 1;
+
+ public boolean hasRNAStructure = false;
/** DOCUMENT ME!! */
public AlignmentAnnotation[] annotations;
*/
public void addAnnotation(AlignmentAnnotation aa, int pos)
{
+ if(aa.getRNAStruc()!= null){
+ hasRNAStructure=true;
+ }
+
int aSize = 1;
if (annotations != null)
{
return false;
}
}
+
+ public boolean hasRNAStructure(){
+ //TODO can it happen that structure is removed from alignment?
+ return hasRNAStructure;
+ }
public void setDataset(Alignment data)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
*/
package jalview.datamodel;
+import jalview.analysis.Rna;
+import jalview.analysis.WUSSParseException;
+
import java.util.Enumeration;
import java.util.Hashtable;
public boolean autoCalculated = false;
public String annotationId;
-
+
public SequenceI sequenceRef;
/** DOCUMENT ME!! */
/** DOCUMENT ME!! */
public Annotation[] annotations;
+ /**
+ * RNA secondary structure contact positions
+ */
+ public SequenceFeature[] _rnasecstr = null;
+ /**
+ * position of annotation resulting in invalid WUSS parsing or -1
+ */
+ private long invalidrnastruc=-1;
+ /**
+ * Updates the _rnasecstr field Determines the positions that base pair and
+ * the positions of helices based on secondary structure from a Stockholm file
+ *
+ * @param RNAannot
+ */
+ private void _updateRnaSecStr(CharSequence RNAannot)
+ {
+ try {
+ _rnasecstr = Rna.GetBasePairs(RNAannot);
+ invalidrnastruc=-1;
+ }
+ catch (WUSSParseException px)
+ {
+ invalidrnastruc=px.getProblemPos();
+ }
+ if (invalidrnastruc>-1)
+ {
+ return;
+ }
+ Rna.HelixMap(_rnasecstr);
+ // setRNAStruc(RNAannot);
+
+ if (_rnasecstr != null && _rnasecstr.length > 0)
+ {
+ // show all the RNA secondary structure annotation symbols.
+ isrna=true;
+ showAllColLabels = true;
+ scaleColLabel = true;
+ }
+ // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
+ }
public java.util.Hashtable sequenceMapping;
/** DOCUMENT ME!! */
*/
public boolean centreColLabels = false;
+ private boolean isrna;
+
/*
* (non-Javadoc)
*
validateRangeAndDisplay();
}
+ /**
+ * Checks if annotation labels represent secondary structures
+ *
+ */
void areLabelsSecondaryStructure()
{
boolean nonSSLabel = false;
+ isrna = false;
+ StringBuffer rnastring = new StringBuffer();
+
char firstChar = 0;
for (int i = 0; i < annotations.length; i++)
{
{
hasIcons |= true;
}
+ else
+ // Check for RNA secondary structure
+ {
+ if (annotations[i].secondaryStructure == 'S')
+ {
+ hasIcons |= true;
+ isrna |= true;
+ }
+ }
+
+ // System.out.println("displaychar " + annotations[i].displayCharacter);
- if (annotations[i].displayCharacter == null)
+ if (annotations[i].displayCharacter == null
+ || annotations[i].displayCharacter.length() == 0)
{
+ rnastring.append('.');
continue;
}
if (annotations[i].displayCharacter.length() == 1)
firstChar != ' '
&& firstChar != 'H'
&& firstChar != 'E'
+ && firstChar != 'S'
&& firstChar != '-'
&& firstChar < jalview.schemes.ResidueProperties.aaIndex.length)
{
}
}
}
+ else
+ {
+ rnastring.append(annotations[i].displayCharacter.charAt(1));
+ }
if (annotations[i].displayCharacter.length() > 0)
{
}
}
+ else
+ {
+ if (isrna)
+ {
+ _updateRnaSecStr(new AnnotCharSequence());
+ }
+ }
annotationId = this.hashCode() + "";
}
-
/**
+ * flyweight access to positions in the alignment annotation row for RNA processing
+ * @author jimp
+ *
+ */
+ private class AnnotCharSequence implements CharSequence
+ {
+ int offset=0;
+ int max=0;
+
+ public AnnotCharSequence() {
+ this(0,annotations.length);
+ }
+ public AnnotCharSequence(int start, int end) {
+ offset=start;
+ max=end;
+ }
+ @Override
+ public CharSequence subSequence(int start, int end)
+ {
+ return new AnnotCharSequence(offset+start, offset+end);
+ }
+
+ @Override
+ public int length()
+ {
+ return max-offset;
+ }
+
+ @Override
+ public char charAt(int index)
+ {
+ String dc;
+ return ((index+offset<0) || (index+offset)>=max || annotations[index+offset]==null || (dc=annotations[index+offset].displayCharacter.trim()).length()<1)
+ ? '.' : dc.charAt(0);
+ }
+ public String toString()
+ {
+ char[] string=new char[max-offset];
+ int mx=annotations.length;
+
+ for (int i=offset;i<mx;i++)
+ {
+ String dc;
+ string[i]=(annotations[i]==null || (dc=annotations[i].displayCharacter.trim()).length()<1 )? '.' : dc.charAt(0);
+ }
+ return new String(string);
+ }
+ };
+
+ private long _lastrnaannot=-1;
+ public String getRNAStruc(){
+ if (isrna)
+ {
+ String rnastruc = new AnnotCharSequence().toString();
+ if (_lastrnaannot!=rnastruc.hashCode())
+ {
+ // ensure rna structure contacts are up to date
+ _lastrnaannot=rnastruc.hashCode();
+ _updateRnaSecStr(rnastruc);
+ }
+ return rnastruc;
+ }
+ return null;
+ }
+
+/**
* Creates a new AlignmentAnnotation object.
*
* @param label
* checks graphMin and graphMax, secondary structure symbols, sets graphType
* appropriately, sets null labels to the empty string if appropriate.
*/
- private void validateRangeAndDisplay()
+ public void validateRangeAndDisplay()
{
if (annotations == null)
}
return description;
}
+
+ public boolean isValidStruc()
+ {
+ return invalidrnastruc==-1;
+ }
+ public long getInvalidStrucPos()
+ {
+ return invalidrnastruc;
+ }
+
+ /**
+ * machine readable ID string indicating what generated this annotation
+ */
+ protected String calcId="";
+ public String getCalcId()
+ {
+ return calcId;
+ }
+
+ public void setCalcId(String calcId)
+ {
+ this.calcId = calcId;
+ }
+
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/**
* Deletes a specific AlignmentAnnotation from the alignment, and removes its
- * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
- * contained within the alignment's annotation vector. Otherwise, it will do
- * nothing.
+ * reference from any SequenceI or SequenceGroup object's annotation if and
+ * only if aa is contained within the alignment's annotation vector.
+ * Otherwise, it will do nothing.
*
* @param aa
* the annotation to delete
public boolean deleteAnnotation(AlignmentAnnotation aa);
/**
- * Deletes a specific AlignmentAnnotation from the alignment, and optionally removes any
- * reference from any SequenceI or SequenceGroup object's annotation if and only if aa is
- * contained within the alignment's annotation vector. Otherwise, it will do
- * nothing.
+ * Deletes a specific AlignmentAnnotation from the alignment, and optionally
+ * removes any reference from any SequenceI or SequenceGroup object's
+ * annotation if and only if aa is contained within the alignment's annotation
+ * vector. Otherwise, it will do nothing.
*
* @param aa
* the annotation to delete
* @param unhook
- * flag indicating if any references should be removed from annotation - use this if you intend to add the annotation back into the alignment
+ * flag indicating if any references should be removed from
+ * annotation - use this if you intend to add the annotation back
+ * into the alignment
* @return true if annotation was deleted from this alignment.
*/
public boolean deleteAnnotation(AlignmentAnnotation aa, boolean unhook);
public boolean isNucleotide();
/**
+ * Test if alignment contains RNA structure
+ *
+ * @return true if RNA structure AligmnentAnnotation was added to alignment
+ */
+ public boolean hasRNAStructure();
+
+ /**
* Set alignment to be a nucleotide sequence
*
*/
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public String description = ""; // currently used as mouse over
/** DOCUMENT ME!! */
- public char secondaryStructure = ' '; // recognises H and E
+ public char secondaryStructure = ' '; // recognises H, E and S(?)
/** DOCUMENT ME!! */
public float value;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
* PFAM ID\r
*/\r
public static String PFAM = "PFAM";\r
+ \r
+ /**\r
+ * RFAM ID\r
+ */\r
+ public static String RFAM = "RFAM";\r
\r
/**\r
* GeneDB ID\r
{ PDB };\r
\r
public static final String[] DOMAINDBS =\r
- { PFAM };\r
+ { PFAM, RFAM };\r
\r
/**\r
* set of unique DBRefSource property constants. These could be used to\r
public static final Object DNACODINGSEQDB = "XONCODING";\r
\r
/**\r
- * DB returns several sequences associated with a protein domain\r
+ * DB returns several sequences associated with a protein/nucleotide domain\r
*/\r
public static final Object DOMAINDB = "DOMAIN";\r
\r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public Hashtable otherDetails;
public java.util.Vector links;
-
+
// Feature group can be set from a features file
// as a group of features between STARTGROUP and ENDGROUP markers
public String featureGroup;
}
}
}
-
+
public SequenceFeature(String type, String desc, String status,
int begin, int end, String featureGroup)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
* consensus calculation property
*/
private boolean showSequenceLogo = false;
+ /**
+ * flag indicating if logo should be rendered normalised
+ */
+ private boolean normaliseSequenceLogo;
+
/**
* @return the includeAllConsSymbols
{
return showConsensusHistogram;
}
+
+ /**
+ * set flag indicating if logo should be normalised when rendered
+ * @param norm
+ */
+ public void setNormaliseSequenceLogo(boolean norm)
+ {
+ normaliseSequenceLogo=norm;
+ }
+ public boolean isNormaliseSequenceLogo()
+ {
+ return normaliseSequenceLogo;
+ }
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
+ * \r
+ * This file is part of Jalview.\r
+ * \r
+ * Jalview is free software: you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License \r
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
+ * \r
+ * Jalview is distributed in the hope that it will be useful, but \r
+ * WITHOUT ANY WARRANTY; without even the implied warranty \r
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
+ * PURPOSE. See the GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.\r
+ */\r
+package jalview.ext.varna;\r
+\r
+import java.io.File;\r
+\r
+import java.net.URL;\r
+import java.util.*;\r
+import java.applet.Applet;\r
+import java.awt.*;\r
+import java.awt.event.*;\r
+\r
+import javax.swing.JPanel;\r
+\r
+import jalview.api.AlignmentViewPanel;\r
+import jalview.api.FeatureRenderer;\r
+import jalview.api.SequenceRenderer;\r
+import jalview.api.SequenceStructureBinding;\r
+import jalview.api.StructureSelectionManagerProvider;\r
+import jalview.datamodel.*;\r
+import jalview.structure.*;\r
+import jalview.io.*;\r
+\r
+import org.jmol.api.*;\r
+import org.jmol.adapter.smarter.SmarterJmolAdapter;\r
+\r
+import org.jmol.popup.*;\r
+import org.jmol.viewer.JmolConstants;\r
+import org.jmol.viewer.Viewer;\r
+\r
+import jalview.schemes.*;\r
+\r
+import fr.orsay.lri.varna.applications.*;\r
+\r
+\r
+public abstract class JalviewVarnaBinding implements StructureListener, SequenceStructureBinding,\r
+ ComponentListener, StructureSelectionManagerProvider\r
+\r
+{\r
+ \r
+}\r
--- /dev/null
+/**\r
+ * \r
+ */\r
+package jalview.ext.varna;\r
+\r
+import jalview.api.FeatureRenderer;\r
+import jalview.api.SequenceRenderer;\r
+import jalview.datamodel.AlignmentI;\r
+import jalview.datamodel.SequenceI;\r
+import jalview.structure.StructureMapping;\r
+import jalview.structure.StructureSelectionManager;\r
+import jalview.util.Comparison;\r
+\r
+import java.awt.Color;\r
+import java.util.ArrayList;\r
+\r
+/**\r
+ * Routines for generating Jmol commands for Jalview/Jmol binding\r
+ * another cruisecontrol test.\r
+ * \r
+ * @author JimP\r
+ *\r
+ */\r
+public class VarnaCommands\r
+{\r
+\r
+ /**\r
+ * Jmol utility which constructs the commands to colour chains by the given alignment\r
+ * \r
+ */\r
+ public static String[] getColourBySequenceCommand(StructureSelectionManager ssm, String[] files, SequenceI[][] sequence, SequenceRenderer sr, FeatureRenderer fr, AlignmentI alignment)\r
+ {\r
+ ArrayList<String> str = new ArrayList<String>();\r
+ StringBuffer command = new StringBuffer();\r
+ \r
+ for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)\r
+ {\r
+ StructureMapping[] mapping = ssm.getMapping(files[pdbfnum]);\r
+ \r
+ if (mapping == null || mapping.length < 1)\r
+ continue;\r
+ \r
+ int lastPos = -1;\r
+ for (int s = 0; s < sequence[pdbfnum].length; s++)\r
+ {\r
+ for (int sp, m = 0; m < mapping.length; m++)\r
+ {\r
+ if (mapping[m].getSequence() == sequence[pdbfnum][s]\r
+ && (sp = alignment.findIndex(sequence[pdbfnum][s])) > -1)\r
+ {\r
+ SequenceI asp = alignment.getSequenceAt(sp);\r
+ for (int r = 0; r < asp.getLength(); r++)\r
+ {\r
+ // no mapping to gaps in sequence\r
+ if (jalview.util.Comparison.isGap(asp.getCharAt(r)))\r
+ {\r
+ continue;\r
+ }\r
+ int pos = mapping[m].getPDBResNum(asp.findPosition(r));\r
+ \r
+ if (pos < 1 || pos == lastPos)\r
+ continue;\r
+ \r
+ lastPos = pos;\r
+ \r
+ Color col = sr.getResidueBoxColour(sequence[pdbfnum][s], r);\r
+ \r
+ if (fr != null)\r
+ col = fr.findFeatureColour(col, sequence[pdbfnum][s], r);\r
+ String newSelcom = (mapping[m].getChain() != " " ? ":"\r
+ + mapping[m].getChain() : "")\r
+ + "/"\r
+ + (pdbfnum + 1)\r
+ + ".1"\r
+ + ";color["\r
+ + col.getRed()\r
+ + ","\r
+ + col.getGreen()\r
+ + ","\r
+ + col.getBlue() + "]";\r
+ if (command.length()>newSelcom.length() && command.substring(command.length()-newSelcom.length()).equals(newSelcom))\r
+ {\r
+ command = VarnaCommands.condenseCommand(command, pos);\r
+ continue;\r
+ }\r
+ // TODO: deal with case when buffer is too large for Jmol to parse\r
+ // - execute command and flush\r
+ \r
+ command.append(";");\r
+ if (command.length()>51200)\r
+ {\r
+ // add another chunk\r
+ str.add(command.toString());\r
+ command.setLength(0);\r
+ }\r
+ command.append("select " + pos);\r
+ command.append(newSelcom);\r
+ }\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ {\r
+ // add final chunk\r
+ str.add(command.toString());\r
+ command.setLength(0);\r
+ }\r
+ return str.toArray(new String[str.size()]);\r
+ }\r
+\r
+ public static StringBuffer condenseCommand(StringBuffer command, int pos)\r
+ {\r
+ \r
+ // work back to last 'select'\r
+ int p=command.length(),q=p;\r
+ do {\r
+ p-=6;\r
+ if (p<1) { p=0; };\r
+ } while ((q=command.indexOf("select",p))==-1 && p>0);\r
+ \r
+ StringBuffer sb = new StringBuffer(command.substring(0,q+7));\r
+ \r
+ command = command.delete(0,q+7);\r
+ \r
+ String start;\r
+ \r
+ if (command.indexOf("-") > -1)\r
+ {\r
+ start = command.substring(0, command.indexOf("-"));\r
+ }\r
+ else\r
+ {\r
+ start = command.substring(0, command.indexOf(":"));\r
+ }\r
+ \r
+ sb.append(start + "-" + pos + command.substring(command.indexOf(":")));\r
+ \r
+ return sb;\r
+ }\r
+\r
+}\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import jalview.schemes.HydrophobicColourScheme;
import jalview.schemes.NucleotideColourScheme;
import jalview.schemes.PIDColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.RNAHelicesColourChooser;
import jalview.schemes.ResidueProperties;
import jalview.schemes.StrandColourScheme;
import jalview.schemes.TaylorColourScheme;
*/
void init()
{
- if (viewport.conservation == null)
+ if (viewport.getAlignmentConservationAnnotation()== null)
{
BLOSUM62Colour.setEnabled(false);
conservationMenuItem.setEnabled(false);
{
this.setDropTarget(new java.awt.dnd.DropTarget(this, this));
addServiceListeners();
- setGUINucleotide(viewport.alignment.isNucleotide());
+ setGUINucleotide(viewport.getAlignment().isNucleotide());
}
setMenusFromViewport(viewport);
|| evt.isShiftDown() || evt.isAltDown());
}
break;
-
+
+ //case KeyEvent.VK_A:
+ // if (viewport.cursorMode)
+ // {
+ // alignPanel.seqPanel.insertNucAtCursor(false,"A");
+ // //System.out.println("A");
+ // }
+ // break;
+ /*
+ case KeyEvent.VK_CLOSE_BRACKET:
+ if (viewport.cursorMode)
+ {
+ System.out.println("closing bracket");
+ }
+ break;
+ */
case KeyEvent.VK_DELETE:
case KeyEvent.VK_BACK_SPACE:
if (!viewport.cursorMode)
if (newPanel)
{
- if (ap.av.padGaps)
+ if (ap.av.isPadGaps())
{
- ap.av.alignment.padGaps();
+ ap.av.getAlignment().padGaps();
}
ap.av.updateConservation(ap);
ap.av.updateConsensus(ap);
+ ap.av.updateStrucConsensus(ap);
}
}
conservationMenuItem.setEnabled(!nucleotide);
modifyConservation.setEnabled(!nucleotide);
showGroupConservation.setEnabled(!nucleotide);
+ rnahelicesColour.setEnabled(nucleotide);
+ purinePyrimidineColour.setEnabled(nucleotide);
// Remember AlignFrame always starts as protein
- if (!nucleotide)
- {
- calculateMenu.remove(calculateMenu.getItemCount() - 2);
- }
+ //if (!nucleotide)
+ // {
+ // showTr
+ // calculateMenu.remove(calculateMenu.getItemCount() - 2);
+ // }
}
/**
*/
void setMenusFromViewport(AlignViewport av)
{
- padGapsMenuitem.setSelected(av.padGaps);
+ padGapsMenuitem.setSelected(av.isPadGaps());
colourTextMenuItem.setSelected(av.showColourText);
abovePIDThreshold.setSelected(av.getAbovePIDThreshold());
conservationMenuItem.setSelected(av.getConservationSelected());
annotationPanelMenuItem.setState(av.showAnnotation);
viewBoxesMenuItem.setSelected(av.showBoxes);
viewTextMenuItem.setSelected(av.showText);
- showNonconservedMenuItem.setSelected(av.showUnconserved);
- showGroupConsensus.setSelected(av.showGroupConsensus);
- showGroupConservation.setSelected(av.showGroupConservation);
- showConsensusHistogram.setSelected(av.showConsensusHistogram);
- showSequenceLogo.setSelected(av.showSequenceLogo);
+ showNonconservedMenuItem.setSelected(av.getShowUnconserved());
+ showGroupConsensus.setSelected(av.isShowGroupConsensus());
+ showGroupConservation.setSelected(av.isShowGroupConservation());
+ showConsensusHistogram.setSelected(av.isShowConsensusHistogram());
+ showSequenceLogo.setSelected(av.isShowSequenceLogo());
+ normaliseSequenceLogo.setSelected(av.isNormaliseSequenceLogo());
+
setColourSelected(ColourSchemeProperty.getColourName(av
.getGlobalColourScheme()));
autoCalculate.setSelected(av.autoCalculateConsensus);
sortByTree.setSelected(av.sortByTree);
listenToViewSelections.setSelected(av.followSelection);
-
+ rnahelicesColour.setEnabled(av.getAlignment().hasRNAStructure());
+ rnahelicesColour.setSelected(av.getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
setShowProductsEnabled();
updateEditMenuBar();
String[] omitHidden = null;
- if (viewport.hasHiddenColumns)
+ if (viewport.hasHiddenColumns())
{
int reply = JOptionPane
.showInternalConfirmDialog(
}
FormatAdapter f = new FormatAdapter();
String output = f.formatSequences(format,
- (Alignment) viewport.alignment, // class cast exceptions will
+ (Alignment) viewport.getAlignment(), // class cast exceptions will
// occur in the distant future
- omitHidden, f.getCacheSuffixDefault(format), viewport.colSel);
+ omitHidden, f.getCacheSuffixDefault(format), viewport.getColumnSelection());
if (output == null)
{
{
String[] omitHidden = null;
- if (viewport.hasHiddenColumns)
+ if (viewport.hasHiddenColumns())
{
int reply = JOptionPane
.showInternalConfirmDialog(
try
{
cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
- viewport.alignment, omitHidden, viewport.colSel));
+ viewport.getAlignment(), omitHidden, viewport.getColumnSelection()));
Desktop.addInternalFrame(cap,
"Alignment output - " + e.getActionCommand(), 600, 500);
} catch (OutOfMemoryError oom)
{
new AnnotationExporter().exportAnnotations(
alignPanel,
- viewport.showAnnotation ? viewport.alignment
- .getAlignmentAnnotation() : null, viewport.alignment
+ viewport.showAnnotation ? viewport.getAlignment()
+ .getAlignmentAnnotation() : null, viewport.getAlignment()
.getGroups(),
- ((Alignment) viewport.alignment).alignmentProperties);
+ ((Alignment) viewport.getAlignment()).alignmentProperties);
}
public void associatedData_actionPerformed(ActionEvent e)
viewport.historyList.push(command);
viewport.redoList.clear();
updateEditMenuBar();
- viewport.hasHiddenColumns = (viewport.colSel != null
- && viewport.colSel.getHiddenColumns() != null && viewport.colSel
- .getHiddenColumns().size() > 0);
+ viewport.updateHiddenColumns();
+// viewport.hasHiddenColumns = (viewport.getColumnSelection() != null
+// && viewport.getColumnSelection().getHiddenColumns() != null && viewport.getColumnSelection()
+// .getHiddenColumns().size() > 0);
}
}
if (viewport != null)
{
return new AlignmentI[]
- { viewport.alignment };
+ { viewport.getAlignment() };
}
return null;
}
if (originalSource != null)
{
- originalSource.hasHiddenColumns = (viewport.colSel != null
- && viewport.colSel.getHiddenColumns() != null && viewport.colSel
- .getHiddenColumns().size() > 0);
+ if (originalSource!=viewport)
+ {
+ Cache.log.warn("Implementation worry: mismatch of viewport origin for undo");
+ }
+ originalSource.updateHiddenColumns();
+// originalSource.hasHiddenColumns = (viewport.getColumnSelection() != null
+// && viewport.getColumnSelection().getHiddenColumns() != null && viewport.getColumnSelection()
+// .getHiddenColumns().size() > 0);
originalSource.firePropertyChange("alignment", null,
- originalSource.alignment.getSequences());
+ originalSource.getAlignment().getSequences());
}
}
if (originalSource != null)
{
- originalSource.hasHiddenColumns = (viewport.colSel != null
- && viewport.colSel.getHiddenColumns() != null && viewport.colSel
- .getHiddenColumns().size() > 0);
+
+ if (originalSource!=viewport)
+ {
+ Cache.log.warn("Implementation worry: mismatch of viewport origin for redo");
+ }
+ originalSource.updateHiddenColumns();
+ //originalSource.hasHiddenColumns = (viewport.getColumnSelection() != null
+ // && viewport.getColumnSelection().getHiddenColumns() != null && viewport.getColumnSelection()
+ // .getHiddenColumns().size() > 0);
originalSource.firePropertyChange("alignment", null,
- originalSource.alignment.getSequences());
+ originalSource.getAlignment().getSequences());
}
}
{
if (comps.elementAt(i) instanceof AlignmentPanel)
{
- if (al == ((AlignmentPanel) comps.elementAt(i)).av.alignment)
+ if (al == ((AlignmentPanel) comps.elementAt(i)).av.getAlignment())
{
originalSource = ((AlignmentPanel) comps.elementAt(i)).av;
break;
// the current view against the closed view first
if (al != null)
{
- PaintRefresher.validateSequences(al, viewport.alignment);
+ PaintRefresher.validateSequences(al, viewport.getAlignment());
}
originalSource = viewport;
if (up)
{
- for (int i = 1; i < viewport.alignment.getHeight(); i++)
+ for (int i = 1; i < viewport.getAlignment().getHeight(); i++)
{
- SequenceI seq = viewport.alignment.getSequenceAt(i);
+ SequenceI seq = viewport.getAlignment().getSequenceAt(i);
if (!sg.getSequences(null).contains(seq))
{
continue;
}
- SequenceI temp = viewport.alignment.getSequenceAt(i - 1);
+ SequenceI temp = viewport.getAlignment().getSequenceAt(i - 1);
if (sg.getSequences(null).contains(temp))
{
continue;
}
- viewport.alignment.getSequences().setElementAt(temp, i);
- viewport.alignment.getSequences().setElementAt(seq, i - 1);
+ viewport.getAlignment().getSequences().setElementAt(temp, i);
+ viewport.getAlignment().getSequences().setElementAt(seq, i - 1);
}
}
else
{
- for (int i = viewport.alignment.getHeight() - 2; i > -1; i--)
+ for (int i = viewport.getAlignment().getHeight() - 2; i > -1; i--)
{
- SequenceI seq = viewport.alignment.getSequenceAt(i);
+ SequenceI seq = viewport.getAlignment().getSequenceAt(i);
if (!sg.getSequences(null).contains(seq))
{
continue;
}
- SequenceI temp = viewport.alignment.getSequenceAt(i + 1);
+ SequenceI temp = viewport.getAlignment().getSequenceAt(i + 1);
if (sg.getSequences(null).contains(temp))
{
continue;
}
- viewport.alignment.getSequences().setElementAt(temp, i);
- viewport.alignment.getSequences().setElementAt(seq, i + 1);
+ viewport.getAlignment().getSequences().setElementAt(temp, i);
+ viewport.getAlignment().getSequences().setElementAt(seq, i + 1);
}
}
Vector sg = new Vector();
if (viewport.cursorMode)
{
- sg.addElement(viewport.alignment
+ sg.addElement(viewport.getAlignment()
.getSequenceAt(alignPanel.seqPanel.seqCanvas.cursorY));
}
else if (viewport.getSelectionGroup() != null
- && viewport.getSelectionGroup().getSize() != viewport.alignment
+ && viewport.getSelectionGroup().getSize() != viewport.getAlignment()
.getHeight())
{
sg = viewport.getSelectionGroup().getSequences(
- viewport.hiddenRepSequences);
+ viewport.getHiddenRepSequences());
}
if (sg.size() < 1)
Vector invertGroup = new Vector();
- for (int i = 0; i < viewport.alignment.getHeight(); i++)
+ for (int i = 0; i < viewport.getAlignment().getHeight(); i++)
{
- if (!sg.contains(viewport.alignment.getSequenceAt(i)))
- invertGroup.add(viewport.alignment.getSequenceAt(i));
+ if (!sg.contains(viewport.getAlignment().getSequenceAt(i)))
+ invertGroup.add(viewport.getAlignment().getSequenceAt(i));
}
SequenceI[] seqs1 = new SequenceI[sg.size()];
SequenceI[] seqs = viewport.getSelectionAsNewSequence();
String[] omitHidden = null;
- if (viewport.hasHiddenColumns)
+ if (viewport.hasHiddenColumns())
{
omitHidden = viewport.getViewAsString(true);
}
}
Vector hiddenColumns = null;
- if (viewport.hasHiddenColumns)
+ if (viewport.hasHiddenColumns())
{
hiddenColumns = new Vector();
int hiddenOffset = viewport.getSelectionGroup().getStartRes(), hiddenCutoff = viewport
}
Desktop.jalviewClipboard = new Object[]
- { seqs, viewport.alignment.getDataset(), hiddenColumns };
+ { seqs, viewport.getAlignment().getDataset(), hiddenColumns };
statusBar.setText("Copied " + seqs.length + " sequences to clipboard.");
}
}
// If the cut affects all sequences, remove highlighted columns
- if (sg.getSize() == viewport.alignment.getHeight())
+ if (sg.getSize() == viewport.getAlignment().getHeight())
{
viewport.getColumnSelection().removeElements(sg.getStartRes(),
sg.getEndRes() + 1);
*/
addHistoryItem(new EditCommand("Cut Sequences", EditCommand.CUT, cut,
sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,
- viewport.alignment));
+ viewport.getAlignment()));
viewport.setSelectionGroup(null);
viewport.sendSelection();
- viewport.alignment.deleteGroup(sg);
+ viewport.getAlignment().deleteGroup(sg);
viewport.firePropertyChange("alignment", null, viewport.getAlignment()
.getSequences());
*/
protected void deleteGroups_actionPerformed(ActionEvent e)
{
- viewport.alignment.deleteAllGroups();
+ viewport.getAlignment().deleteAllGroups();
viewport.sequenceColours = null;
viewport.setSelectionGroup(null);
PaintRefresher.Refresh(this, viewport.getSequenceSetId());
sg.addSequence(viewport.getAlignment().getSequenceAt(i), false);
}
- sg.setEndRes(viewport.alignment.getWidth() - 1);
+ sg.setEndRes(viewport.getAlignment().getWidth() - 1);
viewport.setSelectionGroup(sg);
viewport.sendSelection();
alignPanel.paintAlignment(true);
if (viewport.getSelectionGroup() != null)
{
seqs = viewport.getSelectionGroup().getSequencesAsArray(
- viewport.hiddenRepSequences);
+ viewport.getHiddenRepSequences());
}
else
{
- seqs = viewport.alignment.getSequencesArray();
+ seqs = viewport.getAlignment().getSequencesArray();
}
TrimRegionCommand trimRegion;
{
trimRegion = new TrimRegionCommand("Remove Left",
TrimRegionCommand.TRIM_LEFT, seqs, column,
- viewport.alignment, viewport.colSel,
- viewport.selectionGroup);
+ viewport.getAlignment(), viewport.getColumnSelection(),
+ viewport.getSelectionGroup());
viewport.setStartRes(0);
}
else
{
trimRegion = new TrimRegionCommand("Remove Right",
TrimRegionCommand.TRIM_RIGHT, seqs, column,
- viewport.alignment, viewport.colSel,
- viewport.selectionGroup);
+ viewport.getAlignment(), viewport.getColumnSelection(),
+ viewport.getSelectionGroup());
}
statusBar.setText("Removed " + trimRegion.getSize() + " columns.");
addHistoryItem(trimRegion);
- Vector groups = viewport.alignment.getGroups();
+ Vector groups = viewport.getAlignment().getGroups();
for (int i = 0; i < groups.size(); i++)
{
if ((trimLeft && !sg.adjustForRemoveLeft(column))
|| (!trimLeft && !sg.adjustForRemoveRight(column)))
{
- viewport.alignment.deleteGroup(sg);
+ viewport.getAlignment().deleteGroup(sg);
}
}
*/
public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
{
- int start = 0, end = viewport.alignment.getWidth() - 1;
+ int start = 0, end = viewport.getAlignment().getWidth() - 1;
SequenceI[] seqs;
if (viewport.getSelectionGroup() != null)
{
seqs = viewport.getSelectionGroup().getSequencesAsArray(
- viewport.hiddenRepSequences);
+ viewport.getHiddenRepSequences());
start = viewport.getSelectionGroup().getStartRes();
end = viewport.getSelectionGroup().getEndRes();
}
else
{
- seqs = viewport.alignment.getSequencesArray();
+ seqs = viewport.getAlignment().getSequencesArray();
}
RemoveGapColCommand removeGapCols = new RemoveGapColCommand(
- "Remove Gapped Columns", seqs, start, end, viewport.alignment);
+ "Remove Gapped Columns", seqs, start, end, viewport.getAlignment());
addHistoryItem(removeGapCols);
// This is to maintain viewport position on first residue
// of first sequence
- SequenceI seq = viewport.alignment.getSequenceAt(0);
+ SequenceI seq = viewport.getAlignment().getSequenceAt(0);
int startRes = seq.findPosition(viewport.startRes);
// ShiftList shifts;
// viewport.getAlignment().removeGaps(shifts=new ShiftList());
*/
public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
{
- int start = 0, end = viewport.alignment.getWidth() - 1;
+ int start = 0, end = viewport.getAlignment().getWidth() - 1;
SequenceI[] seqs;
if (viewport.getSelectionGroup() != null)
{
seqs = viewport.getSelectionGroup().getSequencesAsArray(
- viewport.hiddenRepSequences);
+ viewport.getHiddenRepSequences());
start = viewport.getSelectionGroup().getStartRes();
end = viewport.getSelectionGroup().getEndRes();
}
else
{
- seqs = viewport.alignment.getSequencesArray();
+ seqs = viewport.getAlignment().getSequencesArray();
}
// This is to maintain viewport position on first residue
// of first sequence
- SequenceI seq = viewport.alignment.getSequenceAt(0);
+ SequenceI seq = viewport.getAlignment().getSequenceAt(0);
int startRes = seq.findPosition(viewport.startRes);
addHistoryItem(new RemoveGapsCommand("Remove Gaps", seqs, start, end,
- viewport.alignment));
+ viewport.getAlignment()));
viewport.setStartRes(seq.findIndex(startRes) - 1);
*/
public void padGapsMenuitem_actionPerformed(ActionEvent e)
{
- viewport.padGaps = padGapsMenuitem.isSelected();
+ viewport.setPadGaps(padGapsMenuitem.isSelected());
viewport.firePropertyChange("alignment", null, viewport.getAlignment()
.getSequences());
}
if (!copyAnnotation)
{
// just remove all the current annotation except for the automatic stuff
- newap.av.alignment.deleteAllGroups();
- for (AlignmentAnnotation alan : newap.av.alignment
+ newap.av.getAlignment().deleteAllGroups();
+ for (AlignmentAnnotation alan : newap.av.getAlignment()
.getAlignmentAnnotation())
{
if (!alan.autoCalculated)
{
- newap.av.alignment.deleteAnnotation(alan);
+ newap.av.getAlignment().deleteAnnotation(alan);
}
;
}
// Hide everything by the current selection - this is a hack - we do the
// invert and then hide
// first check that there will be visible columns after the invert.
- if ((viewport.colSel != null && viewport.colSel.getSelected() != null && viewport.colSel
+ if ((viewport.getColumnSelection() != null && viewport.getColumnSelection().getSelected() != null && viewport.getColumnSelection()
.getSelected().size() > 0)
|| (sg != null && sg.getSize() > 0 && sg.getStartRes() <= sg
.getEndRes()))
if (toggleSeqs)
{
- if (sg != null && sg.getSize() != viewport.alignment.getHeight())
+ if (sg != null && sg.getSize() != viewport.getAlignment().getHeight())
{
hideSelSequences_actionPerformed(null);
hide = true;
}
- else if (!(toggleCols && viewport.colSel.getSelected().size() > 0))
+ else if (!(toggleCols && viewport.getColumnSelection().getSelected().size() > 0))
{
showAllSeqs_actionPerformed(null);
}
if (toggleCols)
{
- if (viewport.colSel.getSelected().size() > 0)
+ if (viewport.getColumnSelection().getSelected().size() > 0)
{
hideSelColumns_actionPerformed(null);
if (!toggleSeqs)
{
- viewport.selectionGroup = sg;
+ viewport.setSelectionGroup(sg);
}
}
else if (!hide)
{
JEditorPane editPane = new JEditorPane("text/html", "");
editPane.setEditable(false);
- StringBuffer contents = new AlignmentProperties(viewport.alignment)
+ StringBuffer contents = new AlignmentProperties(viewport.getAlignment())
.formatAsHtml();
editPane.setText("<html>" + contents.toString() + "</html>");
JInternalFrame frame = new JInternalFrame();
public void clustalColour_actionPerformed(ActionEvent e)
{
changeColour(new ClustalxColourScheme(
- viewport.alignment.getSequences(),
- viewport.alignment.getWidth()));
+ viewport.getAlignment().getSequences(),
+ viewport.getAlignment().getWidth()));
}
/**
changeColour(new NucleotideColourScheme());
}
+ public void purinePyrimidineColour_actionPerformed(ActionEvent e)
+ {
+ changeColour(new PurinePyrimidineColourScheme());
+ }
+ /*
+ public void covariationColour_actionPerformed(ActionEvent e)
+ {
+ changeColour(new CovariationColourScheme(viewport.getAlignment().getAlignmentAnnotation()[0]));
+ }
+ */
public void annotationColour_actionPerformed(ActionEvent e)
{
new AnnotationColourChooser(viewport, alignPanel);
}
+
+ public void rnahelicesColour_actionPerformed(ActionEvent e)
+ {
+ new RNAHelicesColourChooser(viewport, alignPanel);
+ }
/**
* DOCUMENT ME!
if (viewport.getConservationSelected())
{
- Alignment al = (Alignment) viewport.alignment;
+ Alignment al = (Alignment) viewport.getAlignment();
Conservation c = new Conservation("All",
ResidueProperties.propHash, 3, al.getSequences(), 0,
al.getWidth() - 1);
c.calculate();
- c.verdict(false, viewport.ConsPercGaps);
+ c.verdict(false, viewport.getConsPercGaps());
cs.setConservation(c);
cs.setConservation(null);
}
- cs.setConsensus(viewport.hconsensus);
+ cs.setConsensus(viewport.getSequenceConsensusHash());
}
viewport.setGlobalColourScheme(cs);
if (viewport.getColourAppliesToAllGroups())
{
- Vector groups = viewport.alignment.getGroups();
+ Vector groups = viewport.getAlignment().getGroups();
for (int i = 0; i < groups.size(); i++)
{
if (cs instanceof ClustalxColourScheme)
{
sg.cs = new ClustalxColourScheme(
- sg.getSequences(viewport.hiddenRepSequences),
+ sg.getSequences(viewport.getHiddenRepSequences()),
sg.getWidth());
}
else if (cs instanceof UserColourScheme)
sg.cs.setThreshold(threshold, viewport.getIgnoreGapsConsensus());
sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(viewport.hiddenRepSequences),
+ sg.getSequences(viewport.getHiddenRepSequences()),
sg.getStartRes(), sg.getEndRes() + 1));
}
else
{
Conservation c = new Conservation("Group",
ResidueProperties.propHash, 3,
- sg.getSequences(viewport.hiddenRepSequences),
+ sg.getSequences(viewport.getHiddenRepSequences()),
sg.getStartRes(), sg.getEndRes() + 1);
c.calculate();
- c.verdict(false, viewport.ConsPercGaps);
+ c.verdict(false, viewport.getConsPercGaps());
sg.cs.setConservation(c);
}
else
protected void modifyPID_actionPerformed(ActionEvent e)
{
if (viewport.getAbovePIDThreshold()
- && viewport.globalColourScheme != null)
+ && viewport.getGlobalColourScheme() != null)
{
SliderPanel.setPIDSliderSource(alignPanel,
viewport.getGlobalColourScheme(), "Background");
protected void modifyConservation_actionPerformed(ActionEvent e)
{
if (viewport.getConservationSelected()
- && viewport.globalColourScheme != null)
+ && viewport.getGlobalColourScheme()!= null)
{
SliderPanel.setConservationSlider(alignPanel,
- viewport.globalColourScheme, "Background");
+ viewport.getGlobalColourScheme(), "Background");
SliderPanel.showConservationSlider();
}
}
AlignmentSorter.sortByPID(viewport.getAlignment(), viewport
.getAlignment().getSequenceAt(0), null);
addHistoryItem(new OrderCommand("Pairwise Sort", oldOrder,
- viewport.alignment));
+ viewport.getAlignment()));
alignPanel.paintAlignment(true);
}
{
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
AlignmentSorter.sortByID(viewport.getAlignment());
- addHistoryItem(new OrderCommand("ID Sort", oldOrder, viewport.alignment));
+ addHistoryItem(new OrderCommand("ID Sort", oldOrder, viewport.getAlignment()));
alignPanel.paintAlignment(true);
}
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
AlignmentSorter.sortByLength(viewport.getAlignment());
addHistoryItem(new OrderCommand("Length Sort", oldOrder,
- viewport.alignment));
+ viewport.getAlignment()));
alignPanel.paintAlignment(true);
}
SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
AlignmentSorter.sortByGroup(viewport.getAlignment());
addHistoryItem(new OrderCommand("Group Sort", oldOrder,
- viewport.alignment));
+ viewport.getAlignment()));
alignPanel.paintAlignment(true);
}
else
{
// are the visible sequences aligned?
- if (!viewport.alignment.isAligned(false))
+ if (!viewport.getAlignment().isAligned(false))
{
JOptionPane
.showMessageDialog(
return;
}
- if (viewport.alignment.getHeight() < 2)
+ if (viewport.getAlignment().getHeight() < 2)
{
return;
}
AlignmentSorter.sortBy(viewport.getAlignment(), order);
addHistoryItem(new OrderCommand(order.getName(), oldOrder,
- viewport.alignment));
+ viewport.getAlignment()));
alignPanel.paintAlignment(true);
}
AlignmentSorter.sortByAnnotationScore(scoreLabel,
viewport.getAlignment());// ,viewport.getSelectionGroup());
addHistoryItem(new OrderCommand("Sort by " + scoreLabel, oldOrder,
- viewport.alignment));
+ viewport.getAlignment()));
alignPanel.paintAlignment(true);
}
});
*/
public void buildSortByAnnotationScoresMenu()
{
- if (viewport.alignment.getAlignmentAnnotation() == null)
+ if (viewport.getAlignment().getAlignmentAnnotation() == null)
{
return;
}
- if (viewport.alignment.getAlignmentAnnotation().hashCode() != _annotationScoreVectorHash)
+ if (viewport.getAlignment().getAlignmentAnnotation().hashCode() != _annotationScoreVectorHash)
{
sortByAnnotScore.removeAll();
// almost certainly a quicker way to do this - but we keep it simple
Hashtable scoreSorts = new Hashtable();
AlignmentAnnotation aann[];
- Enumeration sq = viewport.alignment.getSequences().elements();
+ Enumeration sq = viewport.getAlignment().getSequences().elements();
while (sq.hasMoreElements())
{
aann = ((SequenceI) sq.nextElement()).getAnnotation();
sortByAnnotScore.setVisible(scoreSorts.size() > 0);
scoreSorts.clear();
- _annotationScoreVectorHash = viewport.alignment
+ _annotationScoreVectorHash = viewport.getAlignment()
.getAlignmentAnnotation().hashCode();
}
}
if (undoname != null)
{
addHistoryItem(new OrderCommand(undoname, oldOrder,
- viewport.alignment));
+ viewport.getAlignment()));
}
alignPanel.paintAlignment(true);
return true;
}
// limit sequences - JBPNote in future - could spawn multiple prediction
// jobs
- // TODO: viewport.alignment.isAligned is a global state - the local
+ // TODO: viewport.getAlignment().isAligned is a global state - the local
// selection may well be aligned - we preserve 2.0.8 behaviour for moment.
- if (!viewport.alignment.isAligned(false))
+ if (!viewport.getAlignment().isAligned(false))
{
seqs.setSequences(new SeqCigar[]
{ seqs.getSequences()[0] });
}
}
- // TODO: move into separate menu builder class.
- if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
- {
- Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
- if (jws2servs != null)
- {
- if (jws2servs.hasServices())
- {
- jws2servs.attachWSMenuEntry(msawsmenu, me);
- }
- }
- }
+
// Add all submenus in the order they should appear on the web services menu
wsmenu.add(msawsmenu);
wsmenu.add(secstrmenu);
+ wsmenu.add(new JMenu("Disorder"));
wsmenu.add(analymenu);
+
// No search services yet
// wsmenu.add(seqsrchmenu);
{
webService.add(me.webServiceNoServices);
}
+ // TODO: move into separate menu builder class.
+ if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
+ {
+ Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
+ if (jws2servs != null)
+ {
+ if (jws2servs.hasServices())
+ {
+ jws2servs.attachWSMenuEntry(webService, me);
+ }
+ }
+ }
+
build_urlServiceMenu(me.webService);
build_fetchdbmenu(webService);
} catch (Exception e)
* AlignFrame af = this; testAlView.addActionListener(new ActionListener() {
*
* @Override public void actionPerformed(ActionEvent e) {
- * jalview.datamodel.AlignmentView.testSelectionViews(af.viewport.alignment,
- * af.viewport.colSel, af.viewport.selectionGroup); }
+ * jalview.datamodel.AlignmentView.testSelectionViews(af.viewport.getAlignment(),
+ * af.viewport.getColumnSelection(), af.viewport.selectionGroup); }
*
* }); webService.add(testAlView);
*/
ths.setProgressBar("Searching for sequences from " + fsrc, sttime);
try
{
- Alignment ds = ths.getViewport().alignment.getDataset(); // update
+ Alignment ds = ths.getViewport().getAlignment().getDataset(); // update
// our local
// dataset
// reference
{
al = jalview.analysis.Dna.CdnaTranslate(selection, seqstring,
viewport.getViewAsVisibleContigs(true), viewport
- .getGapCharacter(), viewport.alignment
- .getAlignmentAnnotation(), viewport.alignment
+ .getGapCharacter(), viewport.getAlignment()
+ .getAlignmentAnnotation(), viewport.getAlignment()
.getWidth(), viewport.getAlignment().getDataset());
} catch (Exception ex)
{
try
{
featuresFile = new FeaturesFile(file, type)
- .parse(viewport.alignment.getDataset(),
+ .parse(viewport.getAlignment().getDataset(),
alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureColours,
false, jalview.bin.Cache.getDefault(
"RELAXEDSEQIDMATCHING", false));
// try to parse as annotation.
boolean isAnnotation = (format == null || format
.equalsIgnoreCase("PFAM")) ? new AnnotationFile()
- .readAnnotationFile(viewport.alignment, file, protocol)
+ .readAnnotationFile(viewport.getAlignment(), file, protocol)
: false;
if (!isAnnotation)
protected void extractScores_actionPerformed(ActionEvent e)
{
ParseProperties pp = new jalview.analysis.ParseProperties(
- viewport.alignment);
+ viewport.getAlignment());
// TODO: verify regex and introduce GUI dialog for version 2.5
// if (pp.getScoresFromDescription("col", "score column ",
// "\\W*([-+]?\\d*\\.?\\d*e?-?\\d*)\\W+([-+]?\\d*\\.?\\d*e?-?\\d*)",
viewport.setShowSequenceLogo(showSequenceLogo.getState());
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
-
+ protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
+ {
+ viewport.setNormaliseSequenceLogo(normaliseSequenceLogo.getState());
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+ }
protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
{
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
viewport.getSequenceSelection(),
viewport.getAlignmentView(true).getSequenceStrings(
viewport.getGapCharacter()),
- viewport.alignment.getGroups());
- viewport.alignment.deleteAllGroups();
+ viewport.getAlignment().getGroups());
+ viewport.getAlignment().deleteAllGroups();
viewport.sequenceColours = null;
viewport.setSelectionGroup(null);
// set view properties for each group
{
gps[g].setShowNonconserved(viewport.getShowUnconserved());
gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo());
- viewport.alignment.addGroup(gps[g]);
+ viewport.getAlignment().addGroup(gps[g]);
Color col = new Color((int) (Math.random() * 255),
(int) (Math.random() * 255), (int) (Math.random() * 255));
col = col.brighter();
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import java.awt.*;
import jalview.analysis.*;
-import jalview.api.StructureSelectionManagerProvider;
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.OOMHandlerI;
import jalview.bin.*;
import jalview.structure.SelectionSource;
import jalview.structure.StructureSelectionManager;
import jalview.structure.VamsasSource;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.workers.AlignCalcManager;
+import jalview.workers.ConsensusThread;
+import jalview.workers.ConservationThread;
+import jalview.workers.StrucConsensusThread;
/**
* DOCUMENT ME!
* @author $author$
* @version $Revision: 1.141 $
*/
-public class AlignViewport implements SelectionSource, VamsasSource
+public class AlignViewport extends AlignmentViewport implements SelectionSource, VamsasSource, AlignViewportI
{
private static final int RIGHT_JUSTIFY = 1;
boolean colourAppliesToAllGroups = true;
- ColourSchemeI globalColourScheme = null;
-
boolean conservationColourSelected = false;
boolean abovePIDThreshold = false;
- SequenceGroup selectionGroup;
-
int charHeight;
int charWidth;
boolean seqNameItalics;
- AlignmentI alignment;
-
- ColumnSelection colSel = new ColumnSelection();
-
int threshold;
int increment;
boolean scaleRightWrapped = true;
- boolean hasHiddenColumns = false;
-
- boolean hasHiddenRows = false;
-
boolean showHiddenMarkers = true;
boolean cursorMode = false;
*/
Hashtable featuresDisplayed = null;
- /** DOCUMENT ME!! */
- public Hashtable[] hconsensus;
-
- AlignmentAnnotation consensus;
-
- AlignmentAnnotation conservation;
-
- AlignmentAnnotation quality;
-
- AlignmentAnnotation[] groupConsensus;
-
- AlignmentAnnotation[] groupConservation;
-
- boolean autoCalculateConsensus = true;
-
- /** DOCUMENT ME!! */
- public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
-
- // JBPNote Prolly only need this in the applet version.
- private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
- this);
-
- boolean ignoreGapsInConsensusCalculation = false;
-
- boolean isDataset = false;
-
boolean antiAlias = false;
- boolean padGaps = false;
-
Rectangle explodedPosition;
String viewName;
- String sequenceSetID;
-
boolean gatherViewsHere = false;
Stack historyList = new Stack();
boolean rightAlignIds = false;
- Hashtable hiddenRepSequences;
-
- boolean sortByTree;
-
/**
* Creates a new AlignViewport object.
*
centreColumnLabels = Cache.getDefault("CENTRE_COLUMN_LABELS", false);
autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
- padGaps = Cache.getDefault("PAD_GAPS", true);
+ setPadGaps(Cache.getDefault("PAD_GAPS", true));
shownpfeats = Cache.getDefault("SHOW_NPFEATS_TOOLTIP", true);
showdbrefs = Cache.getDefault("SHOW_DBREFS_TOOLTIP", true);
{
if (!alignment.isNucleotide())
{
- conservation = new AlignmentAnnotation("Conservation",
- "Conservation of total alignment less than " + ConsPercGaps
- + "% gaps", new Annotation[1], 0f, 11f,
- AlignmentAnnotation.BAR_GRAPH);
- conservation.hasText = true;
- conservation.autoCalculated = true;
-
- if (Cache.getDefault("SHOW_CONSERVATION", true))
- {
- alignment.addAnnotation(conservation);
- }
-
- if (Cache.getDefault("SHOW_QUALITY", true))
- {
- quality = new AlignmentAnnotation("Quality",
- "Alignment Quality based on Blosum62 scores",
- new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
- quality.hasText = true;
- quality.autoCalculated = true;
-
- alignment.addAnnotation(quality);
- }
+ showConservation=Cache.getDefault("SHOW_CONSERVATION", true);
+ showQuality=Cache.getDefault("SHOW_QUALITY", true);
showGroupConservation = Cache.getDefault("SHOW_GROUP_CONSERVATION",
false);
-
- {
-
- }
- }
+ }
showConsensusHistogram = Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM",
true);
showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", false);
+ normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO", false);
showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
- // TODO: add menu option action that nulls or creates consensus object
- // depending on if the user wants to see the annotation or not in a
- // specific alignment
+ showConsensus=Cache.getDefault("SHOW_IDENTITY", true);
consensus = new AlignmentAnnotation("Consensus", "PID",
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
consensus.hasText = true;
consensus.autoCalculated = true;
-
- if (Cache.getDefault("SHOW_IDENTITY", true))
- {
- alignment.addAnnotation(consensus);
- }
}
-
+ initAutoAnnotation();
if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
{
globalColourScheme = ColourSchemeProperty.getColour(alignment,
return showSequenceFeatures;
}
- ConservationThread conservationThread;
-
- ConsensusThread consensusThread;
-
- boolean consUpdateNeeded = false;
-
- static boolean UPDATING_CONSENSUS = false;
-
- static boolean UPDATING_CONSERVATION = false;
-
- boolean updatingConsensus = false;
-
- boolean updatingConservation = false;
-
/**
* centre columnar annotation labels in displayed alignment annotation TODO:
* add to jalviewXML and annotation display settings
private boolean shownpfeats;
- /**
- * trigger update of conservation annotation
- */
- public void updateConservation(final AlignmentPanel ap)
- {
- // see note in mantis : issue number 8585
- if (alignment.isNucleotide() || conservation == null
- || !autoCalculateConsensus)
- {
- return;
- }
-
- conservationThread = new ConservationThread(this, ap);
- conservationThread.start();
- }
-
- /**
- * trigger update of consensus annotation
- */
- public void updateConsensus(final AlignmentPanel ap)
- {
- // see note in mantis : issue number 8585
- if (consensus == null || !autoCalculateConsensus)
- {
- return;
- }
- consensusThread = new ConsensusThread(ap);
- consensusThread.start();
- }
-
- class ConsensusThread extends Thread
- {
- AlignmentPanel ap;
-
- public ConsensusThread(AlignmentPanel ap)
- {
- this.ap = ap;
- }
-
- public void run()
- {
- updatingConsensus = true;
- while (UPDATING_CONSENSUS)
- {
- try
- {
- if (ap != null)
- {
- ap.paintAlignment(false);
- }
-
- Thread.sleep(200);
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- UPDATING_CONSENSUS = true;
-
- try
- {
- int aWidth = (alignment != null) ? alignment.getWidth() : -1; // null
- // pointer
- // possibility
- // here.
- if (aWidth <= 0)
- {
- updatingConsensus = false;
- UPDATING_CONSENSUS = false;
- return;
- }
-
- consensus.annotations = null;
- consensus.annotations = new Annotation[aWidth];
-
- hconsensus = new Hashtable[aWidth];
- AAFrequency.calculate(alignment.getSequencesArray(), 0,
- alignment.getWidth(), hconsensus, true);
- updateAnnotation(true);
-
- if (globalColourScheme != null)
- {
- globalColourScheme.setConsensus(hconsensus);
- }
-
- } catch (OutOfMemoryError error)
- {
- alignment.deleteAnnotation(consensus);
-
- consensus = null;
- hconsensus = null;
- new OOMWarning("calculating consensus", error);
- }
- UPDATING_CONSENSUS = false;
- updatingConsensus = false;
-
- if (ap != null)
- {
- ap.paintAlignment(true);
- }
- }
-
- /**
- * update the consensus annotation from the sequence profile data using
- * current visualization settings.
- */
- public void updateAnnotation()
- {
- updateAnnotation(false);
- }
-
- protected void updateAnnotation(boolean immediate)
- {
- // TODO: make calls thread-safe, so if another thread calls this method,
- // it will either return or wait until one calculation is finished.
- if (immediate
- || (!updatingConsensus && consensus != null && hconsensus != null))
- {
- AAFrequency.completeConsensus(consensus, hconsensus, 0,
- hconsensus.length, ignoreGapsInConsensusCalculation,
- showSequenceLogo);
- }
- }
- }
+ // --------END Structure Conservation
/**
* get the consensus sequence as displayed under the PID consensus annotation
return sq;
}
- /**
- *
- *
- * @return null or the currently selected sequence region
- */
- public SequenceGroup getSelectionGroup()
- {
- return selectionGroup;
- }
-
- /**
- * Set the selection group for this window.
- *
- * @param sg - group holding references to sequences in this alignment view
- *
- */
- public void setSelectionGroup(SequenceGroup sg)
- {
- selectionGroup = sg;
- }
/**
* GUI state
+ *
* @return true if conservation based shading is enabled
*/
public boolean getConservationSelected()
/**
* GUI state
+ *
* @param b
* enable conservation based shading
*/
/**
* GUI state
+ *
* @return true if percent identity threshold is applied to shading
*/
public boolean getAbovePIDThreshold()
* GUI state
*
*
- * @param b indicate if percent identity threshold is applied to shading
+ * @param b
+ * indicate if percent identity threshold is applied to shading
*/
public void setAbovePIDThreshold(boolean b)
{
/**
* DOCUMENT ME!
*
- * @param cs
- * DOCUMENT ME!
- */
- public void setGlobalColourScheme(ColourSchemeI cs)
- {
- globalColourScheme = cs;
- }
-
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- public ColourSchemeI getGlobalColourScheme()
- {
- return globalColourScheme;
- }
-
- /**
- * DOCUMENT ME!
- *
* @param res
* DOCUMENT ME!
*/
{
if (alignment != null && alignment.getCodonFrames() != null)
{
- StructureSelectionManager.getStructureSelectionManager(Desktop.instance)
- .removeMappings(alignment.getCodonFrames());
+ StructureSelectionManager.getStructureSelectionManager(
+ Desktop.instance).removeMappings(alignment.getCodonFrames());
}
this.alignment = align;
- if (alignment.getCodonFrames() != null)
+ if (alignment!=null && alignment.getCodonFrames() != null)
{
- StructureSelectionManager.getStructureSelectionManager(Desktop.instance).addMappings(
- alignment.getCodonFrames());
+ StructureSelectionManager.getStructureSelectionManager(
+ Desktop.instance).addMappings(alignment.getCodonFrames());
}
}
scaleRightWrapped = b;
}
- /**
- * Property change listener for changes in alignment
- *
- * @param listener
- * DOCUMENT ME!
- */
- public void addPropertyChangeListener(
- java.beans.PropertyChangeListener listener)
- {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param listener
- * DOCUMENT ME!
- */
- public void removePropertyChangeListener(
- java.beans.PropertyChangeListener listener)
- {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Property change listener for changes in alignment
- *
- * @param prop
- * DOCUMENT ME!
- * @param oldvalue
- * DOCUMENT ME!
- * @param newvalue
- * DOCUMENT ME!
- */
- public void firePropertyChange(String prop, Object oldvalue,
- Object newvalue)
- {
- changeSupport.firePropertyChange(prop, oldvalue, newvalue);
- }
-
- public void setIgnoreGapsConsensus(boolean b, AlignmentPanel ap)
- {
- ignoreGapsInConsensusCalculation = b;
- updateConsensus(ap);
- if (globalColourScheme != null)
- {
- globalColourScheme.setThreshold(globalColourScheme.getThreshold(),
- ignoreGapsInConsensusCalculation);
- }
- }
-
- public boolean getIgnoreGapsConsensus()
- {
- return ignoreGapsInConsensusCalculation;
- }
public void setDataset(boolean b)
{
return isDataset;
}
- public void hideSelectedColumns()
- {
- if (colSel.size() < 1)
- {
- return;
- }
-
- colSel.hideSelectedColumns();
- setSelectionGroup(null);
- hasHiddenColumns = true;
- }
-
- public void hideColumns(int start, int end)
- {
- if (start == end)
- {
- colSel.hideColumns(start);
- }
- else
- {
- colSel.hideColumns(start, end);
- }
-
- hasHiddenColumns = true;
- }
-
- public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)
- {
- int sSize = sg.getSize();
- if (sSize < 2)
- {
- return;
- }
-
- if (hiddenRepSequences == null)
- {
- hiddenRepSequences = new Hashtable();
- }
-
- hiddenRepSequences.put(repSequence, sg);
-
- // Hide all sequences except the repSequence
- SequenceI[] seqs = new SequenceI[sSize - 1];
- int index = 0;
- for (int i = 0; i < sSize; i++)
- {
- if (sg.getSequenceAt(i) != repSequence)
- {
- if (index == sSize - 1)
- {
- return;
- }
-
- seqs[index++] = sg.getSequenceAt(i);
- }
- }
- sg.setSeqrep(repSequence);
- sg.setHidereps(true);
- hideSequence(seqs);
-
- }
-
- public void hideAllSelectedSeqs()
- {
- if (selectionGroup == null || selectionGroup.getSize() < 1)
- {
- return;
- }
-
- SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
-
- hideSequence(seqs);
-
- setSelectionGroup(null);
- }
-
- public void hideSequence(SequenceI[] seq)
- {
- if (seq != null)
- {
- for (int i = 0; i < seq.length; i++)
- {
- alignment.getHiddenSequences().hideSequence(seq[i]);
- }
- hasHiddenRows = true;
- firePropertyChange("alignment", null, alignment.getSequences());
- }
- }
-
- public void showSequence(int index)
- {
- Vector tmp = alignment.getHiddenSequences().showSequence(index,
- hiddenRepSequences);
- if (tmp.size() > 0)
- {
- if (selectionGroup == null)
- {
- selectionGroup = new SequenceGroup();
- selectionGroup.setEndRes(alignment.getWidth() - 1);
- }
-
- for (int t = 0; t < tmp.size(); t++)
- {
- selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
- }
- firePropertyChange("alignment", null, alignment.getSequences());
- sendSelection();
- }
-
- if (alignment.getHiddenSequences().getSize() < 1)
- {
- hasHiddenRows = false;
- }
- }
-
- public void showColumn(int col)
- {
- colSel.revealHiddenColumns(col);
- if (colSel.getHiddenColumns() == null)
- {
- hasHiddenColumns = false;
- }
- }
-
- public void showAllHiddenColumns()
- {
- colSel.revealAllHiddenColumns();
- hasHiddenColumns = false;
- }
-
- public void showAllHiddenSeqs()
- {
- if (alignment.getHiddenSequences().getSize() > 0)
- {
- if (selectionGroup == null)
- {
- selectionGroup = new SequenceGroup();
- selectionGroup.setEndRes(alignment.getWidth() - 1);
- }
- Vector tmp = alignment.getHiddenSequences().showAll(
- hiddenRepSequences);
- for (int t = 0; t < tmp.size(); t++)
- {
- selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
- }
- firePropertyChange("alignment", null, alignment.getSequences());
- sendSelection();
- hasHiddenRows = false;
- hiddenRepSequences = null;
- }
- }
-
- public void invertColumnSelection()
- {
- colSel.invertColumnSelection(0, alignment.getWidth());
- }
-
- public int adjustForHiddenSeqs(int alignmentIndex)
- {
- return alignment.getHiddenSequences().adjustForHiddenSeqs(
- alignmentIndex);
- }
-
- /**
- * This method returns an array of new SequenceI objects derived from the
- * whole alignment or just the current selection with start and end points
- * adjusted
- *
- * @note if you need references to the actual SequenceI objects in the
- * alignment or currently selected then use getSequenceSelection()
- * @return selection as new sequenceI objects
- */
- public SequenceI[] getSelectionAsNewSequence()
- {
- SequenceI[] sequences;
-
- if (selectionGroup == null)
- {
- sequences = alignment.getSequencesArray();
- AlignmentAnnotation[] annots = alignment.getAlignmentAnnotation();
- for (int i = 0; i < sequences.length; i++)
- {
- sequences[i] = new Sequence(sequences[i], annots); // construct new
- // sequence with
- // subset of visible
- // annotation
- }
- }
- else
- {
- sequences = selectionGroup.getSelectionAsNewSequences(alignment);
- }
-
- return sequences;
- }
-
- /**
- * get the currently selected sequence objects or all the sequences in the
- * alignment.
- *
- * @return array of references to sequence objects
- */
- public SequenceI[] getSequenceSelection()
- {
- SequenceI[] sequences = null;
- if (selectionGroup != null)
- {
- sequences = selectionGroup.getSequencesInOrder(alignment);
- }
- if (sequences == null)
- {
- sequences = alignment.getSequencesArray();
- }
- return sequences;
- }
-
- /**
- * This method returns the visible alignment as text, as seen on the GUI, ie
- * if columns are hidden they will not be returned in the result. Use this for
- * calculating trees, PCA, redundancy etc on views which contain hidden
- * columns.
- *
- * @return String[]
- */
- public jalview.datamodel.CigarArray getViewAsCigars(
- boolean selectedRegionOnly)
- {
- return new jalview.datamodel.CigarArray(alignment, (hasHiddenColumns ? colSel : null), (selectedRegionOnly ? selectionGroup : null));
- }
-
- /**
- * return a compact representation of the current alignment selection to pass
- * to an analysis function
- *
- * @param selectedOnly
- * boolean true to just return the selected view
- * @return AlignmentView
- */
- public jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly)
- {
- return getAlignmentView(selectedOnly, false);
- }
-
- /**
- * return a compact representation of the current alignment selection to pass
- * to an analysis function
- *
- * @param selectedOnly
- * boolean true to just return the selected view
- * @param markGroups
- * boolean true to annotate the alignment view with groups on the alignment (and intersecting with selected region if selectedOnly is true)
- * @return AlignmentView
- */
- public jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups)
- {
- return new AlignmentView(alignment, colSel, selectionGroup, hasHiddenColumns, selectedOnly, markGroups);
- }
-
- /**
- * This method returns the visible alignment as text, as seen on the GUI, ie
- * if columns are hidden they will not be returned in the result. Use this for
- * calculating trees, PCA, redundancy etc on views which contain hidden
- * columns.
- *
- * @return String[]
- */
- public String[] getViewAsString(boolean selectedRegionOnly)
- {
- String[] selection = null;
- SequenceI[] seqs = null;
- int i, iSize;
- int start = 0, end = 0;
- if (selectedRegionOnly && selectionGroup != null)
- {
- iSize = selectionGroup.getSize();
- seqs = selectionGroup.getSequencesInOrder(alignment);
- start = selectionGroup.getStartRes();
- end = selectionGroup.getEndRes() + 1;
- }
- else
- {
- iSize = alignment.getHeight();
- seqs = alignment.getSequencesArray();
- end = alignment.getWidth();
- }
-
- selection = new String[iSize];
- if (hasHiddenColumns)
- {
- selection = colSel.getVisibleSequenceStrings(start, end, seqs);
- }
- else
- {
- for (i = 0; i < iSize; i++)
- {
- selection[i] = seqs[i].getSequenceAsString(start, end);
- }
-
- }
- return selection;
- }
-
- public int[][] getVisibleRegionBoundaries(int min, int max)
- {
- Vector regions = new Vector();
- int start = min;
- int end = max;
-
- do
- {
- if (hasHiddenColumns)
- {
- if (start == 0)
- {
- start = colSel.adjustForHiddenColumns(start);
- }
-
- end = colSel.getHiddenBoundaryRight(start);
- if (start == end)
- {
- end = max;
- }
- if (end > max)
- {
- end = max;
- }
- }
-
- regions.addElement(new int[]
- { start, end });
-
- if (hasHiddenColumns)
- {
- start = colSel.adjustForHiddenColumns(end);
- start = colSel.getHiddenBoundaryLeft(start) + 1;
- }
- } while (end < max);
-
- int[][] startEnd = new int[regions.size()][2];
-
- regions.copyInto(startEnd);
-
- return startEnd;
-
- }
public boolean getShowHiddenMarkers()
{
showHiddenMarkers = show;
}
- public String getSequenceSetId()
- {
- if (sequenceSetID == null)
- {
- sequenceSetID = alignment.hashCode() + "";
- }
-
- return sequenceSetID;
- }
-
- /**
- * unique viewId for synchronizing state with stored Jalview Project
- *
- */
- private String viewId = null;
-
- public String getViewId()
- {
- if (viewId == null)
- {
- viewId = this.getSequenceSetId() + "." + this.hashCode() + "";
- }
- return viewId;
- }
-
- public void alignmentChanged(AlignmentPanel ap)
- {
- if (padGaps)
- {
- alignment.padGaps();
- }
- if (hconsensus != null && autoCalculateConsensus)
- {
- updateConservation(ap);
- }
- if (autoCalculateConsensus)
- {
- updateConsensus(ap);
- }
-
- // Reset endRes of groups if beyond alignment width
- int alWidth = alignment.getWidth();
- Vector groups = alignment.getGroups();
- if (groups != null)
- {
- for (int i = 0; i < groups.size(); i++)
- {
- SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
- if (sg.getEndRes() > alWidth)
- {
- sg.setEndRes(alWidth - 1);
- }
- }
- }
-
- if (selectionGroup != null && selectionGroup.getEndRes() > alWidth)
- {
- selectionGroup.setEndRes(alWidth - 1);
- }
-
- resetAllColourSchemes();
-
- // alignment.adjustSequenceAnnotations();
- }
-
- void resetAllColourSchemes()
- {
- ColourSchemeI cs = globalColourScheme;
- if (cs != null)
- {
- if (cs instanceof ClustalxColourScheme)
- {
- ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
- alignment.getWidth());
- }
-
- cs.setConsensus(hconsensus);
- if (cs.conservationApplied())
- {
- Alignment al = (Alignment) alignment;
- Conservation c = new Conservation("All",
- ResidueProperties.propHash, 3, al.getSequences(), 0,
- al.getWidth() - 1);
- c.calculate();
- c.verdict(false, ConsPercGaps);
-
- cs.setConservation(c);
- }
- }
-
- int s, sSize = alignment.getGroups().size();
- for (s = 0; s < sSize; s++)
- {
- SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
- if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
- {
- ((ClustalxColourScheme) sg.cs).resetClustalX(
- sg.getSequences(hiddenRepSequences), sg.getWidth());
- }
- sg.recalcConservation();
- }
- }
-
public Color getSequenceColour(SequenceI seq)
{
if (sequenceColours == null || !sequenceColours.containsKey(seq))
SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
if (sg.idColour != null)
{
- Vector sqs = sg.getSequences(hiddenRepSequences);
+ Vector sqs = sg.getSequences(getHiddenRepSequences());
for (int s = 0, sSize = sqs.size(); s < sSize; s++)
{
sequenceColours.put(sqs.elementAt(s), sg.idColour);
return followSelection;
}
- private long sgrouphash = -1, colselhash = -1;
-
boolean showSeqFeaturesHeight;
- /**
- * checks current SelectionGroup against record of last hash value, and
- * updates record.
- * @param b update the record of last hash value
- *
- * @return true if SelectionGroup changed since last call (when b is true)
- */
- boolean isSelectionGroupChanged(boolean b)
- {
- int hc = (selectionGroup == null || selectionGroup.getSize()==0) ? -1 : selectionGroup.hashCode();
- if (hc!=-1 && hc != sgrouphash)
- {
- if (b) {sgrouphash = hc;}
- return true;
- }
- return false;
- }
-
- /**
- * checks current colsel against record of last hash value, and optionally updates
- * record.
-
- * @param b update the record of last hash value
- * @return true if colsel changed since last call (when b is true)
- */
- boolean isColSelChanged(boolean b)
- {
- int hc = (colSel == null || colSel.size()==0) ? -1 : colSel.hashCode();
- if (hc!=-1 && hc != colselhash)
- {
- if (b) {colselhash = hc;}
- return true;
- }
- return false;
- }
-
public void sendSelection()
{
jalview.structure.StructureSelectionManager
return showSeqFeaturesHeight;
}
- boolean showUnconserved = false;
-
- public boolean getShowUnconserved()
- {
- return showUnconserved;
- }
-
- public void setShowUnconserved(boolean showunconserved)
- {
- showUnconserved = showunconserved;
- }
-
/**
* return the alignPanel containing the given viewport. Use this to get the
* components currently handling the given viewport.
}
/**
- * should conservation rows be shown for groups
- */
- boolean showGroupConservation = false;
-
- /**
- * should consensus rows be shown for groups
- */
- boolean showGroupConsensus = false;
-
- /**
- * should consensus profile be rendered by default
- */
- public boolean showSequenceLogo = false;
-
- /**
- * should consensus histograms be rendered by default
- */
- public boolean showConsensusHistogram = true;
-
- /**
- * @return the showConsensusProfile
- */
- public boolean isShowSequenceLogo()
- {
- return showSequenceLogo;
- }
-
- /**
- * @param showSequenceLogo
- * the new value
- */
- public void setShowSequenceLogo(boolean showSequenceLogo)
- {
- if (showSequenceLogo != this.showSequenceLogo)
- {
- // TODO: decouple settings setting from calculation when refactoring
- // annotation update method from alignframe to viewport
- this.showSequenceLogo = showSequenceLogo;
- if (consensusThread != null)
- {
- consensusThread.updateAnnotation();
- }
- }
- this.showSequenceLogo = showSequenceLogo;
- }
-
- /**
- * @param showConsensusHistogram
- * the showConsensusHistogram to set
- */
- public void setShowConsensusHistogram(boolean showConsensusHistogram)
- {
- this.showConsensusHistogram = showConsensusHistogram;
- }
-
- /**
- * @return the showGroupConservation
- */
- public boolean isShowGroupConservation()
- {
- return showGroupConservation;
- }
-
- /**
- * @param showGroupConservation
- * the showGroupConservation to set
- */
- public void setShowGroupConservation(boolean showGroupConservation)
- {
- this.showGroupConservation = showGroupConservation;
- }
-
- /**
- * @return the showGroupConsensus
- */
- public boolean isShowGroupConsensus()
- {
- return showGroupConsensus;
- }
-
- /**
- * @param showGroupConsensus
- * the showGroupConsensus to set
- */
- public void setShowGroupConsensus(boolean showGroupConsensus)
- {
- this.showGroupConsensus = showGroupConsensus;
- }
-
- /**
- *
- * @return flag to indicate if the consensus histogram should be rendered by
- * default
- */
- public boolean isShowConsensusHistogram()
- {
- return this.showConsensusHistogram;
- }
-
- /**
* synthesize a column selection if none exists so it covers the given
* selection group. if wholewidth is false, no column selection is made if the
* selection group covers the whole alignment width.
public StructureSelectionManager getStructureSelectionManager()
{
- return StructureSelectionManager.getStructureSelectionManager(Desktop.instance);
+ return StructureSelectionManager
+ .getStructureSelectionManager(Desktop.instance);
}
/**
*
* @param pdbEntries
- * @return a series of SequenceI arrays, one for each PDBEntry, listing which sequence in the alignment holds a reference to it
+ * @return a series of SequenceI arrays, one for each PDBEntry, listing which
+ * sequence in the alignment holds a reference to it
*/
public SequenceI[][] collateForPDB(PDBEntry[] pdbEntries)
{
ArrayList<SequenceI[]> seqvectors = new ArrayList<SequenceI[]>();
- for (PDBEntry pdb: pdbEntries) {
- ArrayList<SequenceI> seqs = new ArrayList<SequenceI>();
- for (int i = 0; i < alignment.getHeight(); i++)
+ for (PDBEntry pdb : pdbEntries)
{
- Vector pdbs = alignment.getSequenceAt(i)
- .getDatasetSequence().getPDBId();
- if (pdbs == null)
- continue;
- SequenceI sq;
- for (int p = 0; p < pdbs.size(); p++)
+ ArrayList<SequenceI> seqs = new ArrayList<SequenceI>();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- PDBEntry p1 = (PDBEntry) pdbs.elementAt(p);
- if (p1.getId().equals(pdb.getId()))
+ Vector pdbs = alignment.getSequenceAt(i).getDatasetSequence()
+ .getPDBId();
+ if (pdbs == null)
+ continue;
+ SequenceI sq;
+ for (int p = 0; p < pdbs.size(); p++)
{
- if (!seqs.contains(sq=alignment.getSequenceAt(i)))
- seqs.add(sq);
+ PDBEntry p1 = (PDBEntry) pdbs.elementAt(p);
+ if (p1.getId().equals(pdb.getId()))
+ {
+ if (!seqs.contains(sq = alignment.getSequenceAt(i)))
+ seqs.add(sq);
- continue;
+ continue;
+ }
}
}
- }
- seqvectors.add(seqs.toArray(new SequenceI[seqs.size()]));
+ seqvectors.add(seqs.toArray(new SequenceI[seqs.size()]));
}
return seqvectors.toArray(new SequenceI[seqvectors.size()][]);
}
+
+
+ public boolean isNormaliseSequenceLogo()
+ {
+ return normaliseSequenceLogo;
+ }
+
+ public void setNormaliseSequenceLogo(boolean state)
+ {
+ normaliseSequenceLogo = state;
+ }
+
+
+ /**
+ *
+ * @return true if alignment characters should be displayed
+ */
+ public boolean isValidCharWidth()
+ {
+ return validCharWidth;
+ }
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import jalview.datamodel.*;
import jalview.jbgui.*;
import jalview.schemes.*;
-import jalview.structure.SelectionSource;
import jalview.structure.StructureSelectionManager;
/**
// do we need to scroll the panel?
// TODO: tons of nullpointereexceptions raised here.
if (results != null && results.getSize() > 0 && av != null
- && av.alignment != null)
+ && av.getAlignment() != null)
{
- int seqIndex = av.alignment.findIndex(results);
+ int seqIndex = av.getAlignment().findIndex(results);
if (seqIndex == -1)
{
return false;
}
- SequenceI seq = av.alignment.getSequenceAt(seqIndex);
+ SequenceI seq = av.getAlignment().getSequenceAt(seqIndex);
- int[] r=results.getResults(seq, 0, av.alignment.getWidth());
+ int[] r=results.getResults(seq, 0, av.getAlignment().getWidth());
if (r == null)
{
return false;
{
return false;
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
start = av.getColumnSelection().findColumnPosition(start);
end = av.getColumnSelection().findColumnPosition(end);
if (start==end)
{
- if (!av.colSel.isVisible(r[0]))
+ if (!av.getColumnSelection().isVisible(r[0]))
{
// don't scroll - position isn't visible
return false;
public void setScrollValues(int x, int y)
{
// System.err.println("Scroll to "+x+","+y);
- if (av == null || av.alignment == null)
+ if (av == null || av.getAlignment() == null)
{
return;
}
- int width = av.alignment.getWidth();
- int height = av.alignment.getHeight();
+ int width = av.getAlignment().getWidth();
+ int height = av.getAlignment().getHeight();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
width = av.getColumnSelection().findColumnPosition(width);
}
if (av.getWrapAlignment())
{
- int maxwidth = av.alignment.getWidth();
+ int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
endSeq = av.getAlignment().getHeight();
}
- int pagesHigh = ((av.alignment.getHeight() / totalSeq) + 1) * pheight;
+ int pagesHigh = ((av.getAlignment().getHeight() / totalSeq) + 1) * pheight;
if (av.showAnnotation)
{
pg.translate(idWidth, 0);
seqPanel.seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq, 0);
- if (av.showAnnotation && (endSeq == av.alignment.getHeight()))
+ if (av.showAnnotation && (endSeq == av.getAlignment().getHeight()))
{
pg.translate(-idWidth - 3, (endSeq - startSeq) * av.charHeight + 3);
alabels.drawComponent((Graphics2D) pg, idWidth);
pg.translate(idWidth + 3, 0);
- annotationPanel.drawComponent((Graphics2D) pg, startRes, endRes + 1);
+ annotationPanel.renderer.drawComponent(annotationPanel, av, (Graphics2D) pg, -1, startRes, endRes + 1);
}
return Printable.PAGE_EXISTS;
int idWidth = getVisibleIdWidth(false);
- int maxwidth = av.alignment.getWidth();
- if (av.hasHiddenColumns)
+ int maxwidth = av.getAlignment().getWidth();
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
do
{
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ for (int i = 0; i < av.getAlignment().getHeight(); i++)
{
pg.setFont(idPanel.idCanvas.idfont);
- SequenceI s = av.alignment.getSequenceAt(i);
+ SequenceI s = av.getAlignment().getSequenceAt(i);
String string = s.getDisplayId(av.getShowJVSuffix());
int xPos = 0;
if (av.rightAlignIds)
void makeAlignmentImage(int type, File file)
{
- int maxwidth = av.alignment.getWidth();
- if (av.hasHiddenColumns)
+ int maxwidth = av.getAlignment().getWidth();
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth);
}
- int height = ((av.alignment.getHeight() + 1) * av.charHeight)
+ int height = ((av.getAlignment().getHeight() + 1) * av.charHeight)
+ scalePanel.getHeight();
int width = getVisibleIdWidth(false) + (maxwidth * av.charWidth);
{
try
{
- int s, sSize = av.alignment.getHeight(), res, alwidth = av.alignment
+ int s, sSize = av.getAlignment().getHeight(), res, alwidth = av.getAlignment()
.getWidth(), g, gSize, f, fSize, sy;
StringBuffer text = new StringBuffer();
PrintWriter out = new PrintWriter(new FileWriter(imgMapFile));
{
sy = s * av.charHeight + scaleHeight;
- SequenceI seq = av.alignment.getSequenceAt(s);
+ SequenceI seq = av.getAlignment().getSequenceAt(s);
SequenceFeature[] features = seq.getDatasetSequence()
.getSequenceFeatures();
- SequenceGroup[] groups = av.alignment.findAllGroups(seq);
+ SequenceGroup[] groups = av.getAlignment().findAllGroups(seq);
for (res = 0; res < alwidth; res++)
{
text = new StringBuffer();
Object obj = null;
- if (av.alignment.isNucleotide())
+ if (av.getAlignment().isNucleotide())
{
obj = ResidueProperties.nucleotideName.get(seq.getCharAt(res)
+ "");
int cHeight = av.getAlignment().getHeight() * av.charHeight + hgap
+ annotationHeight;
- int maxwidth = av.alignment.getWidth();
- if (av.hasHiddenColumns)
+ int maxwidth = av.getAlignment().getWidth();
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
jalview.structure.StructureSelectionManager ssm = av.getStructureSelectionManager();
ssm.removeStructureViewerListener(seqPanel, null);
ssm.removeSelectionListener(seqPanel);
- av.alignment = null;
+ av.setAlignment(null);
av = null;
}
else
boolean cons = av.isShowGroupConsensus();
boolean showprf = av.isShowSequenceLogo();
boolean showConsHist = av.isShowConsensusHistogram();
+ boolean normLogo = av.isNormaliseSequenceLogo();
boolean sortg = true;
// remove old automatic annotation
// add any new annotation
- Vector gr = av.alignment.getGroups(); // OrderedBy(av.alignment.getSequencesArray());
+ Vector gr = av.getAlignment().getGroups(); // OrderedBy(av.getAlignment().getSequencesArray());
// intersect alignment annotation with alignment groups
- AlignmentAnnotation[] aan = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aan = av.getAlignment().getAlignmentAnnotation();
Hashtable oldrfs = new Hashtable();
if (aan != null)
{
if (aan[an].autoCalculated && aan[an].groupRef != null)
{
oldrfs.put(aan[an].groupRef, aan[an].groupRef);
- av.alignment.deleteAnnotation(aan[an]);
+ av.getAlignment().deleteAnnotation(aan[an]);
aan[an] = null;
}
}
// set defaults for this group's conservation/consensus
sg.setshowSequenceLogo(showprf);
sg.setShowConsensusHistogram(showConsHist);
+ sg.setNormaliseSequenceLogo(normLogo);
}
if (conv)
{
updateCalcs = true;
- av.alignment.addAnnotation(sg.getConservationRow(), 0);
+ av.getAlignment().addAnnotation(sg.getConservationRow(), 0);
}
if (cons)
{
updateCalcs = true;
- av.alignment.addAnnotation(sg.getConsensus(), 0);
+ av.getAlignment().addAnnotation(sg.getConsensus(), 0);
}
// refresh the annotation rows
if (updateCalcs)
@Override
public AlignmentI getAlignment()
{
- return av.alignment;
+ return av.getAlignment();
}
/**
{
return av.getStructureSelectionManager();
}
+
+ @Override
+ public void raiseOOMWarning(String string, OutOfMemoryError error)
+ {
+ new OOMWarning(string, error, this);
+ }
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap)
{
oldcs = av.getGlobalColourScheme();
- if (av.alignment.getGroups() != null)
+ if (av.getAlignment().getGroups() != null)
{
oldgroupColours = new Hashtable();
- Vector allGroups = ap.av.alignment.getGroups();
+ Vector allGroups = ap.av.getAlignment().getGroups();
SequenceGroup sg;
for (int g = 0; g < allGroups.size(); g++)
{
}
});
- if (av.alignment.getAlignmentAnnotation() == null)
+ if (av.getAlignment().getAlignmentAnnotation() == null)
{
return;
}
adjusting = true;
Vector list = new Vector();
int index = 1;
- for (int i = 0; i < av.alignment.getAlignmentAnnotation().length; i++)
+ for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
{
- String label = av.alignment.getAlignmentAnnotation()[i].label;
+ String label = av.getAlignment().getAlignmentAnnotation()[i].label;
if (!list.contains(label))
list.addElement(label);
else
return;
}
- currentAnnotation = av.alignment.getAlignmentAnnotation()[annotations
+ currentAnnotation = av.getAlignment().getAlignmentAnnotation()[annotations
.getSelectedIndex()];
int aboveThreshold = -1;
av.setGlobalColourScheme(acg);
- if (av.alignment.getGroups() != null)
+ if (av.getAlignment().getGroups() != null)
{
- Vector allGroups = ap.av.alignment.getGroups();
+ Vector allGroups = ap.av.getAlignment().getGroups();
SequenceGroup sg;
for (int g = 0; g < allGroups.size(); g++)
{
void reset()
{
av.setGlobalColourScheme(oldcs);
- if (av.alignment.getGroups() != null)
+ if (av.getAlignment().getGroups() != null)
{
- Vector allGroups = ap.av.alignment.getGroups();
+ Vector allGroups = ap.av.getAlignment().getGroups();
SequenceGroup sg;
for (int g = 0; g < allGroups.size(); g++)
{
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
{\r
if (GFFFormat.isSelected())\r
{\r
- text = new FeaturesFile().printGFFFormat(ap.av.alignment\r
+ text = new FeaturesFile().printGFFFormat(ap.av.getAlignment()\r
.getDataset().getSequencesArray(),\r
getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());// ap.av.featuresDisplayed//);\r
}\r
else\r
{\r
- text = new FeaturesFile().printJalviewFormat(ap.av.alignment\r
+ text = new FeaturesFile().printJalviewFormat(ap.av.getAlignment()\r
.getDataset().getSequencesArray(),\r
getDisplayedFeatureCols(), true, ap.av.isShowNpFeats()); // ap.av.featuresDisplayed);\r
}\r
{\r
if (GFFFormat.isSelected())\r
{\r
- text = new FeaturesFile().printGFFFormat(ap.av.alignment\r
+ text = new FeaturesFile().printGFFFormat(ap.av.getAlignment()\r
.getDataset().getSequencesArray(),\r
getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());\r
}\r
else\r
{\r
- text = new FeaturesFile().printJalviewFormat(ap.av.alignment\r
+ text = new FeaturesFile().printJalviewFormat(ap.av.getAlignment()\r
.getDataset().getSequencesArray(),\r
getDisplayedFeatureCols(), true, ap.av.isShowNpFeats());\r
}\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
void getSelectedRow(int y)
{
int height = 0;
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
selectedRow = -2;
if (aa != null)
{
*/
public void actionPerformed(ActionEvent evt)
{
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
if (evt.getActionCommand().equals(ADDNEW))
{
AlignmentAnnotation newAnnotation = new AlignmentAnnotation(null,
- null, new Annotation[ap.av.alignment.getWidth()]);
+ null, new Annotation[ap.av.getAlignment().getWidth()]);
if (!editLabelDescription(newAnnotation))
{
return;
}
- ap.av.alignment.addAnnotation(newAnnotation);
- ap.av.alignment.setAnnotationIndex(newAnnotation, 0);
+ ap.av.getAlignment().addAnnotation(newAnnotation);
+ ap.av.getAlignment().setAnnotationIndex(newAnnotation, 0);
}
else if (evt.getActionCommand().equals(EDITNAME))
{
}
else if (evt.getActionCommand().equals(DELETE))
{
- ap.av.alignment.deleteAnnotation(aa[selectedRow]);
+ ap.av.getAlignment().deleteAnnotation(aa[selectedRow]);
}
else if (evt.getActionCommand().equals(SHOWALL))
{
if (start != end)
{
// Swap these annotations
- AlignmentAnnotation startAA = ap.av.alignment
+ AlignmentAnnotation startAA = ap.av.getAlignment()
.getAlignmentAnnotation()[start];
if (end == -1)
{
- end = ap.av.alignment.getAlignmentAnnotation().length - 1;
+ end = ap.av.getAlignment().getAlignmentAnnotation().length - 1;
}
- AlignmentAnnotation endAA = ap.av.alignment.getAlignmentAnnotation()[end];
+ AlignmentAnnotation endAA = ap.av.getAlignment().getAlignmentAnnotation()[end];
- ap.av.alignment.getAlignmentAnnotation()[end] = startAA;
- ap.av.alignment.getAlignmentAnnotation()[start] = endAA;
+ ap.av.getAlignment().getAlignmentAnnotation()[end] = startAA;
+ ap.av.getAlignment().getAlignmentAnnotation()[start] = endAA;
}
resizePanel = false;
getSelectedRow(evt.getY() - scrollOffset);
if (selectedRow > -1
- && ap.av.alignment.getAlignmentAnnotation().length > selectedRow)
+ && ap.av.getAlignment().getAlignmentAnnotation().length > selectedRow)
{
- AlignmentAnnotation aa = ap.av.alignment.getAlignmentAnnotation()[selectedRow];
+ AlignmentAnnotation aa = ap.av.getAlignment().getAlignmentAnnotation()[selectedRow];
StringBuffer desc = new StringBuffer();
if (aa.description != null
*/
public void mouseClicked(MouseEvent evt)
{
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
if (SwingUtilities.isLeftMouseButton(evt))
{
if (selectedRow > -1 && selectedRow < aa.length)
}
});
pop.add(cprofl);
+ final JCheckBoxMenuItem cproflnorm = new JCheckBoxMenuItem(
+ "Normalise Group Logo",
+ aa[selectedRow].groupRef.isNormaliseSequenceLogo());
+ cproflnorm.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ aaa.groupRef.setNormaliseSequenceLogo(cproflnorm.getState());
+ // automatically enable logo display if we're clicked
+ aaa.groupRef.setshowSequenceLogo(true);
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ pop.add(cproflnorm);
}
else
{
// can be
// updated.
av.setShowConsensusHistogram(chist.getState());
+ ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
// can be
// updated.
av.setShowSequenceLogo(cprof.getState());
+ ap.alignFrame.setMenusForViewport();
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
});
pop.add(cprof);
+ final JCheckBoxMenuItem cprofnorm = new JCheckBoxMenuItem(
+ "Normalise Logo", av.isNormaliseSequenceLogo());
+ cprofnorm.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ av.setShowSequenceLogo(true);
+ av.setNormaliseSequenceLogo(cprofnorm.getState());
+ ap.alignFrame.setMenusForViewport();
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ pop.add(cprofnorm);
}
final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
consclipbrd.addActionListener(this);
sq.setDatasetSequence(dseqs[0]);
}
Alignment ds = new Alignment(dseqs);
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
omitHidden = av.getColumnSelection().getVisibleSequenceStrings(0,
sq.getLength(), seqs);
.setContents(new StringSelection(output), Desktop.instance);
Vector hiddenColumns = null;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
hiddenColumns = new Vector();
for (int i = 0; i < av.getColumnSelection().getHiddenColumns().size(); i++)
g.translate(0, scrollOffset);
g.setColor(Color.black);
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
int fontHeight = g.getFont().getSize();
int y = 0;
int x = 0;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import java.awt.*;
import java.awt.event.*;
-import java.awt.font.LineMetrics;
-import java.awt.geom.AffineTransform;
import java.awt.image.*;
import java.util.Hashtable;
import javax.swing.*;
import jalview.analysis.AAFrequency;
+import jalview.analysis.StructureFrequency;
import jalview.datamodel.*;
-import jalview.schemes.ColourSchemeI;
+import jalview.renderer.AnnotationRenderer;
+import jalview.renderer.AwtRenderPanelI;
/**
* DOCUMENT ME!
* @author $author$
* @version $Revision$
*/
-public class AnnotationPanel extends JPanel implements MouseListener,
- MouseMotionListener, ActionListener, AdjustmentListener
+public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
+ MouseListener, MouseMotionListener, ActionListener,
+ AdjustmentListener
{
final String HELIX = "Helix";
final String SHEET = "Sheet";
+ /**
+ * For RNA secondary structure "stems" aka helices
+ */
+ final String STEM = "RNA Helix";
+
final String LABEL = "Label";
final String REMOVE = "Remove Annotation";
final String COLOUR = "Colour";
- final Color HELIX_COLOUR = Color.red.darker();
+ public final Color HELIX_COLOUR = Color.red.darker();
- final Color SHEET_COLOUR = Color.green.darker().darker();
+ public final Color SHEET_COLOUR = Color.green.darker().darker();
+
+ public final Color STEM_COLOUR = Color.blue.darker();
/** DOCUMENT ME!! */
- AlignViewport av;
+ public AlignViewport av;
AlignmentPanel ap;
- int activeRow = -1;
+ public int activeRow = -1;
- BufferedImage image;
+ public BufferedImage image;
- BufferedImage fadedImage;
+ public BufferedImage fadedImage;
Graphics2D gg;
- FontMetrics fm;
+ public FontMetrics fm;
- int imgWidth = 0;
+ public int imgWidth = 0;
boolean fastPaint = false;
boolean MAC = false;
+ // for editing cursor
+ int cursorX = 0;
+
+ int cursorY = 0;
+
+ public final AnnotationRenderer renderer;
+
/**
* Creates a new AnnotationPanel object.
*
addMouseMotionListener(this);
ap.annotationScroller.getVerticalScrollBar()
.addAdjustmentListener(this);
+ renderer = new AnnotationRenderer();
}
public AnnotationPanel(AlignViewport av)
{
this.av = av;
+ renderer = new AnnotationRenderer();
}
/**
*/
public int adjustPanelHeight()
{
- int height=calcPanelHeight();
+ int height = calcPanelHeight();
this.setPreferredSize(new Dimension(1, height));
if (ap != null)
{
}
/**
- * calculate the height for visible annotation, revalidating bounds where necessary
- * ABSTRACT GUI METHOD
+ * calculate the height for visible annotation, revalidating bounds where
+ * necessary ABSTRACT GUI METHOD
+ *
* @return total height of annotation
*/
public int calcPanelHeight()
{
// setHeight of panels
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
int height = 0;
if (aa != null)
*/
public void actionPerformed(ActionEvent evt)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
return;
{
int index = av.getColumnSelection().columnAt(i);
- if (!av.colSel.isVisible(index))
+ if (!av.getColumnSelection().isVisible(index))
continue;
if (anot[index] == null)
{
int index = av.getColumnSelection().columnAt(i);
- if (!av.colSel.isVisible(index))
+ if (!av.getColumnSelection().isVisible(index))
continue;
if (anot[index] == null)
symbol = "\u03B2";
}
+ // Added by LML to color stems
+ else if (evt.getActionCommand().equals(STEM))
+ {
+ type = 'S';
+ symbol = "\u03C3";
+ }
+
if (!aa[activeRow].hasIcons)
{
aa[activeRow].hasIcons = true;
{
int index = av.getColumnSelection().columnAt(i);
- if (!av.colSel.isVisible(index))
+ if (!av.getColumnSelection().isVisible(index))
continue;
if (anot[index] == null)
anot[index].displayCharacter = label;
}
}
+ aa[activeRow].validateRangeAndDisplay();
adjustPanelHeight();
repaint();
{
String collatedInput = "";
String last = "";
+ ColumnSelection viscols=av.getColumnSelection();
+ // TODO: refactor and save av.getColumnSelection for efficiency
for (int i = 0; i < columnSelection.size(); i++)
{
int index = columnSelection.columnAt(i);
// always check for current display state - just in case
- if (!av.colSel.isVisible(index))
+ if (!viscols.isVisible(index))
continue;
String tlabel = null;
if (anot[index] != null)
- {
+ { // LML added stem code
if (label2.equals(HELIX) || label2.equals(SHEET)
- || label2.equals(LABEL))
+ || label2.equals(STEM) || label2.equals(LABEL))
{
tlabel = anot[index].description;
if (tlabel == null || tlabel.length() < 1)
{
- if (label2.equals(HELIX) || label2.equals(SHEET))
+ if (label2.equals(HELIX) || label2.equals(SHEET)
+ || label2.equals(STEM))
{
tlabel = "" + anot[index].secondaryStructure;
}
public void mousePressed(MouseEvent evt)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
return;
}
JPopupMenu pop = new JPopupMenu("Structure type");
- JMenuItem item = new JMenuItem(HELIX);
- item.addActionListener(this);
- pop.add(item);
- item = new JMenuItem(SHEET);
- item.addActionListener(this);
- pop.add(item);
+ JMenuItem item;
+ /*
+ * Just display the needed structure options
+ */
+ if (av.getAlignment().isNucleotide() == true)
+ {
+ item = new JMenuItem(STEM);
+ item.addActionListener(this);
+ pop.add(item);
+ }
+ else
+ {
+ item = new JMenuItem(HELIX);
+ item.addActionListener(this);
+ pop.add(item);
+ item = new JMenuItem(SHEET);
+ item.addActionListener(this);
+ pop.add(item);
+ }
item = new JMenuItem(LABEL);
item.addActionListener(this);
pop.add(item);
{
if (graphStretch > -1)
{
- av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
+ av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY
- evt.getY();
- if (av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight < 0)
+ if (av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight < 0)
{
- av.alignment.getAlignmentAnnotation()[graphStretch].graphHeight = 0;
+ av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight = 0;
}
graphStretchY = evt.getY();
adjustPanelHeight();
*/
public void mouseMoved(MouseEvent evt)
{
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
if (aa == null)
{
int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
*/
public void mouseClicked(MouseEvent evt)
{
+ if (activeRow != -1)
+ {
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
+ AlignmentAnnotation anot = aa[activeRow];
+
+ if (anot.description.equals("secondary structure"))
+ {
+ // System.out.println(anot.description+" "+anot.getRNAStruc());
+ }
+ }
+ }
+
+ // TODO mouseClicked-content and drawCursor are quite experimental!
+ public void drawCursor(Graphics graphics, SequenceI seq, int res, int x1,
+ int y1)
+ {
+ int pady = av.charHeight / 5;
+ int charOffset = 0;
+ graphics.setColor(Color.black);
+ graphics.fillRect(x1, y1, av.charWidth, av.charHeight);
+
+ if (av.validCharWidth)
+ {
+ graphics.setColor(Color.white);
+
+ char s = seq.getCharAt(res);
+
+ charOffset = (av.charWidth - fm.charWidth(s)) / 2;
+ graphics.drawString(String.valueOf(s), charOffset + x1,
+ (y1 + av.charHeight) - pady);
+ }
+
}
/**
{
if ((horizontal == 0) || gg == null
- || av.alignment.getAlignmentAnnotation() == null
- || av.alignment.getAlignmentAnnotation().length < 1
- || av.updatingConsensus || av.updatingConservation)
+ || av.getAlignment().getAlignmentAnnotation() == null
+ || av.getAlignment().getAlignmentAnnotation().length < 1
+ || av.isCalcInProgress())
{
repaint();
return;
*/
public void drawComponent(Graphics g, int startRes, int endRes)
{
- if (av.updatingConsensus || av.updatingConservation)
+ if (av.isCalcInProgress())
{
if (image == null)
{
fm = g.getFontMetrics();
}
- if ((av.alignment.getAlignmentAnnotation() == null)
- || (av.alignment.getAlignmentAnnotation().length < 1))
+ if ((av.getAlignment().getAlignmentAnnotation() == null)
+ || (av.getAlignment().getAlignmentAnnotation().length < 1))
{
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
return;
}
-
- AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();
-
- int x = 0, y = 0;
- int column = 0;
- char lastSS;
- int lastSSX;
- int iconOffset = 0;
- boolean validRes = false;
- boolean validEnd = false;
- boolean labelAllCols = false;
- boolean centreColLabels, centreColLabelsDef = av
- .getCentreColumnLabels();
- boolean scaleColLabel = false;
- boolean[] graphGroupDrawn = new boolean[aa.length];
- int charOffset = 0; // offset for a label
- float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a
- // column.
- Font ofont = g.getFont();
- // \u03B2 \u03B1
- for (int i = 0; i < aa.length; i++)
- {
- AlignmentAnnotation row = aa[i];
-
- if (!row.visible)
- {
- continue;
- }
- centreColLabels = row.centreColLabels || centreColLabelsDef;
- labelAllCols = row.showAllColLabels;
- scaleColLabel = row.scaleColLabel;
- lastSS = ' ';
- lastSSX = 0;
-
- if (row.graph > 0)
- {
- if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
- {
- continue;
- }
-
- // this is so that we draw the characters below the graph
- y += row.height;
-
- if (row.hasText)
- {
- iconOffset = av.charHeight - fm.getDescent();
- y -= av.charHeight;
- }
- }
- else if (row.hasText)
- {
- iconOffset = av.charHeight - fm.getDescent();
-
- }
- else
- {
- iconOffset = 0;
- }
-
- if (av.updatingConsensus && aa[i] == av.consensus)
- {
- y += av.charHeight;
-
- g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
- - row.height, imgWidth, y, this);
- g.setColor(Color.black);
- // g.drawString("Calculating Consensus....",20, y-row.height/2);
-
- continue;
- }
- else if (av.updatingConservation
- && aa[i].label.equals("Conservation"))
- {
-
- y += av.charHeight;
- g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
- - row.height, imgWidth, y, this);
-
- g.setColor(Color.black);
- // g.drawString("Calculating Conservation.....",20, y-row.height/2);
-
- continue;
- }
- else if (av.updatingConservation && aa[i].label.equals("Quality"))
- {
-
- y += av.charHeight;
- g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
- - row.height, imgWidth, y, this);
- g.setColor(Color.black);
- // / g.drawString("Calculating Quality....",20, y-row.height/2);
-
- continue;
- }
-
- x = 0;
- while (x < endRes - startRes)
- {
- if (av.hasHiddenColumns)
- {
- column = av.getColumnSelection().adjustForHiddenColumns(
- startRes + x);
- if (column > row.annotations.length - 1)
- {
- break;
- }
- }
- else
- {
- column = startRes + x;
- }
-
- if ((row.annotations == null) || (row.annotations.length <= column)
- || (row.annotations[column] == null))
- {
- validRes = false;
- }
- else
- {
- validRes = true;
- }
-
- if (activeRow == i)
- {
- g.setColor(Color.red);
-
- if (av.getColumnSelection() != null)
- {
- for (int n = 0; n < av.getColumnSelection().size(); n++)
- {
- int v = av.getColumnSelection().columnAt(n);
-
- if (v == column)
- {
- g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight);
- }
- }
- }
- }
-
- if (av.validCharWidth && validRes
- && row.annotations[column].displayCharacter != null
- && (row.annotations[column].displayCharacter.length() > 0))
- {
-
- if (centreColLabels || scaleColLabel)
- {
- fmWidth = (float) fm.charsWidth(
- row.annotations[column].displayCharacter.toCharArray(),
- 0, row.annotations[column].displayCharacter.length());
-
- if (scaleColLabel)
- {
- // justify the label and scale to fit in column
- if (fmWidth > av.charWidth)
- {
- // scale only if the current font isn't already small enough
- fmScaling = av.charWidth;
- fmScaling /= fmWidth;
- g.setFont(ofont.deriveFont(AffineTransform
- .getScaleInstance(fmScaling, 1.0)));
- // and update the label's width to reflect the scaling.
- fmWidth = av.charWidth;
- }
- }
- }
- else
- {
- fmWidth = (float) fm
- .charWidth(row.annotations[column].displayCharacter
- .charAt(0));
- }
- charOffset = (int) ((av.charWidth - fmWidth) / 2f);
-
- if (row.annotations[column].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(row.annotations[column].colour);
-
- if (column == 0 || row.graph > 0)
- {
- g.drawString(row.annotations[column].displayCharacter,
- (x * av.charWidth) + charOffset, y + iconOffset);
- }
- else if (row.annotations[column - 1] == null
- || (labelAllCols
- || !row.annotations[column].displayCharacter
- .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
- .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
- {
- g.drawString(row.annotations[column].displayCharacter, x
- * av.charWidth + charOffset, y + iconOffset);
- }
- g.setFont(ofont);
- }
-
- if (row.hasIcons)
- {
- if (!validRes
- || (row.annotations[column].secondaryStructure != lastSS))
- {
- switch (lastSS)
- {
- case 'H':
- g.setColor(HELIX_COLOUR);
- if (MAC)
- {
- // Off by 1 offset when drawing rects and ovals
- // to offscreen image on the MAC
- g.fillRoundRect(lastSSX, y + 4 + iconOffset,
- (x * av.charWidth) - lastSSX, 7, 8, 8);
- break;
- }
-
- int sCol = (lastSSX / av.charWidth) + startRes;
- int x1 = lastSSX;
- int x2 = (x * av.charWidth);
-
- if (sCol == 0
- || row.annotations[sCol - 1] == null
- || row.annotations[sCol - 1].secondaryStructure != 'H')
- {
- g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90,
- 180);
- x1 += av.charWidth / 2;
- }
-
- if (!validRes || row.annotations[column] == null
- || row.annotations[column].secondaryStructure != 'H')
- {
- g.fillArc((x * av.charWidth) - av.charWidth, y + 4
- + iconOffset, av.charWidth, 8, 270, 180);
- x2 -= av.charWidth / 2;
- }
-
- g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
- break;
-
- case 'E':
- g.setColor(SHEET_COLOUR);
- g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
- - lastSSX - 4, 7);
- g.fillPolygon(new int[]
- { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
- (x * av.charWidth) }, new int[]
- { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset },
- 3);
-
- break;
-
- default:
- g.setColor(Color.gray);
- g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
- - lastSSX, 2);
-
- break;
- }
-
- if (validRes)
- {
- lastSS = row.annotations[column].secondaryStructure;
- }
- else
- {
- lastSS = ' ';
- }
-
- lastSSX = (x * av.charWidth);
- }
- }
-
- column++;
- x++;
- }
-
- if (column >= row.annotations.length)
- {
- column = row.annotations.length - 1;
- validEnd = false;
- }
- else
- {
- validEnd = true;
- }
-
- // x ++;
-
- if (row.hasIcons)
- {
- switch (lastSS)
- {
- case 'H':
- g.setColor(HELIX_COLOUR);
- if (MAC)
- {
- // Off by 1 offset when drawing rects and ovals
- // to offscreen image on the MAC
- g.fillRoundRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
- - lastSSX, 7, 8, 8);
- break;
- }
-
- int sCol = (lastSSX / av.charWidth) + startRes;
- int x1 = lastSSX;
- int x2 = (x * av.charWidth);
-
- if (sCol == 0 || row.annotations[sCol - 1] == null
- || row.annotations[sCol - 1].secondaryStructure != 'H')
- {
- g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180);
- x1 += av.charWidth / 2;
- }
-
- if (row.annotations[column] == null
- || row.annotations[column].secondaryStructure != 'H')
- {
- g.fillArc((x * av.charWidth) - av.charWidth,
- y + 4 + iconOffset, av.charWidth, 8, 270, 180);
- x2 -= av.charWidth / 2;
- }
-
- g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
-
- break;
-
- case 'E':
- g.setColor(SHEET_COLOUR);
-
- if (!validEnd || row.annotations[endRes] == null
- || row.annotations[endRes].secondaryStructure != 'E')
- {
- g.fillRect(lastSSX, y + 4 + iconOffset, (x * av.charWidth)
- - lastSSX - 4, 7);
- g.fillPolygon(new int[]
- { (x * av.charWidth) - 4, (x * av.charWidth) - 4,
- (x * av.charWidth) }, new int[]
- { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, 3);
- }
- else
- {
- g.fillRect(lastSSX, y + 4 + iconOffset, (x + 1) * av.charWidth
- - lastSSX, 7);
- }
- break;
-
- default:
- g.setColor(Color.gray);
- g.fillRect(lastSSX, y + 6 + iconOffset, (x * av.charWidth)
- - lastSSX, 2);
-
- break;
- }
- }
-
- if (row.graph > 0 && row.graphHeight > 0)
- {
- if (row.graph == AlignmentAnnotation.LINE_GRAPH)
- {
- if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
- {
- float groupmax = -999999, groupmin = 9999999;
- for (int gg = 0; gg < aa.length; gg++)
- {
- if (aa[gg].graphGroup != row.graphGroup)
- {
- continue;
- }
-
- if (aa[gg] != row)
- {
- aa[gg].visible = false;
- }
-
- if (aa[gg].graphMax > groupmax)
- {
- groupmax = aa[gg].graphMax;
- }
- if (aa[gg].graphMin < groupmin)
- {
- groupmin = aa[gg].graphMin;
- }
- }
-
- for (int gg = 0; gg < aa.length; gg++)
- {
- if (aa[gg].graphGroup == row.graphGroup)
- {
- drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
- groupmax, row.graphHeight);
- }
- }
-
- graphGroupDrawn[row.graphGroup] = true;
- }
- else
- {
- drawLineGraph(g, row, startRes, endRes, y, row.graphMin,
- row.graphMax, row.graphHeight);
- }
- }
- else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
- {
- drawBarGraph(g, row, startRes, endRes, row.graphMin,
- row.graphMax, y);
- }
- }
-
- if (row.graph > 0 && row.hasText)
- {
- y += av.charHeight;
- }
-
- if (row.graph == 0)
- {
- y += aa[i].height;
- }
- }
- }
-
- public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes,
- int eRes, int y, float min, float max, int graphHeight)
- {
- if (sRes > aa.annotations.length)
- {
- return;
- }
-
- int x = 0;
-
- // Adjustment for fastpaint to left
- if (eRes < av.endRes)
- {
- eRes++;
- }
-
- eRes = Math.min(eRes, aa.annotations.length);
-
- if (sRes == 0)
- {
- x++;
- }
-
- int y1 = y, y2 = y;
- float range = max - min;
-
- // //Draw origin
- if (min < 0)
- {
- y2 = y - (int) ((0 - min / range) * graphHeight);
- }
-
- g.setColor(Color.gray);
- g.drawLine(x - av.charWidth, y2, (eRes - sRes + 1) * av.charWidth, y2);
-
- eRes = Math.min(eRes, aa.annotations.length);
-
- int column;
- int aaMax = aa.annotations.length - 1;
-
- while (x < eRes - sRes)
- {
- column = sRes + x;
- if (av.hasHiddenColumns)
- {
- column = av.getColumnSelection().adjustForHiddenColumns(column);
- }
-
- if (column > aaMax)
- {
- break;
- }
-
- if (aa.annotations[column] == null
- || aa.annotations[column - 1] == null)
- {
- x++;
- continue;
- }
-
- if (aa.annotations[column].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(aa.annotations[column].colour);
-
- y1 = y
- - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
- y2 = y
- - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
-
- g.drawLine(x * av.charWidth - av.charWidth / 2, y1, x * av.charWidth
- + av.charWidth / 2, y2);
- x++;
- }
-
- if (aa.threshold != null)
- {
- g.setColor(aa.threshold.colour);
- Graphics2D g2 = (Graphics2D) g;
- g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
- BasicStroke.JOIN_ROUND, 3f, new float[]
- { 5f, 3f }, 0f));
-
- y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
- g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
- g2.setStroke(new BasicStroke());
- }
+ renderer.drawComponent(this, av, g, activeRow, startRes, endRes);
}
- public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes,
- int eRes, float min, float max, int y)
+ @Override
+ public FontMetrics getFontMetrics()
{
- ColourSchemeI profcolour = av.getGlobalColourScheme();
- if (profcolour == null)
- {
- profcolour = new jalview.schemes.ZappoColourScheme();
- }
- if (sRes > aa.annotations.length)
- {
- return;
- }
- Font ofont = g.getFont();
- eRes = Math.min(eRes, aa.annotations.length);
-
- int x = 0, y1 = y, y2 = y;
-
- float range = max - min;
-
- if (min < 0)
- {
- y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
- }
-
- g.setColor(Color.gray);
-
- g.drawLine(x, y2, (eRes - sRes) * av.charWidth, y2);
-
- int column;
- int aaMax = aa.annotations.length - 1;
- boolean renderHistogram = true, renderProfile = true;
- if (aa.autoCalculated && aa.label.startsWith("Consensus"))
- {
- // TODO: generalise this to have render styles for consensus/profile data
- if (aa.groupRef != null)
- {
- renderHistogram = aa.groupRef.isShowConsensusHistogram();
- renderProfile = aa.groupRef.isShowSequenceLogo();
- }
- else
- {
- renderHistogram = av.isShowConsensusHistogram();
- renderProfile = av.isShowSequenceLogo();
- }
- }
- while (x < eRes - sRes)
- {
- column = sRes + x;
- if (av.hasHiddenColumns)
- {
- column = av.getColumnSelection().adjustForHiddenColumns(column);
- }
-
- if (column > aaMax)
- {
- break;
- }
-
- if (aa.annotations[column] == null)
- {
- x++;
- continue;
- }
- if (aa.annotations[column].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(aa.annotations[column].colour);
-
- y1 = y
- - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
-
- if (renderHistogram)
- {
- if (y1 - y2 > 0)
- {
- g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
- }
- else
- {
- g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
- }
- }
- // draw profile if available
- if (renderProfile && aa.annotations[column].value != 0)
- {
- int profl[] = getProfileFor(aa, column);
- int ht = y1, htn = y2 - y1;// aa.graphHeight;
- float wdth;
- double ht2 = 0;
- char[] dc = new char[1];
- LineMetrics lm;
- for (int c = 1; profl != null && c < profl[0];)
- {
- dc[0] = (char) profl[c++];
- wdth = av.charWidth;
- wdth /= (float) fm.charsWidth(dc, 0, 1);
-
- if (c > 2)
- {
- ht += (int) ht2;
- }
- {
- // if (aa.annotations[column].value==0) {
- // g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(wdth,
- // (ht2=(aa.graphHeight*0.1/av.charHeight)))));
- // ht = y2-(int)ht2;
- // } else {
- g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(
- wdth, (ht2 = (htn * ((double) profl[c++]) / 100.0))
- / av.charHeight)));
- lm = g.getFontMetrics().getLineMetrics(dc, 0, 1, g);
- // htn -=ht2;
- // }
- g.setColor(profcolour.findColour(dc[0])); // (av.globalColourScheme!=null)
- // ? );// try to get a
- // colourscheme for the
- // group(aa.groupRef.cs==null)
- // ? av.textColour2 :
- // cs.findColour(dc));
- g.drawChars(dc, 0, 1, x * av.charWidth,
- (int) (ht + lm.getHeight()));
- // ht+=g.getFontMetrics().getAscent()-g.getFontMetrics().getDescent();
- }
- }
- g.setFont(ofont);
- }
- x++;
- }
- if (aa.threshold != null)
- {
- g.setColor(aa.threshold.colour);
- Graphics2D g2 = (Graphics2D) g;
- g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
- BasicStroke.JOIN_ROUND, 3f, new float[]
- { 5f, 3f }, 0f));
-
- y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
- g.drawLine(0, y2, (eRes - sRes) * av.charWidth, y2);
- g2.setStroke(new BasicStroke());
- }
+ return fm;
}
- private int[] getProfileFor(AlignmentAnnotation aa, int column)
+ @Override
+ public Image getFadedImage()
{
- if (aa.autoCalculated && aa.label.startsWith("Consensus"))
- {
- if (aa.groupRef != null && aa.groupRef.consensusData != null
- && aa.groupRef.isShowSequenceLogo())
- {
- return AAFrequency.extractProfile(
- aa.groupRef.consensusData[column],
- aa.groupRef.getIgnoreGapsConsensus());
- }
- // TODO extend annotation row to enable dynamic and static profile data to
- // be stored
- if (aa.groupRef == null && aa.sequenceRef == null
- && av.isShowSequenceLogo())
- {
- return AAFrequency.extractProfile(av.hconsensus[column],
- av.getIgnoreGapsConsensus());
- }
- }
- return null;
+ return fadedImage;
}
- // used by overview window
- public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
- int y, int sRes, int eRes)
+ @Override
+ public int getFadedImageWidth()
{
- eRes = Math.min(eRes, aa.annotations.length);
- g.setColor(Color.white);
- g.fillRect(0, 0, width, y);
- g.setColor(new Color(0, 0, 180));
-
- int x = 0, height;
-
- for (int j = sRes; j < eRes; j++)
- {
- if (aa.annotations[j] != null)
- {
- if (aa.annotations[j].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(aa.annotations[j].colour);
-
- height = (int) ((aa.annotations[j].value / aa.graphMax) * y);
- if (height > y)
- {
- height = y;
- }
-
- g.fillRect(x, y - height, av.charWidth, height);
- }
- x += av.charWidth;
- }
+ return imgWidth;
}
-
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
buriedColour.setSelected(true);
jmb.setJalviewColourScheme(new BuriedColourScheme());
}
-
+
+ public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
+ {
+ setJalviewColourScheme(new PurinePyrimidineColourScheme());
+ }
+
public void userColour_actionPerformed(ActionEvent actionEvent)
{
userColour.setSelected(true);
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.gui;
+
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.awt.*;
+
+import javax.swing.*;
+import javax.swing.event.*;
+
+import java.awt.event.*;
+import java.io.*;
+
+import jalview.api.SequenceStructureBinding;
+import jalview.bin.Cache;
+import jalview.datamodel.*;
+import jalview.gui.ViewSelectionMenu.ViewSetProvider;
+import jalview.structure.*;
+import jalview.io.*;
+import jalview.schemes.*;
+import fr.orsay.lri.varna.VARNAPanel;
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
+import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
+import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
+import fr.orsay.lri.varna.models.VARNAConfig;
+import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation;
+import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide;
+import fr.orsay.lri.varna.models.rna.RNA;
+
+
+public class AppVarna extends JInternalFrame implements InterfaceVARNAListener,SecondaryStructureListener// implements Runnable,SequenceStructureBinding, ViewSetProvider
+
+{
+ AppVarnaBinding vab;
+
+ VARNAPanel varnaPanel;
+
+ public String name;
+
+ public StructureSelectionManager ssm;
+
+ /*public AppVarna(){
+ vab = new AppVarnaBinding();
+ initVarna();
+ }*/
+
+
+
+ public AppVarna(String seq,String struc,String name,AlignmentPanel ap){
+ ArrayList<RNA> rnaList = new ArrayList<RNA>();
+ RNA rna1 = new RNA(name);
+ try {
+ rna1.setRNA(seq,replaceOddGaps(struc));
+ } catch (ExceptionUnmatchedClosingParentheses e2) {
+ e2.printStackTrace();
+ } catch (ExceptionFileFormatOrSyntax e3) {
+ e3.printStackTrace();
+ }
+ rnaList.add(trimRNA(rna1));
+ rnaList.add(rna1);
+ rna1.setName("consenus_"+rna1.getName());
+
+
+ vab = new AppVarnaBinding(rnaList);
+ //vab = new AppVarnaBinding(seq,struc);
+ //System.out.println("Hallo: "+name);
+ this.name=name;
+ initVarna();
+ ssm = ap.getStructureSelectionManager();
+ ssm.addStructureViewerListener(this);
+ }
+
+ public void initVarna(){
+ //vab.setFinishedInit(false);
+ varnaPanel=vab.get_varnaPanel();
+ setBackground(Color.white);
+ JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,vab.getListPanel(),varnaPanel);
+ getContentPane().setLayout(new BorderLayout());
+ getContentPane().add(split, BorderLayout.CENTER);
+ //getContentPane().add(vab.getTools(), BorderLayout.NORTH);
+ varnaPanel.addVARNAListener(this);
+ jalview.gui.Desktop.addInternalFrame(this,"VARNA -"+name,getBounds().width, getBounds().height);
+ this.pack();
+ showPanel(true);
+ }
+
+ public String replaceOddGaps(String oldStr){
+ String patternStr = "[^([{<>}])]";
+ String replacementStr = ".";
+ Pattern pattern = Pattern.compile(patternStr);
+ Matcher matcher = pattern.matcher(oldStr);
+ String newStr=matcher.replaceAll(replacementStr);
+ return newStr;
+ }
+
+ public RNA trimRNA(RNA rna){
+ RNA rnaTrim = new RNA("trim_"+rna.getName());
+ try {
+ rnaTrim.setRNA(rna.getSeq(),replaceOddGaps(rna.getStructDBN()));
+ } catch (ExceptionUnmatchedClosingParentheses e2) {
+ e2.printStackTrace();
+ } catch (ExceptionFileFormatOrSyntax e3) {
+ e3.printStackTrace();
+ }
+
+ StringBuffer seq=new StringBuffer(rnaTrim.getSeq());
+ StringBuffer struc=new StringBuffer(rnaTrim.getStructDBN());
+ for(int i=0;i<rnaTrim.getSeq().length();i++){
+ //TODO: Jalview utility for gap detection java.utils.isGap()
+ //TODO: Switch to jalview rna datamodel
+ if(seq.substring(i, i+1).compareTo("-")==0 || seq.substring(i, i+1).compareTo(".")==0){
+ if(!rnaTrim.findPair(i).isEmpty()){
+ int m=rnaTrim.findPair(i).get(1);
+ int l=rnaTrim.findPair(i).get(0);
+
+ struc.replace(m, m+1, "*");
+ struc.replace(l, l+1, "*");
+ }else{
+ struc.replace(i, i+1, "*");
+ }
+ }
+ }
+
+ String newSeq=rnaTrim.getSeq().replace("-", "");
+ rnaTrim.getSeq().replace(".", "");
+ String newStruc=struc.toString().replace("*", "");
+
+ try {
+ rnaTrim.setRNA(newSeq,newStruc);
+ } catch (ExceptionUnmatchedClosingParentheses e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (ExceptionFileFormatOrSyntax e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return rnaTrim;
+ }
+
+ public void showPanel(boolean show){
+ this.setVisible(show);
+ }
+
+ private boolean _started = false;
+
+ public void run(){
+ _started = true;
+
+ try
+ {
+ initVarna();
+ } catch (OutOfMemoryError oomerror)
+ {
+ new OOMWarning("When trying to open the Varna viewer!", oomerror);
+ } catch (Exception ex)
+ {
+ Cache.log.error("Couldn't open Varna viewer!", ex);
+ }
+ }
+
+@Override
+public void onUINewStructure(VARNAConfig v, RNA r) {
+ // TODO Auto-generated method stub
+
+}
+
+@Override
+public void onWarningEmitted(String s) {
+ // TODO Auto-generated method stub
+
+}
+/**
+ * If a mouseOver event from the AlignmentPanel
+ * is noticed the currently selected RNA in the
+ * VARNA window is highlighted at the specific position.
+ * To be able to remove it before the next highlight
+ * it is saved in _lastHighlight
+ */
+private HighlightRegionAnnotation _lastHighlight;
+@Override
+public void mouseOverSequence(SequenceI sequence, int index) {
+ // TODO Auto-generated method stub
+ RNA rna=vab.getSelectedRNA();
+ rna.removeHighlightRegion(_lastHighlight);
+
+ HighlightRegionAnnotation highlight = new HighlightRegionAnnotation(rna.getBasesBetween(index,index));
+ rna.addHighlightRegion(highlight);
+ _lastHighlight=highlight;
+ vab.updateSelectedRNA(rna);
+}
+
+@Override
+public void mouseOverStructure(int atomIndex, String strInfo) {
+ // TODO Auto-generated method stub
+
+}
+
+@Override
+public void onStructureRedrawn()
+{
+ // TODO Auto-generated method stub
+
+}
+
+
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.GridLayout;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ComponentEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.io.File;
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.DefaultListModel;
+import javax.swing.DefaultListSelectionModel;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTextField;
+import javax.swing.ListModel;
+import javax.swing.ListSelectionModel;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import fr.orsay.lri.varna.VARNAPanel;
+import fr.orsay.lri.varna.components.ReorderableJList;
+import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
+import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
+import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
+import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
+import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
+import fr.orsay.lri.varna.models.FullBackup;
+import fr.orsay.lri.varna.models.VARNAConfig;
+import fr.orsay.lri.varna.models.rna.Mapping;
+import fr.orsay.lri.varna.models.rna.RNA;
+
+public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding implements DropTargetListener, InterfaceVARNAListener, MouseListener {
+
+ /**
+ *
+ */
+ //private static final long serialVersionUID = -790155708306987257L;
+
+ private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
+ private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
+ private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
+ public VARNAPanel vp;
+
+ protected JPanel _tools = new JPanel();
+ private JPanel _input = new JPanel();
+
+ private JPanel _seqPanel = new JPanel();
+ private JPanel _strPanel = new JPanel();
+ private JLabel _info = new JLabel();
+ private JTextField _str = new JTextField();
+ private JTextField _seq = new JTextField();
+ private JLabel _strLabel = new JLabel(" Str:");
+ private JLabel _seqLabel = new JLabel(" Seq:");
+ private JButton _createButton = new JButton("Create");
+ private JButton _updateButton = new JButton("Update");
+ private JButton _deleteButton = new JButton("Delete");
+ private JButton _duplicateButton = new JButton("Snapshot");
+
+ protected JPanel _listPanel = new JPanel();
+ private ReorderableJList _sideList = null;
+
+
+ private static String errorOpt = "error";
+ @SuppressWarnings("unused")
+ private boolean _error;
+
+ private Color _backgroundColor = Color.white;
+
+ private static int _nextID = 1;
+ @SuppressWarnings("unused")
+ private int _algoCode;
+
+ private BackupHolder _rnaList;
+
+
+ /*public AppVarnaBinding() {
+ //super("VARNA in Jalview");
+ //this.set_seq("ATGC");
+ //this.set_str(".().");
+ //RNAPanelDemoInit();
+
+ //initVarna("ATGCATGATATATATATAT","....((((...))))....");
+ initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1);
+ }*/
+
+ public AppVarnaBinding(String seq,String struc){
+ //super("VARNA in Jalview");
+ initVarna(seq,struc);
+ }
+
+ public AppVarnaBinding(ArrayList<RNA> rnaList){
+ //super("VARNA in Jalview");
+ initVarnaEdit(rnaList);
+ }
+
+
+
+ private void initVarna(String seq, String str){
+ DefaultListModel dlm = new DefaultListModel();
+
+ DefaultListSelectionModel m = new DefaultListSelectionModel();
+ m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ m.setLeadAnchorNotificationEnabled(false);
+
+ _sideList = new ReorderableJList();
+ _sideList.setModel(dlm);
+ _sideList.addMouseListener(this);
+ _sideList.setSelectionModel(m);
+ _sideList.setPreferredSize(new Dimension(100, 0));
+ _sideList.addListSelectionListener( new ListSelectionListener(){
+ public void valueChanged(ListSelectionEvent arg0) {
+ if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
+ {
+ FullBackup sel = (FullBackup) _sideList.getSelectedValue();
+ Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
+ vp.showRNAInterpolated(sel.rna,sel.config,map);
+ _seq.setText(sel.rna.getSeq());
+ _str.setText(sel.rna.getStructDBN());
+ }
+ }
+ });
+
+ _rnaList = new BackupHolder(dlm,_sideList);
+ RNA _RNA1 = new RNA("User defined 1");
+
+ try {
+ vp = new VARNAPanel("0",".");
+ _RNA1.setRNA(seq, str);
+ _RNA1.drawRNARadiate(vp.getConfig());
+ } catch (ExceptionNonEqualLength e) {
+ vp.errorDialog(e);
+ } catch (ExceptionUnmatchedClosingParentheses e2) {
+ e2.printStackTrace();
+ } catch (ExceptionFileFormatOrSyntax e3) {
+ e3.printStackTrace();
+ }
+ vp.setPreferredSize(new Dimension(400, 400));
+ _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
+
+ //TODO setBackground(_backgroundColor);
+ vp.setBackground(_backgroundColor);
+
+ //TODO getContentPane().setLayout(new BorderLayout());
+ //TODO getContentPane().add(vp, BorderLayout.CENTER);
+
+ //setVisible(true);
+ vp.addVARNAListener(this);
+ }
+
+ private void initVarnaEdit(ArrayList<RNA> rnaInList)
+ {
+ DefaultListModel dlm = new DefaultListModel();
+
+
+ int marginTools = 40;
+
+ DefaultListSelectionModel m = new DefaultListSelectionModel();
+ m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ m.setLeadAnchorNotificationEnabled(false);
+
+
+ _sideList = new ReorderableJList();
+ _sideList.setModel(dlm);
+ _sideList.addMouseListener(this);
+ _sideList.setSelectionModel(m);
+ _sideList.setPreferredSize(new Dimension(100, 0));
+ _sideList.addListSelectionListener( new ListSelectionListener(){
+ public void valueChanged(ListSelectionEvent arg0) {
+ //System.out.println(arg0);
+ if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
+ {
+ FullBackup sel = (FullBackup) _sideList.getSelectedValue();
+ Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
+ vp.showRNAInterpolated(sel.rna,sel.config,map);
+ //_seq.setText(sel.rna.getSeq());
+ _str.setText(sel.rna.getStructDBN());
+ }
+ }
+ });
+ _rnaList = new BackupHolder(dlm,_sideList);
+
+ try {
+ vp = new VARNAPanel("0",".");
+ for(int i=0;i<rnaInList.size();i++){
+ rnaInList.get(i).drawRNARadiate(vp.getConfig());
+ }
+ } catch (ExceptionNonEqualLength e) {
+ vp.errorDialog(e);
+ }
+ vp.setPreferredSize(new Dimension(400, 400));
+ for(int i=0;i<rnaInList.size();i++){
+ if(i<rnaInList.size()-1){
+ _rnaList.add(vp.getConfig().clone(),rnaInList.get(i),rnaInList.get(i).getName());
+ }else{
+ _rnaList.add(vp.getConfig().clone(),rnaInList.get(i),rnaInList.get(i).getName(),true);
+ }
+ }
+
+ /*_rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
+ _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);*/
+
+ JScrollPane listScroller = new JScrollPane(_sideList);
+ listScroller.setPreferredSize(new Dimension(150, 0));
+
+ vp.setBackground(_backgroundColor);
+
+
+ Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
+
+ //_seqLabel.setHorizontalTextPosition(JLabel.LEFT);
+ //_seqLabel.setPreferredSize(new Dimension(marginTools, 15));
+ _seq.setFont(textFieldsFont);
+ _seq.setText(rnaInList.get(0).getSeq());
+
+ _updateButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ FullBackup sel = (FullBackup) _sideList.getSelectedValue();
+ sel.rna.setSequence("A");
+ }
+ });
+
+ //_seqPanel.setLayout(new BorderLayout());
+ //_seqPanel.add(_seqLabel, BorderLayout.WEST);
+ //_seqPanel.add(_seq, BorderLayout.CENTER);
+
+ _strLabel.setPreferredSize(new Dimension(marginTools, 15));
+ _strLabel.setHorizontalTextPosition(JLabel.LEFT);
+ _str.setFont(textFieldsFont);
+ _strPanel.setLayout(new BorderLayout());
+ _strPanel.add(_strLabel, BorderLayout.WEST);
+ _strPanel.add(_str, BorderLayout.CENTER);
+
+ _input.setLayout(new GridLayout(1, 0));
+ //_input.add(_seqPanel);
+ _input.add(_strPanel);
+
+ JPanel goPanel = new JPanel();
+ goPanel.setLayout(new BorderLayout());
+
+ _tools.setLayout(new BorderLayout());
+ _tools.add(_input, BorderLayout.CENTER);
+ //_tools.add(_info, BorderLayout.SOUTH);
+ _tools.add(goPanel, BorderLayout.EAST);
+
+ /*_deleteButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ _rnaList.removeSelected();
+ }
+ });
+ _duplicateButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ _rnaList.add((VARNAConfig)vp.getConfig().clone(),vp.getRNA().clone(),vp.getRNA().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new Date()),true);
+ }});
+ */
+ goPanel.add(_updateButton, BorderLayout.CENTER);
+
+
+ JPanel ops = new JPanel();
+ ops.setLayout(new GridLayout(1,2));
+ ops.add(_deleteButton);
+ ops.add(_duplicateButton);
+
+ JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
+ _listPanel.setLayout(new BorderLayout());
+
+ _listPanel.add(ops,BorderLayout.SOUTH);
+ _listPanel.add(j,BorderLayout.NORTH);
+ _listPanel.add(listScroller,BorderLayout.CENTER);
+
+
+
+ //JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
+ /**TODO
+ getContentPane().setLayout(new BorderLayout());
+ getContentPane().add(split, BorderLayout.CENTER);
+ getContentPane().add(_tools, BorderLayout.NORTH);
+ */
+
+ //TODO setVisible(true);
+ DropTarget dt = new DropTarget(vp, this);
+
+ vp.addVARNAListener(this);
+ }
+
+ public JPanel getTools(){
+ return _tools;
+ }
+
+ public JPanel getListPanel(){
+ return _listPanel;
+ }
+
+ /**
+ * TODO: Is it effective to transfer the whole RNA?
+ * @return Currently selected RNA
+ */
+ public RNA getSelectedRNA(){
+ return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
+ }
+
+ /**
+ * Substitute currently selected RNA with the edited one
+ * @param rnaEdit
+ */
+ public void updateSelectedRNA(RNA rnaEdit){
+ vp.repaint();
+ vp.showRNA(rnaEdit);
+ }
+
+ /*
+ private void RNAPanelDemoInit()
+ {
+ DefaultListModel dlm = new DefaultListModel();
+
+
+ int marginTools = 40;
+
+ DefaultListSelectionModel m = new DefaultListSelectionModel();
+ m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ m.setLeadAnchorNotificationEnabled(false);
+
+
+ _sideList = new ReorderableJList();
+ _sideList.setModel(dlm);
+ _sideList.addMouseListener(this);
+ _sideList.setSelectionModel(m);
+ _sideList.setPreferredSize(new Dimension(100, 0));
+ _sideList.addListSelectionListener( new ListSelectionListener(){
+ public void valueChanged(ListSelectionEvent arg0) {
+ //System.out.println(arg0);
+ if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
+ {
+ FullBackup sel = (FullBackup) _sideList.getSelectedValue();
+ Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
+ vp.showRNAInterpolated(sel.rna,sel.config,map);
+ _seq.setText(sel.rna.getSeq());
+ _str.setText(sel.rna.getStructDBN());
+ }
+ }
+ });
+
+ _rnaList = new BackupHolder(dlm,_sideList);
+ RNA _RNA1 = new RNA("User defined 1");
+ RNA _RNA2 = new RNA("User defined 2");
+ try {
+ vp = new VARNAPanel("0",".");
+ _RNA1.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE1);
+ _RNA1.drawRNARadiate(vp.getConfig());
+ _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
+ _RNA2.drawRNARadiate(vp.getConfig());
+ } catch (ExceptionNonEqualLength e) {
+ vp.errorDialog(e);
+ } catch (ExceptionUnmatchedClosingParentheses e2) {
+ e2.printStackTrace();
+ } catch (ExceptionFileFormatOrSyntax e3) {
+ e3.printStackTrace();
+ }
+ vp.setPreferredSize(new Dimension(400, 400));
+ _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
+ _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
+
+ JScrollPane listScroller = new JScrollPane(_sideList);
+ listScroller.setPreferredSize(new Dimension(150, 0));
+
+ setBackground(_backgroundColor);
+ vp.setBackground(_backgroundColor);
+
+
+ Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
+
+ _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
+ _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
+ _seq.setFont(textFieldsFont);
+ _seq.setText(DEFAULT_SEQUENCE);
+
+ _createButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ RNA nRNA = new RNA(generateDefaultName());
+ nRNA.setRNA(_seq.getText(), _str.getText());
+ nRNA.drawRNARadiate(vp.getConfig());
+ _rnaList.add(new VARNAConfig(),nRNA,true);
+ } catch (ExceptionUnmatchedClosingParentheses e1) {
+ JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
+ } catch (ExceptionFileFormatOrSyntax e1) {
+ JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
+ }
+ }
+ });
+
+
+ _seqPanel.setLayout(new BorderLayout());
+ _seqPanel.add(_seqLabel, BorderLayout.WEST);
+ _seqPanel.add(_seq, BorderLayout.CENTER);
+
+ _strLabel.setPreferredSize(new Dimension(marginTools, 15));
+ _strLabel.setHorizontalTextPosition(JLabel.LEFT);
+ _str.setFont(textFieldsFont);
+ _strPanel.setLayout(new BorderLayout());
+ _strPanel.add(_strLabel, BorderLayout.WEST);
+ _strPanel.add(_str, BorderLayout.CENTER);
+
+ _input.setLayout(new GridLayout(2, 0));
+ _input.add(_seqPanel);
+ _input.add(_strPanel);
+
+ JPanel goPanel = new JPanel();
+ goPanel.setLayout(new BorderLayout());
+
+ _tools.setLayout(new BorderLayout());
+ _tools.add(_input, BorderLayout.CENTER);
+ _tools.add(_info, BorderLayout.SOUTH);
+ _tools.add(goPanel, BorderLayout.EAST);
+
+ _deleteButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ _rnaList.removeSelected();
+ }
+ });
+ _duplicateButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ _rnaList.add((VARNAConfig)vp.getConfig().clone(),vp.getRNA().clone(),vp.getRNA().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new Date()),true);
+ }});
+
+ JPanel ops = new JPanel();
+ ops.setLayout(new GridLayout(1,2));
+ ops.add(_deleteButton);
+ ops.add(_duplicateButton);
+
+ JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
+ _listPanel.setLayout(new BorderLayout());
+
+ _listPanel.add(ops,BorderLayout.SOUTH);
+ _listPanel.add(j,BorderLayout.NORTH);
+ _listPanel.add(listScroller,BorderLayout.CENTER);
+
+ goPanel.add(_createButton, BorderLayout.CENTER);
+
+ JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
+ getContentPane().setLayout(new BorderLayout());
+ getContentPane().add(split, BorderLayout.CENTER);
+ getContentPane().add(_tools, BorderLayout.NORTH);
+
+ setVisible(true);
+ DropTarget dt = new DropTarget(vp, this);
+
+ vp.addVARNAListener(this);
+ }
+ */
+ public static String generateDefaultName()
+ {
+ return "User file #"+_nextID++;
+ }
+
+ public RNA getRNA() {
+ return (RNA)_sideList.getSelectedValue();
+ }
+
+
+
+ public String[][] getParameterInfo() {
+ String[][] info = {
+ // Parameter Name Kind of Value Description,
+ { "sequenceDBN", "String", "A raw RNA sequence" },
+ { "structureDBN", "String",
+ "An RNA structure in dot bracket notation (DBN)" },
+ { errorOpt, "boolean", "To show errors" }, };
+ return info;
+ }
+
+ public void init() {
+ vp.setBackground(_backgroundColor);
+ _error = true;
+ }
+
+ @SuppressWarnings("unused")
+ private Color getSafeColor(String col, Color def) {
+ Color result;
+ try {
+ result = Color.decode(col);
+ } catch (Exception e) {
+ try {
+ result = Color.getColor(col, def);
+ } catch (Exception e2) {
+ return def;
+ }
+ }
+ return result;
+ }
+
+ public VARNAPanel get_varnaPanel() {
+ return vp;
+ }
+
+ public void set_varnaPanel(VARNAPanel surface) {
+ vp = surface;
+ }
+
+
+ public String get_seq() {
+ return _seq.getText();
+ }
+
+ public void set_seq(String _seq) {
+ this._seq.setText(_seq);
+ }
+
+ public String get_str(){
+ return _str.getText();
+ }
+
+ public void set_str(String _str){
+ this._str.setText(_str);
+ }
+
+ public JLabel get_info() {
+ return _info;
+ }
+
+ public void set_info(JLabel _info) {
+ this._info = _info;
+ }
+
+ /*public static void main(String[] args) {
+ AppVarnaBinding d = new AppVarnaBinding();
+ d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ d.pack();
+ d.setVisible(true);
+ }*/
+
+
+ public void dragEnter(DropTargetDragEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void dragExit(DropTargetEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void dragOver(DropTargetDragEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void drop(DropTargetDropEvent dtde) {
+ try {
+ Transferable tr = dtde.getTransferable();
+ DataFlavor[] flavors = tr.getTransferDataFlavors();
+ for (int i = 0; i < flavors.length; i++) {
+ if (flavors[i].isFlavorJavaFileListType()) {
+ dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
+ Object ob = tr.getTransferData(flavors[i]);
+ if (ob instanceof List)
+ {
+ List list = (List) ob;
+ for (int j = 0; j < list.size(); j++) {
+ Object o = list.get(j);
+
+ if (dtde.getSource() instanceof DropTarget)
+ {
+ DropTarget dt = (DropTarget) dtde.getSource();
+ Component c = dt.getComponent();
+ if (c instanceof VARNAPanel)
+ {
+ String path = o.toString();
+ VARNAPanel vp = (VARNAPanel) c;
+ try{
+ FullBackup bck = VARNAPanel.importSession(path);
+ _rnaList.add(bck.config, bck.rna,bck.name,true);
+ }
+ catch (ExceptionLoadingFailed e3)
+ {
+ RNA r = new RNA();
+ r.loadSecStr(path);
+ r.drawRNA(vp.getConfig());
+ String name =r.getName();
+ if (name.equals(""))
+ {
+ name = path.substring(path.lastIndexOf(File.separatorChar)+1);
+ }
+ _rnaList.add(vp.getConfig().clone(),r,name,true);
+ }
+ }
+ }
+ }
+ }
+ // If we made it this far, everything worked.
+ dtde.dropComplete(true);
+ return;
+ }
+ }
+ // Hmm, the user must not have dropped a file list
+ dtde.rejectDrop();
+ } catch (Exception e) {
+ e.printStackTrace();
+ dtde.rejectDrop();
+ }
+
+ }
+
+ public void dropActionChanged(DropTargetDragEvent arg0) {
+ }
+
+ private class BackupHolder{
+ private DefaultListModel _rnaList;
+ private ArrayList<RNA> _rnas = new ArrayList<RNA>();
+ JList _l;
+
+ public BackupHolder(DefaultListModel rnaList, JList l)
+ {
+ _rnaList = rnaList;
+ _l = l;
+ }
+
+ public void add(VARNAConfig c, RNA r)
+ {
+ add(c, r, r.getName(),false);
+ }
+
+ public void add(VARNAConfig c, RNA r,boolean select)
+ {
+ add(c, r, r.getName(),select);
+ }
+
+ public void add(VARNAConfig c, RNA r, String name)
+ {
+ add(c, r, name,false);
+ }
+ public void add(VARNAConfig c, RNA r, String name, boolean select)
+ {
+ if (select){
+ _l.removeSelectionInterval(0, _rnaList.size());
+ }
+ if (name.equals(""))
+ {
+ name = generateDefaultName();
+ }
+ FullBackup bck = new FullBackup(c,r,name);
+ _rnas.add(0, r);
+ _rnaList.add(0,bck);
+ if (select){
+ _l.setSelectedIndex(0);
+ }
+ }
+
+ public void remove(int i)
+ {
+ _rnas.remove(i);
+ _rnaList.remove(i);
+
+ }
+ public DefaultListModel getModel()
+ {
+ return _rnaList;
+ }
+ public boolean contains(RNA r)
+ {
+ return _rnas.contains(r);
+ }
+ /*public int getSize()
+ {
+ return _rnaList.getSize();
+ }*/
+ public FullBackup getElementAt(int i)
+ {
+ return (FullBackup) _rnaList.getElementAt(i);
+ }
+
+ public void removeSelected()
+ {
+ int i = _l.getSelectedIndex();
+ if (i!=-1)
+ {
+ if (_rnaList.getSize()==1)
+ {
+ RNA r = new RNA();
+ try {
+ r.setRNA(" ", ".");
+ } catch (ExceptionUnmatchedClosingParentheses e1) {
+ } catch (ExceptionFileFormatOrSyntax e1) {
+ }
+ vp.showRNA(r);
+ vp.repaint();
+ }
+ else
+ {
+ int newi = i+1;
+ if (newi==_rnaList.getSize())
+ {
+ newi = _rnaList.getSize()-2;
+ }
+ FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
+ _l.setSelectedValue(bck,true);
+ }
+ _rnaList.remove(i);
+ }
+
+ }
+ }
+
+ public void onLayoutChanged() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onUINewStructure(VARNAConfig v, RNA r) {
+ _rnaList.add(v, r,"",true);
+ }
+
+ public void onWarningEmitted(String s) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseClicked(MouseEvent e) {
+ if(e.getClickCount() == 2){
+ int index = _sideList.locationToIndex(e.getPoint());
+ ListModel dlm = _sideList.getModel();
+ FullBackup item = (FullBackup) dlm.getElementAt(index);;
+ _sideList.ensureIndexIsVisible(index);
+ /*TODO Object newName = JOptionPane.showInputDialog(
+ this,
+ "Specify a new name for this RNA",
+ "Rename RNA",
+ JOptionPane.QUESTION_MESSAGE,
+ (Icon)null,
+ null,
+ item.toString());
+ if (newName!=null)
+ {
+ item.name = newName.toString();
+ this._sideList.repaint();
+ }*/
+ }
+ }
+
+ public void mouseEntered(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseExited(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mousePressed(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseReleased(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Color getColour(int atomIndex, int pdbResNum, String chain,
+ String pdbId) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String[] getPdbFile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void highlightAtom(int atomIndex, int pdbResNum, String chain,
+ String pdbId) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseOverStructure(int atomIndex, String strInfo) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void releaseReferences(Object svl) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void updateColours(Object source) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void componentHidden(ComponentEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void componentMoved(ComponentEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void componentResized(ComponentEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void componentShown(ComponentEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onStructureRedrawn()
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
+
+
+/*
+ public static void main(String[] args)
+ {
+ JTextField str = new JTextField("ATGC");
+
+ AppVarnaBinding vab = new AppVarnaBinding();
+ vab.varnagui.set_seq(str);
+ vab.varnagui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ vab.varnagui.pack();
+ vab.varnagui.setVisible(true);
+ }
+}
+*/
\ No newline at end of file
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
+++ /dev/null
-/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
- *
- * This file is part of Jalview.
- *
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * Jalview is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
- */
-package jalview.gui;
-
-import jalview.analysis.Conservation;
-import jalview.datamodel.Annotation;
-
-import java.awt.Color;
-
-class ConservationThread extends Thread
-{
- /**
- *
- */
- private AlignViewport alignViewport;
-
- AlignmentPanel ap;
-
- public ConservationThread(AlignViewport alignViewport, AlignmentPanel ap)
- {
- this.alignViewport = alignViewport;
- this.ap = ap;
- }
-
- public void run()
- {
- try
- {
- this.alignViewport.updatingConservation = true;
-
- while (AlignViewport.UPDATING_CONSERVATION)
- {
- try
- {
- if (ap != null)
- {
- ap.paintAlignment(false);
- }
- Thread.sleep(200);
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- AlignViewport.UPDATING_CONSERVATION = true;
-
- int alWidth;
-
- if (alignViewport==null || alignViewport.alignment==null || (alWidth=alignViewport.alignment.getWidth())< 0)
- {
- this.alignViewport.updatingConservation = false;
- AlignViewport.UPDATING_CONSERVATION = false;
- return;
- }
-
- Conservation cons = new jalview.analysis.Conservation("All",
- jalview.schemes.ResidueProperties.propHash, 3,
- this.alignViewport.alignment.getSequences(), 0, alWidth - 1);
-
- cons.calculate();
- cons.verdict(false, this.alignViewport.ConsPercGaps);
-
- if (this.alignViewport.quality != null)
- {
- cons.findQuality();
- }
- cons.completeAnnotations(alignViewport.conservation,
- alignViewport.quality, 0, alWidth);
- } catch (OutOfMemoryError error)
- {
- new OOMWarning("calculating conservation", error);
-
- this.alignViewport.conservation = null;
- this.alignViewport.quality = null;
-
- }
-
- AlignViewport.UPDATING_CONSERVATION = false;
- this.alignViewport.updatingConservation = false;
-
- if (ap != null)
- {
- ap.paintAlignment(true);
- }
-
- }
-}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
*/
public void aboutMenuItem_actionPerformed(ActionEvent e)
{
- StringBuffer message = new StringBuffer("Jalview version "
+ StringBuffer message = getAboutMessage(false);
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,
+
+ message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+ }
+ public StringBuffer getAboutMessage(boolean shortv)
+ {
+ StringBuffer message=new StringBuffer();
+ message.append("<html>");
+ if (shortv)
+ {
+ message.append("<h1><strong>Jalview "
+ + jalview.bin.Cache.getProperty("VERSION") + "</strong></h1><br>");
+ message.append("<strong>Last Updated: <em>"+jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")+"</em></strong>");
+
+ } else {
+
+ message.append("<strong>Jalview version "
+ jalview.bin.Cache.getProperty("VERSION") + "; last updated: "
+ jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"));
-
- if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals(
- jalview.bin.Cache.getProperty("VERSION")))
+ }
+
+ if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
+ "Checking"))
{
- message.append("\n\n!! Jalview version "
- + jalview.bin.Cache.getProperty("LATEST_VERSION")
- + " is available for download from "+jalview.bin.Cache.getDefault("www.jalview.org","http://www.jalview.org")+" !!\n");
-
+ message.append("<br>...Checking latest version...</br>");
}
- // TODO: update this text for each release or centrally store it for lite
- // and application
- message.append("\nAuthors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
- + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
- + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
- + "\nIf you use Jalview, please cite:"
- + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
- + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench"
- + "\nBioinformatics doi: 10.1093/bioinformatics/btp033");
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
-
- message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
+ else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
+ .equals(jalview.bin.Cache.getProperty("VERSION")))
+ {
+ boolean red=false;
+ if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+ .indexOf("automated build") == -1)
+ {
+ red=true;
+ // Displayed when code version and jnlp version do not match and code
+ // version is not a development build
+ message.append("<div style=\"color: #FF0000;font-style: bold;\">");
+ }
+
+ message.append("<br>!! Jalview version "
+ + jalview.bin.Cache.getDefault("LATEST_VERSION",
+ "..Checking..")
+ + " is available for download from "+jalview.bin.Cache.getDefault("www.jalview.org","http://www.jalview.org")+" !!");
+ if (red) {
+ message.append("</div>");
+ }
+ }
+ message.append("<br>Authors: "+jalview.bin.Cache.getDefault("AUTHORNAMES","Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton")
+ + "<br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
+ + "<br>For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list"
+ + "<br>If you use Jalview, please cite:"
+ + "<br>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+ + "<br>Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+ + "<br>Bioinformatics doi: 10.1093/bioinformatics/btp033"
+ + "</html>");
+ return message;
}
/**
source.viewport.gatherViewsHere = true;
source.viewport.explodedPosition = source.getBounds();
JInternalFrame[] frames = desktop.getAllFrames();
- String viewId = source.viewport.sequenceSetID;
+ String viewId = source.viewport.getSequenceSetId();
for (int t = 0; t < frames.length; t++)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
{
minmax = new Hashtable();
}
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment=av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- SequenceFeature[] features = av.alignment.getSequenceAt(i)
+ SequenceFeature[] features = alignment.getSequenceAt(i)
.getDatasetSequence().getSequenceFeatures();
if (features == null)
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
Vector allGroups = new Vector();
SequenceFeature[] tmpfeatures;
String group;
- for (int i = 0; i < af.getViewport().alignment.getHeight(); i++)
+ for (int i = 0; i < af.getViewport().getAlignment().getHeight(); i++)
{
- if (af.getViewport().alignment.getSequenceAt(i).getDatasetSequence()
+ if (af.getViewport().getAlignment().getSequenceAt(i).getDatasetSequence()
.getSequenceFeatures() == null)
{
continue;
}
- tmpfeatures = af.getViewport().alignment.getSequenceAt(i)
+ tmpfeatures = af.getViewport().getAlignment().getSequenceAt(i)
.getDatasetSequence().getSequenceFeatures();
int index = 0;
// Find out which features should be visible depending on which groups
// are selected / deselected
// and recompute average width ordering
- for (int i = 0; i < af.getViewport().alignment.getHeight(); i++)
+ for (int i = 0; i < af.getViewport().getAlignment().getHeight(); i++)
{
- tmpfeatures = af.getViewport().alignment.getSequenceAt(i)
+ tmpfeatures = af.getViewport().getAlignment().getSequenceAt(i)
.getDatasetSequence().getSequenceFeatures();
if (tmpfeatures == null)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
// TODO: add switches to control what is searched - sequences, IDS,
// descriptions, features
jalview.analysis.Finder finder = new jalview.analysis.Finder(
- av.alignment, av.getSelectionGroup(), seqIndex, resIndex);
+ av.getAlignment(), av.getSelectionGroup(), seqIndex, resIndex);
finder.setCaseSensitive(caseSensitive.isSelected());
finder.setFindAll(findAll);
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
gg.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
(((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
- if (av.hasHiddenRows && av.showHiddenMarkers)
+ if (av.hasHiddenRows() && av.showHiddenMarkers)
{
drawMarker(i, starty, ypos);
}
if (av.getWrapAlignment())
{
- int maxwidth = av.alignment.getWidth();
- int alheight = av.alignment.getHeight();
+ int maxwidth = av.getAlignment().getWidth();
+ int alheight = av.getAlignment().getHeight();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
{
for (int i = starty; i < alheight; i++)
{
- SequenceI s = av.alignment.getSequenceAt(i);
- if (av.hasHiddenRows)
+ SequenceI s = av.getAlignment().getSequenceAt(i);
+ if (av.hasHiddenRows())
{
setHiddenFont(s);
}
// Now draw the id strings
for (int i = starty; i < endy; i++)
{
- sequence = av.alignment.getSequenceAt(i);
+ sequence = av.getAlignment().getSequenceAt(i);
if (sequence == null)
{
continue;
}
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
setHiddenFont(sequence);
}
(((i - starty) * av.charHeight) + av.charHeight)
- (av.charHeight / 5));
- if (av.hasHiddenRows && av.showHiddenMarkers)
+ if (av.hasHiddenRows() && av.showHiddenMarkers)
{
drawMarker(i, starty, 0);
}
void drawMarker(int i, int starty, int yoffset)
{
- SequenceI[] hseqs = av.alignment.getHiddenSequences().hiddenSequences;
+ SequenceI[] hseqs = av.getAlignment().getHiddenSequences().hiddenSequences;
// Use this method here instead of calling hiddenSeq adjust
// 3 times.
int hSize = hseqs.length;
Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
.getSize());
- if (av.hiddenRepSequences != null
- && av.hiddenRepSequences.containsKey(seq))
+ if (av.isHiddenRepSequence(seq))
{
gg.setFont(bold);
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
SeqPanel sp = alignPanel.seqPanel;
int seq = Math.max(0, sp.findSeq(e));
String tmp;
- if (seq > -1 && seq < av.alignment.getHeight())
+ if (seq > -1 && seq < av.getAlignment().getHeight())
{
- SequenceI sequence = av.alignment.getSequenceAt(seq);
+ SequenceI sequence = av.getAlignment().getSequenceAt(seq);
StringBuffer tip = new StringBuffer();
tip.append("<i>");
}
if (mouseDragging && (e.getY() >= getHeight())
- && (av.alignment.getHeight() > av.getEndSeq()))
+ && (av.getAlignment().getHeight() > av.getEndSeq()))
{
scrollThread = new ScrollThread(false);
}
{
av.setSelectionGroup(new SequenceGroup());
av.getSelectionGroup().setStartRes(0);
- av.getSelectionGroup().setEndRes(av.alignment.getWidth() - 1);
+ av.getSelectionGroup().setEndRes(av.getAlignment().getWidth() - 1);
}
if (e.isShiftDown() && (lastid != -1))
return;
}
- int index = av.alignment.findIndex((SequenceI) found.get(0));
+ int index = av.getAlignment().findIndex((SequenceI) found.get(0));
// do we need to scroll the panel?
if ((av.getStartSeq() > index) || (av.getEndSeq() < index))
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
object.setVersion(jalview.bin.Cache.getProperty("VERSION"));
- jalview.datamodel.AlignmentI jal = av.alignment;
+ jalview.datamodel.AlignmentI jal = av.getAlignment();
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
jal = jal.getHiddenSequences().getFullAlignment();
}
jseq.setId(id); // jseq id should be a string not a number
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- jseq.setHidden(av.alignment.getHiddenSequences().isHidden(jds));
+ jseq.setHidden(av.getAlignment().getHiddenSequences().isHidden(jds));
- if (av.hiddenRepSequences != null
- && av.hiddenRepSequences.containsKey(jal.getSequenceAt(i)))
+ if (av.isHiddenRepSequence(jal.getSequenceAt(i)))
{
- jalview.datamodel.SequenceI[] reps = ((jalview.datamodel.SequenceGroup) av.hiddenRepSequences
- .get(jal.getSequenceAt(i))).getSequencesInOrder(jal);
+ jalview.datamodel.SequenceI[] reps = av.getRepresentedSequences(jal.getSequenceAt(i)).getSequencesInOrder(jal);
for (int h = 0; h < reps.length; h++)
{
jms.addJSeq(jseq);
}
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- jal = av.alignment;
+ jal = av.getAlignment();
}
// SAVE MAPPINGS
if (jal.getCodonFrames() != null && jal.getCodonFrames().length > 0)
{
TreePanel tp = (TreePanel) frames[t];
- if (tp.treeCanvas.av.alignment == jal)
+ if (tp.treeCanvas.av.getAlignment() == jal)
{
Tree tree = new Tree();
tree.setTitle(tp.getTitle());
an.setLabel(aa[i].label);
- if (aa[i] == av.quality || aa[i] == av.conservation
- || aa[i] == av.consensus || aa[i].autoCalculated)
+ if (aa[i] == av.getAlignmentQualityAnnot() || aa[i] == av.getAlignmentConservationAnnotation()
+ || aa[i] == av.getAlignmentConsensusAnnotation() || aa[i].autoCalculated)
{
// new way of indicating autocalculated annotation -
an.setAutoCalculated(aa[i].autoCalculated);
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
if (av.getColumnSelection() == null
|| av.getColumnSelection().getHiddenColumns() == null)
for (int i = 0; i < JSEQ.length; i++)
{
- af.viewport.setSequenceColour(af.viewport.alignment.getSequenceAt(i),
+ af.viewport.setSequenceColour(af.viewport.getAlignment().getSequenceAt(i),
new java.awt.Color(JSEQ[i].getColour()));
}
jalview.gui.AlignViewport av = (jalview.gui.AlignViewport) viewportsAdded
.get(uniqueSeqSetId);
- af.viewport.sequenceSetID = uniqueSeqSetId;
+ af.viewport.setSequenceSetId(uniqueSeqSetId);
if (av != null)
{
// propagate shared settings to this new view
else if (view.getBgColour().startsWith("Annotation"))
{
// int find annotation
- if (af.viewport.alignment.getAlignmentAnnotation() != null)
+ if (af.viewport.getAlignment().getAlignmentAnnotation() != null)
{
- for (int i = 0; i < af.viewport.alignment
+ for (int i = 0; i < af.viewport.getAlignment()
.getAlignmentAnnotation().length; i++)
{
- if (af.viewport.alignment.getAlignmentAnnotation()[i].label
+ if (af.viewport.getAlignment().getAlignmentAnnotation()[i].label
.equals(view.getAnnotationColours().getAnnotation()))
{
- if (af.viewport.alignment.getAlignmentAnnotation()[i]
+ if (af.viewport.getAlignment().getAlignmentAnnotation()[i]
.getThreshold() == null)
{
- af.viewport.alignment.getAlignmentAnnotation()[i]
+ af.viewport.getAlignment().getAlignmentAnnotation()[i]
.setThreshold(new jalview.datamodel.GraphLine(view
.getAnnotationColours().getThreshold(),
"Threshold", java.awt.Color.black)
.equals("None"))
{
cs = new AnnotationColourGradient(
- af.viewport.alignment.getAlignmentAnnotation()[i],
+ af.viewport.getAlignment().getAlignmentAnnotation()[i],
new java.awt.Color(view.getAnnotationColours()
.getMinColour()), new java.awt.Color(view
.getAnnotationColours().getMaxColour()),
.startsWith("ucs"))
{
cs = new AnnotationColourGradient(
- af.viewport.alignment.getAlignmentAnnotation()[i],
+ af.viewport.getAlignment().getAlignmentAnnotation()[i],
GetUserColourScheme(jms, view
.getAnnotationColours().getColourScheme()),
view.getAnnotationColours().getAboveThreshold());
else
{
cs = new AnnotationColourGradient(
- af.viewport.alignment.getAlignmentAnnotation()[i],
+ af.viewport.getAlignment().getAlignmentAnnotation()[i],
ColourSchemeProperty.getColour(al, view
.getAnnotationColours().getColourScheme()),
view.getAnnotationColours().getAboveThreshold());
* if
* (view.getAnnotationColours().getColourScheme().equals("None"
* )) { sg.cs = new AnnotationColourGradient(
- * af.viewport.alignment.getAlignmentAnnotation()[i], new
+ * af.viewport.getAlignment().getAlignmentAnnotation()[i], new
* java.awt.Color(view.getAnnotationColours().
* getMinColour()), new
* java.awt.Color(view.getAnnotationColours().
*/
{
sg.cs = new AnnotationColourGradient(
- af.viewport.alignment.getAlignmentAnnotation()[i],
+ af.viewport.getAlignment().getAlignmentAnnotation()[i],
sg.cs, view.getAnnotationColours()
.getAboveThreshold());
}
if (cs != null)
{
cs.setThreshold(view.getPidThreshold(), true);
- cs.setConsensus(af.viewport.hconsensus);
+ cs.setConsensus(af.viewport.getSequenceConsensusHash());
}
}
}
if (view.hasIgnoreGapsinConsensus())
{
- af.viewport.ignoreGapsInConsensusCalculation = view
- .getIgnoreGapsinConsensus();
+ af.viewport.setIgnoreGapsConsensus(view
+ .getIgnoreGapsinConsensus(), null);
}
if (view.hasFollowHighlight())
{
}
if (view.hasShowSequenceLogo())
{
- af.viewport.showSequenceLogo = view.getShowSequenceLogo();
+ af.viewport.setShowSequenceLogo(view.getShowSequenceLogo());
}
else
{
- af.viewport.showSequenceLogo = false;
+ af.viewport.setShowSequenceLogo(false);
}
if (view.hasShowDbRefTooltip())
{
af.closeMenuItem_actionPerformed(true);
/*
- * if(ap.av.alignment.getAlignmentAnnotation()!=null) { for(int i=0;
- * i<ap.av.alignment.getAlignmentAnnotation().length; i++) {
- * if(!ap.av.alignment.getAlignmentAnnotation()[i].autoCalculated) {
- * af.alignPanel.av.alignment.getAlignmentAnnotation()[i] =
- * ap.av.alignment.getAlignmentAnnotation()[i]; } } }
+ * if(ap.av.getAlignment().getAlignmentAnnotation()!=null) { for(int i=0;
+ * i<ap.av.getAlignment().getAlignmentAnnotation().length; i++) {
+ * if(!ap.av.getAlignment().getAlignmentAnnotation()[i].autoCalculated) {
+ * af.alignPanel.av.getAlignment().getAlignmentAnnotation()[i] =
+ * ap.av.getAlignment().getAlignmentAnnotation()[i]; } } }
*/
return af.alignPanel;
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
\r
for (int i = 0; i < JSEQ.length; i++)\r
{\r
- af.viewport.setSequenceColour(af.viewport.alignment.getSequenceAt(i),\r
+ af.viewport.setSequenceColour(af.viewport.getAlignment().getSequenceAt(i),\r
new java.awt.Color(JSEQ[i].getColour()));\r
}\r
\r
if (cs != null)\r
{\r
cs.setThreshold(view.getPidThreshold(), true);\r
- cs.setConsensus(af.viewport.hconsensus);\r
+ cs.setConsensus(af.viewport.getSequenceConsensusHash());\r
}\r
}\r
\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
*/
package jalview.gui;
+import jalview.renderer.AnnotationRenderer;
+
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
AlignmentPanel ap;
+ final AnnotationRenderer renderer = new AnnotationRenderer();
float scalew = 1f;
float scaleh = 1f;
fr = new FeatureRenderer(ap);
// scale the initial size of overviewpanel to shape of alignment
- float initialScale = (float) av.alignment.getWidth()
- / (float) av.alignment.getHeight();
+ float initialScale = (float) av.getAlignment().getWidth()
+ / (float) av.getAlignment().getHeight();
- if (av.conservation == null)
+ if (av.getAlignmentConservationAnnotation()== null)
{
graphHeight = 0;
}
- if (av.alignment.getWidth() > av.alignment.getHeight())
+ if (av.getAlignment().getWidth() > av.getAlignment().getHeight())
{
// wider
width = 400;
if (boxX > (width - boxWidth))
{
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
// Try smallest possible box
boxWidth = (int) ((av.endRes - av.startRes + 1) * av.getCharWidth() * scalew);
int col = (int) (boxX / scalew / av.getCharWidth());
int row = (int) (boxY / scaleh / av.getCharHeight());
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
if (!av.getColumnSelection().isVisible(col))
{
col = av.getColumnSelection().findColumnPosition(col);
}
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- row = av.alignment.getHiddenSequences().findIndexWithoutHiddenSeqs(
+ row = av.getAlignment().getHiddenSequences().findIndexWithoutHiddenSeqs(
row);
}
fr.transferSettings(ap.seqPanel.seqCanvas.getFeatureRenderer());
}
- int alwidth = av.alignment.getWidth();
- int alheight = av.alignment.getHeight()
- + av.alignment.getHiddenSequences().getSize();
+ int alwidth = av.getAlignment().getWidth();
+ int alheight = av.getAlignment().getHeight()
+ + av.getAlignment().getHiddenSequences().getSize();
setPreferredSize(new Dimension(width, sequencesHeight + graphHeight));
lastrow = (int) (row * sampleRow);
hiddenRow = false;
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- seq = av.alignment.getHiddenSequences().getHiddenSequence(lastrow);
+ seq = av.getAlignment().getHiddenSequences().getHiddenSequence(lastrow);
if (seq == null)
{
- int index = av.alignment.getHiddenSequences()
+ int index = av.getAlignment().getHiddenSequences()
.findIndexWithoutHiddenSeqs(lastrow);
- seq = av.alignment.getSequenceAt(index);
+ seq = av.getAlignment().getSequenceAt(index);
}
else
{
}
else
{
- seq = av.alignment.getSequenceAt(lastrow);
+ seq = av.getAlignment().getSequenceAt(lastrow);
}
if (seq == null)
}
if (hiddenRow
- || (av.hasHiddenColumns && !av.getColumnSelection()
+ || (av.hasHiddenColumns() && !av.getColumnSelection()
.isVisible(lastcol)))
{
color = new Color(color).darker().darker().getRGB();
}
}
- if (av.conservation != null)
+ if (av.getAlignmentConservationAnnotation()!= null)
{
+ renderer.updateFromAlignViewport(av);
for (col = 0; col < width; col++)
{
lastcol = (int) (col * sampleCol);
{
mg.translate(col, sequencesHeight);
- ap.annotationPanel.drawGraph(mg, av.conservation,
+ renderer.drawGraph(mg, av.getAlignmentConservationAnnotation(),
(int) (sampleCol) + 1, graphHeight,
(int) (col * sampleCol), (int) (col * sampleCol) + 1);
mg.translate(-col, -sequencesHeight);
*/
public void setBoxPosition()
{
- int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth();
- int fullsizeHeight = (av.alignment.getHeight() + av.alignment
+ int fullsizeWidth = av.getAlignment().getWidth() * av.getCharWidth();
+ int fullsizeHeight = (av.getAlignment().getHeight() + av.getAlignment()
.getHiddenSequences().getSize()) * av.getCharHeight();
int startRes = av.getStartRes();
int endRes = av.getEndRes();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
startRes = av.getColumnSelection().adjustForHiddenColumns(startRes);
endRes = av.getColumnSelection().adjustForHiddenColumns(endRes);
int startSeq = av.startSeq;
int endSeq = av.endSeq;
- if (av.hasHiddenRows)
+ if (av.hasHiddenRows())
{
- startSeq = av.alignment.getHiddenSequences().adjustForHiddenSeqs(
+ startSeq = av.getAlignment().getHiddenSequences().adjustForHiddenSeqs(
startSeq);
- endSeq = av.alignment.getHiddenSequences()
+ endSeq = av.getAlignment().getHiddenSequences()
.adjustForHiddenSeqs(endSeq);
}
boxX = (int) (startRes * av.getCharWidth() * scalew);
boxY = (int) (startSeq * av.getCharHeight() * scaleh);
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
boxWidth = (int) ((endRes - startRes + 1) * av.getCharWidth() * scalew);
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
seqstrings = av.getAlignmentView(av.getSelectionGroup() != null);
if (av.getSelectionGroup() == null)
{
- seqs = av.alignment.getSequencesArray();
+ seqs = av.getAlignment().getSequencesArray();
}
else
{
- seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+ seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
}
SeqCigar sq[] = seqstrings.getSequences();
int length = sq[0].getWidth();
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
if (validateSequences && comp instanceof AlignmentPanel
&& source instanceof AlignmentPanel)
{
- validateSequences(((AlignmentPanel) source).av.alignment,
- ((AlignmentPanel) comp).av.alignment);
+ validateSequences(((AlignmentPanel) source).av.getAlignment(),
+ ((AlignmentPanel) comp).av.getAlignment());
}
if (comp instanceof AlignmentPanel && alignmentChanged)
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
if (av.getSelectionGroup() == null)
{
- seqs = av.alignment.getSequencesArray();
+ seqs = av.getAlignment().getSequencesArray();
}
else
{
- seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+ seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
}
- String type = (av.alignment.isNucleotide()) ? AlignSeq.DNA
+ String type = (av.getAlignment().isNucleotide()) ? AlignSeq.DNA
: AlignSeq.PEP;
float[][] scores = new float[seqs.length][seqs.length];
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
+ protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
+ // protected JRadioButtonMenuItem covariationColour = new
+ // JRadioButtonMenuItem();
+
JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
protected JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
JMenuItem sequenceName = new JMenuItem();
- Sequence sequence;
+ SequenceI sequence;
JMenuItem unGroupMenuItem = new JMenuItem();
* @param links
* @param groupLinks
*/
- public PopupMenu(final AlignmentPanel ap, Sequence seq, Vector links,
+ public PopupMenu(final AlignmentPanel ap, final SequenceI seq, Vector links,
Vector groupLinks)
{
// /////////////////////////////////////////////////////////
colours.add(userDefinedColour);
colours.add(PIDColour);
colours.add(BLOSUM62Colour);
+ colours.add(purinePyrimidineColour);
+ // colours.add(covariationColour);
for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
{
}
else
{
+ if (ap.av.getAlignment().isNucleotide() == false)
+ {
structureMenu.remove(viewStructureMenu);
+ }
// structureMenu.remove(colStructureMenu);
}
+ if (ap.av.getAlignment().isNucleotide() == true)
+ {
+ AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
+ for (int i = 0; i < aa.length; i++)
+ {
+ if (aa[i].getRNAStruc() != null)
+ {
+ final String rnastruc = aa[i].getRNAStruc();
+
+ menuItem = new JMenuItem();
+ menuItem.setText("RNA structure - consensus");
+ menuItem.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ new AppVarna(seq.getSequenceAsString(), rnastruc, seq
+ .getName(), ap);
+ }
+ });
+ viewStructureMenu.add(menuItem);
+ }
+ }
+
+ // SequenceFeatures[] test = seq.getSequenceFeatures();
+
+ if (seq.getAnnotation() != null)
+ {
+ AlignmentAnnotation seqAnno[] = seq.getAnnotation();
+ for (int i = 0; i < seqAnno.length; i++)
+ {
+ if (seqAnno[i].getRNAStruc() != null)
+ {
+ final String rnastruc = seqAnno[i].getRNAStruc();
+
+ // TODO: make rnastrucF a bit more nice
+ menuItem = new JMenuItem();
+ menuItem.setText("RNA structure - "+seq.getName());
+ menuItem.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ // TODO: VARNA does'nt print gaps in the sequence
+ new AppVarna(seq.getSequenceAsString(), rnastruc, seq
+ .getName(), ap);
+ }
+ });
+ viewStructureMenu.add(menuItem);
+ }
+ }
+ }
+
+
+ }
+
menuItem = new JMenuItem("Hide Sequences");
menuItem.addActionListener(new java.awt.event.ActionListener()
{
sequenceMenu.add(menuItem);
}
- if (ap.av.hasHiddenRows)
+ if (ap.av.hasHiddenRows())
{
- final int index = ap.av.alignment.findIndex(seq);
+ final int index = ap.av.getAlignment().findIndex(seq);
if (ap.av.adjustForHiddenSeqs(index)
- ap.av.adjustForHiddenSeqs(index - 1) > 1)
}
}
// for the case when no sequences are even visible
- if (ap.av.hasHiddenRows) {
+ if (ap.av.hasHiddenRows()) {
{
menuItem = new JMenuItem("Reveal All");
menuItem.addActionListener(new ActionListener()
{
clustalColour.setSelected(true);
}
+ else if (sg.cs instanceof PurinePyrimidineColourScheme)
+ {
+ purinePyrimidineColour.setSelected(true);
+ }
+ /*
+ * else if (sg.cs instanceof CovariationColourScheme) {
+ * covariationColour.setSelected(true); }
+ */
else
{
noColourmenuItem.setSelected(true);
editMenu.setVisible(false);
}
- if (!ap.av.alignment.getGroups().contains(sg))
+ if (!ap.av.getAlignment().getGroups().contains(sg))
{
unGroupMenuItem.setVisible(false);
}
colourMenu.add(turnColour);
colourMenu.add(buriedColour);
colourMenu.add(nucleotideMenuItem);
+ if (ap.getAlignment().isNucleotide()) {
+ colourMenu.add(purinePyrimidineColour);
+ }
+ // colourMenu.add(covariationColour);
colourMenu.add(userDefinedColour);
if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
BLOSUM62Colour_actionPerformed();
}
});
+ purinePyrimidineColour.setText("Purine/Pyrimidine");
+ purinePyrimidineColour
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ purinePyrimidineColour_actionPerformed();
+ }
+ });
+ /*
+ * covariationColour.addActionListener(new java.awt.event.ActionListener() {
+ * public void actionPerformed(ActionEvent e) {
+ * covariationColour_actionPerformed(); } });
+ */
+
conservationMenuItem.setText("Conservation");
conservationMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
SequenceGroup sg = getGroup();
sg.cs = new ClustalxColourScheme(
- sg.getSequences(ap.av.hiddenRepSequences),
- ap.av.alignment.getWidth());
+ sg.getSequences(ap.av.getHiddenRepSequences()),
+ ap.av.getAlignment().getWidth());
refresh();
}
refresh();
}
+ protected void purinePyrimidineColour_actionPerformed()
+ {
+ getGroup().cs = new PurinePyrimidineColourScheme();
+ refresh();
+ }
+
+ /*
+ * protected void covariationColour_actionPerformed() { getGroup().cs = new
+ * CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
+ */
/**
* DOCUMENT ME!
*
if (abovePIDColour.isSelected())
{
sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
sg.getEndRes() + 1));
int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
SequenceGroup sg = getGroup();
sg.cs = new PIDColourScheme();
sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
sg.getEndRes() + 1));
refresh();
}
sg.cs = new Blosum62ColourScheme();
sg.cs.setConsensus(AAFrequency.calculate(
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
sg.getEndRes() + 1));
refresh();
{
Conservation c = new Conservation("Group",
ResidueProperties.propHash, 3,
- sg.getSequences(ap.av.hiddenRepSequences), sg.getStartRes(),
+ sg.getSequences(ap.av.getHiddenRepSequences()), sg.getStartRes(),
sg.getEndRes() + 1);
c.calculate();
- c.verdict(false, ap.av.ConsPercGaps);
+ c.verdict(false, ap.av.getConsPercGaps());
sg.cs.setConservation(c);
// this method won't add a new group if it already exists
if (sg != null)
{
- ap.av.alignment.addGroup(sg);
+ ap.av.getAlignment().addGroup(sg);
}
return sg;
void unGroupMenuItem_actionPerformed()
{
SequenceGroup sg = ap.av.getSelectionGroup();
- ap.av.alignment.deleteGroup(sg);
+ ap.av.getAlignment().deleteGroup(sg);
ap.av.setSelectionGroup(null);
refresh();
}
}
ChangeCaseCommand caseCommand = new ChangeCaseCommand(description,
- sg.getSequencesAsArray(ap.av.hiddenRepSequences), startEnd,
+ sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), startEnd,
caseChange);
ap.alignFrame.addHistoryItem(caseCommand);
ColumnSelection csel = new ColumnSelection(ap.av.getColumnSelection());
omitHidden = ap.av.getViewAsString(true);
Alignment oal = new Alignment(ap.av.getSequenceSelection());
- AlignmentAnnotation[] nala = ap.av.alignment.getAlignmentAnnotation();
+ AlignmentAnnotation[] nala = ap.av.getAlignment().getAlignmentAnnotation();
if (nala != null)
{
for (int i = 0; i < nala.length; i++)
public void discoverPDB_actionPerformed()
{
- final SequenceI[] sequences = ((ap.av.selectionGroup == null) ? new Sequence[]
+ final SequenceI[] sequences = ((ap.av.getSelectionGroup() == null) ? new SequenceI[]
{ sequence }
- : ap.av.selectionGroup.getSequencesInOrder(ap.av.alignment));
+ : ap.av.getSequenceSelection());
Thread discpdb = new Thread(new Runnable()
{
public void run()
AlignmentAnnotation an = new AlignmentAnnotation("Structure",
"Coloured by " + pdbid, anots);
- ap.av.alignment.addAnnotation(an);
+ ap.av.getAlignment().addAnnotation(an);
an.createSequenceMapping(sequence, 0, true);
// an.adjustForAlignment();
- ap.av.alignment.setAnnotationIndex(an, 0);
+ ap.av.getAlignment().setAnnotationIndex(an, 0);
ap.adjustAnnotationHeight();
EditCommand editCommand = new EditCommand("Edit Sequences",
EditCommand.REPLACE, dialog.getName().replace(' ',
ap.av.getGapCharacter()),
- sg.getSequencesAsArray(ap.av.hiddenRepSequences),
- sg.getStartRes(), sg.getEndRes() + 1, ap.av.alignment);
+ sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
+ sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
ap.alignFrame.addHistoryItem(editCommand);
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
if ((sg != null) && (sg.getSize() >= 1))
{
- originalSequences = sg.getSequencesInOrder(ap.av.alignment);
+ originalSequences = sg.getSequencesInOrder(ap.av.getAlignment());
start = sg.getStartRes();
end = sg.getEndRes();
}
else
{
- originalSequences = ap.av.alignment.getSequencesArray();
+ originalSequences = ap.av.getAlignment().getSequencesArray();
start = 0;
- end = ap.av.alignment.getWidth();
+ end = ap.av.getAlignment().getWidth();
}
height = originalSequences.length;
redundancy[i] = 0f;
}
- if (ap.av.hasHiddenColumns)
+ if (ap.av.hasHiddenColumns())
{
omitHidden = ap.av.getViewAsString(sg != null);
}
}
EditCommand cut = new EditCommand("Remove Redundancy",
- EditCommand.CUT, deleted, 0, width, ap.av.alignment);
+ EditCommand.CUT, deleted, 0, width, ap.av.getAlignment());
for (int i = 0; i < del.size(); i++)
{
- ap.av.alignment.deleteSequence(deleted[i]);
+ ap.av.getAlignment().deleteSequence(deleted[i]);
PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true);
if (sg != null)
{
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
aps[a].av.setSelectionGroup(new SequenceGroup());
aps[a].av.getSelectionGroup().addOrRemove(found, true);
aps[a].av.getSelectionGroup().setEndRes(
- aps[a].av.alignment.getWidth() - 1);
+ aps[a].av.getAlignment().getWidth() - 1);
}
}
PaintRefresher.Refresh(this, av.getSequenceSetId());
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
int x = (evt.getX() / av.getCharWidth()) + av.getStartRes();
final int res;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
x = av.getColumnSelection().adjustForHiddenColumns(x);
}
- if (x >= av.alignment.getWidth())
+ if (x >= av.getAlignment().getWidth())
{
- res = av.alignment.getWidth() - 1;
+ res = av.getAlignment().getWidth() - 1;
}
else
{
{
av.hideColumns(res, res);
if (av.getSelectionGroup() != null
- && av.getSelectionGroup().getSize() == av.alignment
+ && av.getSelectionGroup().getSize() == av.getAlignment()
.getHeight())
{
av.setSelectionGroup(null);
av.getColumnSelection().addElement(res);
SequenceGroup sg = new SequenceGroup();
// try to be as quick as possible
- SequenceI[] iVec = av.alignment.getSequencesArray();
+ SequenceI[] iVec = av.getAlignment().getSequencesArray();
for (int i = 0; i < iVec.length; i++)
{
sg.addSequence(iVec[i], false);
int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
- if (res >= av.alignment.getWidth())
+ if (res >= av.getAlignment().getWidth())
{
- res = av.alignment.getWidth() - 1;
+ res = av.getAlignment().getWidth() - 1;
}
if (!stretchingGroup)
res = 0;
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
- if (res >= av.alignment.getWidth())
+ if (res >= av.getAlignment().getWidth())
{
- res = av.alignment.getWidth() - 1;
+ res = av.getAlignment().getWidth() - 1;
}
if (res < min)
public void mouseMoved(MouseEvent evt)
{
- if (!av.hasHiddenColumns)
+ if (!av.hasHiddenColumns())
{
return;
}
for (int i = 0; i < cs.size(); i++)
{
int sel = cs.columnAt(i);
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
if (cs.isVisible(sel))
{
}
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
gg.setColor(Color.blue);
int res;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
for (int i = scalestartx; i < endx; i += 10)
{
int value = i;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
value = av.getColumnSelection().adjustForHiddenColumns(value);
}
FontMetrics fm = getFontMetrics(av.getFont());
ypos += av.charHeight;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
startx = av.getColumnSelection().adjustForHiddenColumns(startx);
endx = av.getColumnSelection().adjustForHiddenColumns(endx);
}
- int maxwidth = av.alignment.getWidth();
- if (av.hasHiddenColumns)
+ int maxwidth = av.getAlignment().getWidth();
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
// WEST SCALE
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ for (int i = 0; i < av.getAlignment().getHeight(); i++)
{
- SequenceI seq = av.alignment.getSequenceAt(i);
+ SequenceI seq = av.getAlignment().getSequenceAt(i);
int index = startx;
int value = -1;
continue;
}
- value = av.alignment.getSequenceAt(i).findPosition(index);
+ value = av.getAlignment().getSequenceAt(i).findPosition(index);
break;
}
{
ypos += av.charHeight;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
endx = av.getColumnSelection().adjustForHiddenColumns(endx);
}
SequenceI seq;
// EAST SCALE
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ for (int i = 0; i < av.getAlignment().getHeight(); i++)
{
- seq = av.alignment.getSequenceAt(i);
+ seq = av.getAlignment().getSequenceAt(i);
int index = endx;
int value = -1;
String mask = "00";
int maxWidth = 0;
int tmp;
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ for (int i = 0; i < av.getAlignment().getHeight(); i++)
{
- tmp = av.alignment.getSequenceAt(i).getEnd();
+ tmp = av.getAlignment().getSequenceAt(i).getEnd();
if (tmp > maxWidth)
{
maxWidth = tmp;
int endx;
int ypos = hgap;
- int maxwidth = av.alignment.getWidth() - 1;
+ int maxwidth = av.getAlignment().getWidth() - 1;
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
}
drawNorthScale(g, startRes, endx, ypos);
}
- if (av.hasHiddenColumns && av.showHiddenMarkers)
+ if (av.hasHiddenColumns() && av.showHiddenMarkers)
{
g.setColor(Color.blue);
int res;
annotations = new AnnotationPanel(av);
}
- annotations.drawComponent((Graphics2D) g, startRes, endx + 1);
+ annotations.renderer.drawComponent(annotations, av, (Graphics2D) g, -1, startRes, endx + 1);
g.translate(0, -cHeight - ypos - 3);
}
g.setClip(clip);
void drawPanel(Graphics g1, int startRes, int endRes, int startSeq,
int endSeq, int offset)
{
- if (!av.hasHiddenColumns)
+ if (!av.hasHiddenColumns())
{
draw(g1, startRes, endRes, startSeq, endSeq, offset);
}
// ///////////////////////////
for (int i = startSeq; i < endSeq; i++)
{
- nextSeq = av.alignment.getSequenceAt(i);
+ nextSeq = av.getAlignment().getSequenceAt(i);
if (nextSeq == null)
{
// occasionally, a race condition occurs such that the alignment row is
// empty
continue;
}
- sr.drawSequence(nextSeq, av.alignment.findAllGroups(nextSeq),
+ sr.drawSequence(nextSeq, av.getAlignment().findAllGroups(nextSeq),
startRes, endRes, offset + ((i - startSeq) * av.charHeight));
if (av.showSequenceFeatures)
}
if (av.getSelectionGroup() != null
- || av.alignment.getGroups().size() > 0)
+ || av.getAlignment().getGroups().size() > 0)
{
drawGroupsBoundaries(g, startRes, endRes, startSeq, endSeq, offset);
}
int groupIndex = -1;
int visWidth = (endRes - startRes + 1) * av.charWidth;
- if ((group == null) && (av.alignment.getGroups().size() > 0))
+ if ((group == null) && (av.getAlignment().getGroups().size() > 0))
{
- group = (SequenceGroup) av.alignment.getGroups().elementAt(0);
+ group = (SequenceGroup) av.getAlignment().getGroups().elementAt(0);
groupIndex = 0;
}
if ((sx <= (endRes - startRes) * av.charWidth)
&& group.getSequences(null).contains(
- av.alignment.getSequenceAt(i)))
+ av.getAlignment().getSequenceAt(i)))
{
if ((bottom == -1)
&& !group.getSequences(null).contains(
- av.alignment.getSequenceAt(i + 1)))
+ av.getAlignment().getSequenceAt(i + 1)))
{
bottom = sy + av.charHeight;
}
{
if (((top == -1) && (i == 0))
|| !group.getSequences(null).contains(
- av.alignment.getSequenceAt(i - 1)))
+ av.getAlignment().getSequenceAt(i - 1)))
{
top = sy;
}
g.setStroke(new BasicStroke());
- if (groupIndex >= av.alignment.getGroups().size())
+ if (groupIndex >= av.getAlignment().getGroups().size())
{
break;
}
- group = (SequenceGroup) av.alignment.getGroups().elementAt(
+ group = (SequenceGroup) av.getAlignment().getGroups().elementAt(
groupIndex);
- } while (groupIndex < av.alignment.getGroups().size());
+ } while (groupIndex < av.getAlignment().getGroups().size());
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
res = (x / av.getCharWidth()) + av.getStartRes();
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
res = av.getColumnSelection().adjustForHiddenColumns(res);
}
y -= hgap;
seq = Math.min((y % cHeight) / av.getCharHeight(),
- av.alignment.getHeight() - 1);
+ av.getAlignment().getHeight() - 1);
}
else
{
seq = Math.min((y / av.getCharHeight()) + av.getStartSeq(),
- av.alignment.getHeight() - 1);
+ av.getAlignment().getHeight() - 1);
}
return seq;
{
seqCanvas.cursorX += dx;
seqCanvas.cursorY += dy;
- if (av.hasHiddenColumns && !av.colSel.isVisible(seqCanvas.cursorX))
+ if (av.hasHiddenColumns() && !av.getColumnSelection().isVisible(seqCanvas.cursorX))
{
int original = seqCanvas.cursorX - dx;
- int maxWidth = av.alignment.getWidth();
+ int maxWidth = av.getAlignment().getWidth();
- while (!av.colSel.isVisible(seqCanvas.cursorX)
+ while (!av.getColumnSelection().isVisible(seqCanvas.cursorX)
&& seqCanvas.cursorX < maxWidth && seqCanvas.cursorX > 0)
{
seqCanvas.cursorX += dx;
}
if (seqCanvas.cursorX >= maxWidth
- || !av.colSel.isVisible(seqCanvas.cursorX))
+ || !av.getColumnSelection().isVisible(seqCanvas.cursorX))
{
seqCanvas.cursorX = original;
}
{
seqCanvas.cursorX = 0;
}
- else if (seqCanvas.cursorX > av.alignment.getWidth() - 1)
+ else if (seqCanvas.cursorX > av.getAlignment().getWidth() - 1)
{
- seqCanvas.cursorX = av.alignment.getWidth() - 1;
+ seqCanvas.cursorX = av.getAlignment().getWidth() - 1;
}
if (seqCanvas.cursorY < 0)
{
seqCanvas.cursorY = 0;
}
- else if (seqCanvas.cursorY > av.alignment.getHeight() - 1)
+ else if (seqCanvas.cursorY > av.getAlignment().getHeight() - 1)
{
- seqCanvas.cursorY = av.alignment.getHeight() - 1;
+ seqCanvas.cursorY = av.getAlignment().getHeight() - 1;
}
endEditing();
}
if (!av.wrapAlignment)
{
- while (seqCanvas.cursorX < av.colSel
+ while (seqCanvas.cursorX < av.getColumnSelection()
.adjustForHiddenColumns(av.startRes))
{
if (!ap.scrollRight(false))
break;
}
}
- while (seqCanvas.cursorX > av.colSel
+ while (seqCanvas.cursorX > av.getColumnSelection()
.adjustForHiddenColumns(av.endRes))
{
if (!ap.scrollRight(true))
}
}
}
- setStatusMessage(av.alignment.getSequenceAt(seqCanvas.cursorY),
+ setStatusMessage(av.getAlignment().getSequenceAt(seqCanvas.cursorY),
seqCanvas.cursorX, seqCanvas.cursorY);
seqCanvas.repaint();
if (av.getSelectionGroup() != null)
{
- SequenceGroup sg = av.selectionGroup;
+ SequenceGroup sg = av.getSelectionGroup();
// Find the top and bottom of this group
- int min = av.alignment.getHeight(), max = 0;
+ int min = av.getAlignment().getHeight(), max = 0;
for (int i = 0; i < sg.getSize(); i++)
{
- int index = av.alignment.findIndex(sg.getSequenceAt(i));
+ int index = av.getAlignment().findIndex(sg.getSequenceAt(i));
if (index > max)
{
max = index;
sg.getSequences(null).clear();
for (int i = min; i < max; i++)
{
- sg.addSequence(av.alignment.getSequenceAt(i), false);
+ sg.addSequence(av.getAlignment().getSequenceAt(i), false);
}
}
}
groupEditing = group;
startseq = seqCanvas.cursorY;
lastres = seqCanvas.cursorX;
- editSequence(true, seqCanvas.cursorX + getKeyboardNo1());
+ editSequence(true, false, seqCanvas.cursorX + getKeyboardNo1());
endEditing();
}
groupEditing = group;
startseq = seqCanvas.cursorY;
lastres = seqCanvas.cursorX + getKeyboardNo1();
- editSequence(false, seqCanvas.cursorX);
+ editSequence(false, false, seqCanvas.cursorX);
endEditing();
}
+
+ void insertNucAtCursor(boolean group,String nuc){
+ groupEditing = group;
+ startseq = seqCanvas.cursorY;
+ lastres = seqCanvas.cursorX;
+ editSequence(false, true, seqCanvas.cursorX + getKeyboardNo1());
+ endEditing();
+ }
void numberPressed(char value)
{
tooltipText.setLength(6); // Cuts the buffer back to <html>
- SequenceGroup[] groups = av.alignment.findAllGroups(sequence);
+ SequenceGroup[] groups = av.getAlignment().findAllGroups(sequence);
if (groups != null)
{
for (int g = 0; g < groups.length; g++)
+ sequence.getName());
Object obj = null;
- if (av.alignment.isNucleotide())
+ if (av.getAlignment().isNucleotide())
{
obj = ResidueProperties.nucleotideName.get(sequence.getCharAt(res)
+ "");
if ((res < av.getAlignment().getWidth()) && (res < lastres))
{
// dragLeft, delete gap
- editSequence(false, res);
+ editSequence(false, false,res);
}
else
{
- editSequence(true, res);
+ editSequence(true, false,res);
}
mouseDragging = true;
}
}
- synchronized void editSequence(boolean insertGap, int startres)
+ //TODO: Make it more clever than many booleans
+ synchronized void editSequence(boolean insertGap, boolean editSeq, int startres)
{
int fixedLeft = -1;
int fixedRight = -1;
boolean fixedColumns = false;
SequenceGroup sg = av.getSelectionGroup();
- SequenceI seq = av.alignment.getSequenceAt(startseq);
+ SequenceI seq = av.getAlignment().getSequenceAt(startseq);
// No group, but the sequence may represent a group
- if (!groupEditing && av.hasHiddenRows)
+ if (!groupEditing && av.hasHiddenRows())
{
- if (av.hiddenRepSequences != null
- && av.hiddenRepSequences.containsKey(seq))
+ if (av.isHiddenRepSequence(seq))
{
- sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+ sg = av.getRepresentedSequences(seq);
groupEditing = true;
}
}
// Are we editing within a selection group?
if (groupEditing
- || (sg != null && sg.getSequences(av.hiddenRepSequences)
+ || (sg != null && sg.getSequences(av.getHiddenRepSequences())
.contains(seq)))
{
fixedColumns = true;
// but the sequence represents a group
if (sg == null)
{
- if (av.hiddenRepSequences == null
- || !av.hiddenRepSequences.containsKey(seq))
+ if (!av.isHiddenRepSequence(seq))
{
endEditing();
return;
}
- sg = (SequenceGroup) av.hiddenRepSequences.get(seq);
+ sg = av.getRepresentedSequences(seq);
}
fixedLeft = sg.getStartRes();
}
}
- if (av.hasHiddenColumns)
+ if (av.hasHiddenColumns())
{
fixedColumns = true;
int y1 = av.getColumnSelection().getHiddenBoundaryLeft(startres);
if (groupEditing)
{
- Vector vseqs = sg.getSequences(av.hiddenRepSequences);
+ Vector vseqs = sg.getSequences(av.getHiddenRepSequences());
int g, groupSize = vseqs.size();
SequenceI[] groupSeqs = new SequenceI[groupSize];
for (g = 0; g < groupSeqs.length; g++)
// If the user has selected the whole sequence, and is dragging to
// the right, we can still extend the alignment and selectionGroup
if (sg.getStartRes() == 0 && sg.getEndRes() == fixedRight
- && sg.getEndRes() == av.alignment.getWidth() - 1)
+ && sg.getEndRes() == av.getAlignment().getWidth() - 1)
{
- sg.setEndRes(av.alignment.getWidth() + startres - lastres);
+ sg.setEndRes(av.getAlignment().getWidth() + startres - lastres);
fixedRight = sg.getEndRes();
}
if (!blank)
{
- if (sg.getSize() == av.alignment.getHeight())
+ if (sg.getSize() == av.getAlignment().getHeight())
{
- if ((av.hasHiddenColumns && startres < av.getColumnSelection()
+ if ((av.hasHiddenColumns() && startres < av.getColumnSelection()
.getHiddenBoundaryRight(startres)))
{
endEditing();
return;
}
- int alWidth = av.alignment.getWidth();
- if (av.hasHiddenRows)
+ int alWidth = av.getAlignment().getWidth();
+ if (av.hasHiddenRows())
{
- int hwidth = av.alignment.getHiddenSequences().getWidth();
+ int hwidth = av.getAlignment().getHiddenSequences().getWidth();
if (hwidth > alWidth)
{
alWidth = hwidth;
else
{
editCommand.appendEdit(EditCommand.INSERT_GAP, groupSeqs,
- startres, startres - lastres, av.alignment, true);
+ startres, startres - lastres, av.getAlignment(), true);
}
}
else
else
{
editCommand.appendEdit(EditCommand.DELETE_GAP, groupSeqs,
- startres, lastres - startres, av.alignment, true);
+ startres, lastres - startres, av.getAlignment(), true);
}
}
else
{
editCommand.appendEdit(EditCommand.INSERT_GAP, new SequenceI[]
- { seq }, lastres, startres - lastres, av.alignment, true);
- }
+ { seq }, lastres, startres - lastres, av.getAlignment(), true);
+ }
}
else
{
+ if(!editSeq){
// dragging to the left
if (fixedColumns && fixedRight != -1)
{
if (max > 0)
{
editCommand.appendEdit(EditCommand.DELETE_GAP, new SequenceI[]
- { seq }, startres, max, av.alignment, true);
+ { seq }, startres, max, av.getAlignment(), true);
}
}
+ }else{//insertGap==false AND editSeq==TRUE;
+ if (fixedColumns && fixedRight != -1)
+ {
+ for (int j = lastres; j < startres; j++)
+ {
+ insertChar(j, new SequenceI[]
+ { seq }, fixedRight);
+ }
+ }
+ else
+ {
+ editCommand.appendEdit(EditCommand.INSERT_NUC, new SequenceI[]
+ { seq }, lastres, startres - lastres, av.getAlignment(), true);
+ }
+ }
}
}
}
editCommand.appendEdit(EditCommand.DELETE_GAP, seq, blankColumn, 1,
- av.alignment, true);
+ av.getAlignment(), true);
- editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.alignment,
+ editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1, av.getAlignment(),
true);
}
void deleteChar(int j, SequenceI[] seq, int fixedColumn)
{
- editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.alignment,
+ editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1, av.getAlignment(),
true);
editCommand.appendEdit(EditCommand.INSERT_GAP, seq, fixedColumn, 1,
- av.alignment, true);
+ av.getAlignment(), true);
}
/**
public void mouseClicked(MouseEvent evt)
{
SequenceGroup sg = null;
- SequenceI sequence = av.alignment.getSequenceAt(findSeq(evt));
+ SequenceI sequence = av.getAlignment().getSequenceAt(findSeq(evt));
if (evt.getClickCount() > 1)
{
sg = av.getSelectionGroup();
startWrapBlock = wrappedBlock;
- if (av.wrapAlignment && seq > av.alignment.getHeight())
+ if (av.wrapAlignment && seq > av.getAlignment().getHeight())
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
"Cannot edit annotations in wrapped view.",
if (stretchGroup == null)
{
- stretchGroup = av.alignment.findGroup(sequence);
+ stretchGroup = av.getAlignment().findGroup(sequence);
if ((stretchGroup != null) && (res > stretchGroup.getStartRes())
&& (res < stretchGroup.getEndRes()))
{
stretchGroup = null;
- SequenceGroup[] allGroups = av.alignment.findAllGroups(sequence);
+ SequenceGroup[] allGroups = av.getAlignment().findAllGroups(sequence);
if (allGroups != null)
{
if (stretchGroup.cs instanceof ClustalxColourScheme)
{
((ClustalxColourScheme) stretchGroup.cs).resetClustalX(
- stretchGroup.getSequences(av.hiddenRepSequences),
+ stretchGroup.getSequences(av.getHiddenRepSequences()),
stretchGroup.getWidth());
}
return;
}
- if (res >= av.alignment.getWidth())
+ if (res >= av.getAlignment().getWidth())
{
- res = av.alignment.getWidth() - 1;
+ res = av.getAlignment().getWidth() - 1;
}
if (stretchGroup.getEndRes() == res)
dragDirection = -1;
}
- while ((y != oldSeq) && (oldSeq > -1) && (y < av.alignment.getHeight()))
+ while ((y != oldSeq) && (oldSeq > -1) && (y < av.getAlignment().getHeight()))
{
// This routine ensures we don't skip any sequences, as the
// selection is quite slow.
}
if (mouseDragging && (evt.getY() >= getHeight())
- && (av.alignment.getHeight() > av.getEndSeq()))
+ && (av.getAlignment().getHeight() > av.getEndSeq()))
{
running = ap.scrollUp(false);
}
SequenceGroup sgroup = null;
if (seqsel != null && seqsel.getSize()>0)
{
- if (av.alignment == null)
+ if (av.getAlignment() == null)
{
jalview.bin.Cache.log.warn("alignviewport av SeqSetId="
+ av.getSequenceSetId() + " ViewId=" + av.getViewId()
+ " 's alignment is NULL! returning immediatly.");
return;
}
- sgroup = seqsel.intersect(av.alignment,
- (av.hasHiddenRows) ? av.hiddenRepSequences : null);
+ sgroup = seqsel.intersect(av.getAlignment(),
+ (av.hasHiddenRows()) ? av.getHiddenRepSequences() : null);
if ((sgroup == null || sgroup.getSize() == 0)
|| (colsel == null || colsel.size() == 0))
{
// so import the new colsel.
if (colsel == null || colsel.size() == 0)
{
- if (av.colSel != null)
+ if (av.getColumnSelection() != null)
{
- av.colSel.clear();
+ av.getColumnSelection().clear();
repaint=true;
}
}
else
{
// TODO: shift colSel according to the intersecting sequences
- if (av.colSel == null)
+ if (av.getColumnSelection() == null)
{
- av.colSel = new ColumnSelection(colsel);
+ av.setColumnSelection(new ColumnSelection(colsel));
}
else
{
- av.colSel.setElementsFrom(colsel);
+ av.getColumnSelection().setElementsFrom(colsel);
}
}
av.isColSelChanged(true);
repaint = true;
}
- if (copycolsel && av.hasHiddenColumns
- && (av.colSel == null || av.colSel.getHiddenColumns() == null))
+ if (copycolsel && av.hasHiddenColumns()
+ && (av.getColumnSelection() == null || av.getColumnSelection().getHiddenColumns() == null))
{
System.err.println("Bad things");
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
{
for (int i = 0; i < al.getHeight(); i++)
{
- alignFrame.viewport.alignment.addSequence(al.getSequenceAt(i)); // this
+ alignFrame.viewport.getAlignment().addSequence(al.getSequenceAt(i)); // this
// also
// creates
// dataset
// sequence
// entries
}
- alignFrame.viewport.setEndSeq(alignFrame.viewport.alignment
+ alignFrame.viewport.setEndSeq(alignFrame.viewport.getAlignment()
.getHeight());
- alignFrame.viewport.alignment.getWidth();
+ alignFrame.viewport.getAlignment().getWidth();
alignFrame.viewport.firePropertyChange("alignment", null,
alignFrame.viewport.getAlignment().getSequences());
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public Color getResidueBoxColour(SequenceI seq, int i)
{
- allGroups = av.alignment.findAllGroups(seq);
+ allGroups = av.getAlignment().findAllGroups(seq);
if (inCurrentSequenceGroup(i))
{
}
else if (av.getShowBoxes())
{
- getBoxColour(av.globalColourScheme, seq, i);
+ getBoxColour(av.getGlobalColourScheme(), seq, i);
}
return resBoxColour;
}
else if (av.getShowBoxes())
{
- getBoxColour(av.globalColourScheme, seq, i);
+ getBoxColour(av.getGlobalColourScheme(), seq, i);
}
}
if (currentSequenceGroup.getShowNonconserved()) // todo optimize
{
// todo - use sequence group consensus
- s = getDisplayChar(av.consensus, i, s, '.');
+ s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
}
if (av.getColourText())
{
getboxColour = true;
- getBoxColour(av.globalColourScheme, seq, i);
+ getBoxColour(av.getGlobalColourScheme(), seq, i);
if (av.getShowBoxes())
{
{
if (!getboxColour)
{
- getBoxColour(av.globalColourScheme, seq, i);
+ getBoxColour(av.getGlobalColourScheme(), seq, i);
}
if (resBoxColour.getRed() + resBoxColour.getBlue()
graphics.setColor(av.textColour2);
}
}
- if (av.showUnconserved)
+ if (av.getShowUnconserved())
{
- s = getDisplayChar(av.consensus, i, s, '.');
+ s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
conservationSlider.setTitle("Conservation Colour Increment (" + source
+ ")");
- if (ap.av.alignment.getGroups() != null)
+ if (ap.av.getAlignment().getGroups() != null)
{
sp.setAllGroupsCheckEnabled(true);
}
PIDSlider.setTitle("Percentage Identity Threshold (" + source + ")");
- if (ap.av.alignment.getGroups() != null)
+ if (ap.av.getAlignment().getGroups() != null)
{
pid.setAllGroupsCheckEnabled(true);
}
if (allGroupsCheck.isSelected())
{
- allGroups = ap.av.alignment.getGroups();
+ allGroups = ap.av.getAlignment().getGroups();
groupIndex = allGroups.size() - 1;
}
else
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import java.awt.*;
import java.awt.event.*;
+
import javax.swing.*;
/**
{
boolean visible = true;
+ JPanel iconimg = new JPanel(new BorderLayout());
+
+ JTextPane authlist = new JTextPane();
+
JInternalFrame iframe;
Image image;
t.start();
}
+ MouseAdapter closer = new MouseAdapter()
+ {
+ public void mousePressed(MouseEvent evt)
+ {
+ try
+ {
+ visible = false;
+ closeSplash();
+ } catch (Exception ex)
+ {
+ }
+ }
+ };
+
/**
* ping the jalview version page then create and display the jalview
* splashscreen window.
*/
void initSplashScreenWindow()
{
- addMouseListener(new MouseAdapter()
- {
- public void mousePressed(MouseEvent evt)
- {
- try
- {
- visible = false;
- closeSplash();
- } catch (Exception ex)
- {
- }
- }
- });
-
+ addMouseListener(closer);
try
{
java.net.URL url = getClass().getResource("/images/logo.gif");
iframe = new JInternalFrame();
iframe.setFrameIcon(null);
iframe.setClosable(false);
+ this.setLayout(new BorderLayout());
iframe.setContentPane(this);
iframe.setLayer(JLayeredPane.PALETTE_LAYER);
Desktop.desktop.add(iframe);
-
+ SplashImage splashimg = new SplashImage(image);
+ iconimg.add(splashimg, BorderLayout.CENTER);
+ add(iconimg, BorderLayout.WEST);
+ add(authlist, BorderLayout.CENTER);
+ authlist.setEditable(false);
+ authlist.addMouseListener(closer);
+ refreshText();
iframe.setVisible(true);
iframe.setBounds((int) ((Desktop.instance.getWidth() - 750) / 2),
- (int) ((Desktop.instance.getHeight() - 160) / 2), 750, 190);
+ (int) ((Desktop.instance.getHeight() - 160) / 2), 750,
+ iframe.getPreferredSize().height);
+
+ }
+
+ long oldtext = -1;
+
+ /**
+ * update text in author text panel reflecting current version information
+ */
+ protected boolean refreshText()
+ {
+ String newtext = Desktop.instance.getAboutMessage(true).toString();
+ if (oldtext != newtext.hashCode())
+ {
+ oldtext = newtext.hashCode();
+ authlist.setContentType("text/html");
+ authlist.setText(newtext);
+ return true;
+ }
+ return false;
}
/**
public void run()
{
initSplashScreenWindow();
+
long startTime = System.currentTimeMillis() / 1000;
while (visible)
visible = false;
}
else
- repaint();
+ {
+ if (refreshText())
+ {
+ repaint();
+ }
+ }
}
closeSplash();
}
}
- /**
- * DOCUMENT ME!
- *
- * @param g
- * DOCUMENT ME!
- */
- public void paintComponent(Graphics g)
+ public class SplashImage extends JPanel
{
- g.setColor(Color.white);
- g.fillRect(0, 0, getWidth(), getHeight());
- g.setColor(Color.black);
- g.setFont(new Font("Verdana", Font.BOLD, fontSize + 6));
+ Image image;
- if (image != null)
+ public SplashImage(Image todisplay)
{
- g.drawImage(image, 5, yoffset + 12, this);
+ image = todisplay;
+ setPreferredSize(new Dimension(image.getWidth(this) + 8,
+ image.getHeight(this)));
}
- int y = yoffset;
-
- g.drawString("Jalview " + jalview.bin.Cache.getProperty("VERSION"), 50,
- y);
-
- FontMetrics fm = g.getFontMetrics();
- int vwidth = fm.stringWidth("Jalview "
- + jalview.bin.Cache.getProperty("VERSION"));
- g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2));
- g.drawString(
- "Last updated: "
- + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
- 50 + vwidth + 5, y);
- if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
- "Checking"))
+ public void paintComponent(Graphics g)
{
- // Displayed when code version and jnlp version do not match
- g.drawString("...Checking latest version...", 50, y += fontSize + 10);
- y += 5;
+ g.setColor(Color.white);
+ g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.black);
- }
- else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
- .equals(jalview.bin.Cache.getProperty("VERSION")))
- {
- if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
- .indexOf("automated build") == -1)
+ g.setFont(new Font("Verdana", Font.BOLD, fontSize + 6));
+
+ if (image != null)
{
- // Displayed when code version and jnlp version do not match and code
- // version is not a development build
- g.setColor(Color.red);
+ g.drawImage(image, 4, (getHeight() - image.getHeight(this)) / 2,
+ this);
}
- g.drawString(
- "!! Jalview version "
- + jalview.bin.Cache.getDefault("LATEST_VERSION",
- "..Checking..")
- + " is available for download from "+jalview.bin.Cache.getDefault("www.jalview.org","http://www.jalview.org")+" !!",
- 50, y += fontSize + 10);
- y += 5;
- g.setColor(Color.black);
}
-
- g.setFont(new Font("Verdana", Font.BOLD, fontSize));
- g.drawString(
- "Authors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,",
- 50, y += fontSize + 4);
- g.drawString("David Martin & Geoff Barton.", 60, y += fontSize + 4);
- g.drawString(
- "Development managed by The Barton Group, University of Dundee.",
- 50, y += fontSize + 4);
- g.drawString("If you use Jalview, please cite: ", 50,
- y += fontSize + 4);
- g.drawString(
- "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)",
- 50, y += fontSize + 4);
- g.drawString(
- "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench",
- 50, y += fontSize + 4);
- g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033", 50,
- y += fontSize + 4);
+ /*
+ * int y = yoffset;
+ *
+ * g.drawString("Jalview " + jalview.bin.Cache.getProperty("VERSION"), 50,
+ * y);
+ *
+ * FontMetrics fm = g.getFontMetrics(); int vwidth =
+ * fm.stringWidth("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
+ * g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2)); g.drawString(
+ * "Last updated: " + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
+ * 50 + vwidth + 5, y); if (jalview.bin.Cache.getDefault("LATEST_VERSION",
+ * "Checking").equals( "Checking")) { // Displayed when code version and
+ * jnlp version do not match g.drawString("...Checking latest version...",
+ * 50, y += fontSize + 10); y += 5; g.setColor(Color.black); } else if
+ * (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
+ * .equals(jalview.bin.Cache.getProperty("VERSION"))) { if
+ * (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
+ * .indexOf("automated build") == -1) { // Displayed when code version and
+ * jnlp version do not match and code // version is not a development build
+ * g.setColor(Color.red); } g.drawString( "!! Jalview version " +
+ * jalview.bin.Cache.getDefault("LATEST_VERSION", "..Checking..") +
+ * " is available for download from "
+ * +jalview.bin.Cache.getDefault("www.jalview.org"
+ * ,"http://www.jalview.org")+" !!", 50, y += fontSize + 10); y += 5;
+ * g.setColor(Color.black); }
+ *
+ * g.setFont(new Font("Verdana", Font.BOLD, fontSize)); g.drawString(
+ * "Authors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,"
+ * , 50, y += fontSize + 4); g.drawString("David Martin & Geoff Barton.",
+ * 60, y += fontSize + 4); g.drawString(
+ * "Development managed by The Barton Group, University of Dundee.", 50, y
+ * += fontSize + 4); g.drawString("If you use Jalview, please cite: ", 50,
+ * y += fontSize + 4); g.drawString(
+ * "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+ * , 50, y += fontSize + 4); g.drawString(
+ * "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+ * , 50, y += fontSize + 4);
+ * g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033", 50, y
+ * += fontSize + 4); }
+ */
}
-}
+}
\ No newline at end of file
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
void setGroupTextColour()
{
- if (ap.av.alignment.getGroups() == null)
+ if (ap.av.getAlignment().getGroups() == null)
{
return;
}
- Vector groups = ap.av.alignment.getGroups();
+ Vector groups = ap.av.getAlignment().getGroups();
for (int i = 0; i < groups.size(); i++)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
aps[a].av.setSelectionGroup(selected);
}
- selected.setEndRes(aps[a].av.alignment.getWidth() - 1);
+ selected.setEndRes(aps[a].av.getAlignment().getWidth() - 1);
selected.addOrRemove(sequence, true);
}
}
for (int a = 0; a < aps.length; a++)
{
aps[a].av.setSelectionGroup(null);
- aps[a].av.alignment.deleteAllGroups();
+ aps[a].av.getAlignment().deleteAllGroups();
aps[a].av.sequenceColours = null;
}
colourGroups();
}
else
{
- cs = ColourSchemeProperty.getColour(sequences, av.alignment
+ cs = ColourSchemeProperty.getColour(sequences, av.getAlignment()
.getWidth(), ColourSchemeProperty.getColourName(av
.getGlobalColourScheme()));
}
}
SequenceGroup sg = new SequenceGroup(sequences, null, cs, true, true,
- false, 0, av.alignment.getWidth() - 1);
+ false, 0, av.getAlignment().getWidth() - 1);
sg.setName("JTreeGroup:" + sg.hashCode());
sg.setIdColour(col);
sg.getStartRes(), sg.getEndRes());
c.calculate();
- c.verdict(false, aps[a].av.ConsPercGaps);
+ c.verdict(false, aps[a].av.getConsPercGaps());
sg.cs.setConservation(c);
}
- aps[a].av.alignment.addGroup(sg);
+ aps[a].av.getAlignment().addGroup(sg);
}
}
// notify the panel to redo any group specific stuff.
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
{
if (odata == null)
{
- tree = new NJTree(av.alignment.getSequencesArray(), newtree);
+ tree = new NJTree(av.getAlignment().getSequencesArray(), newtree);
}
else
{
- tree = new NJTree(av.alignment.getSequencesArray(), odata,
+ tree = new NJTree(av.getAlignment().getSequencesArray(), odata,
newtree);
}
if (!tree.hasOriginalSequenceData())
if (av.getSelectionGroup() == null)
{
start = 0;
- end = av.alignment.getWidth();
- seqs = av.alignment.getSequencesArray();
+ end = av.getAlignment().getWidth();
+ seqs = av.getAlignment().getSequencesArray();
}
else
{
start = av.getSelectionGroup().getStartRes();
end = av.getSelectionGroup().getEndRes() + 1;
- seqs = av.getSelectionGroup().getSequencesInOrder(av.alignment);
+ seqs = av.getSelectionGroup().getSequencesInOrder(av.getAlignment());
}
tree = new NJTree(seqs, seqStrings, type, pwtype, start, end);
AlignmentSorter.sortByTree(av.getAlignment(), tree);
CommandI undo;
undo=new OrderCommand("Tree Sort", oldOrder,
- av.alignment);
+ av.getAlignment());
ap.paintAlignment(true);
return undo;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import jalview.ws.jws2.JabaParamStore;
import jalview.ws.jws2.JabaPreset;
import jalview.ws.jws2.Jws2Discoverer;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.OptionI;
import jalview.ws.params.ParamDatastoreI;
e.printStackTrace();
return;
}
- Jws2Discoverer.Jws2Instance lastserv = null;
- for (Jws2Discoverer.Jws2Instance service : disc.getServices())
+ Jws2Instance lastserv = null;
+ for (Jws2Instance service : disc.getServices())
{
lastserv = service;
if (p >= args.length || service.serviceType.equalsIgnoreCase(args[p]))
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
addProperties(al);
for (int i = 0; i < annotations.size(); i++)
{
- al.addAnnotation((AlignmentAnnotation) annotations.elementAt(i));
+ // detect if annotations.elementAt(i) rna secondary structure
+ // if so then do:
+ /*
+ * SequenceFeature[] pairArray =
+ * Rna.GetBasePairsFromAlignmentAnnotation(annotations.elementAt(i));
+ * Rna.HelixMap(pairArray);
+ */
+ AlignmentAnnotation an = (AlignmentAnnotation) annotations
+ .elementAt(i);
+ an.validateRangeAndDisplay();
+ al.addAnnotation(an);
}
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
}\r
}\r
if (hasSymbols\r
- && (token.equals("H") || token.equals("E") || token\r
+ && (token.equals("H") || token.equals("E") || token.equals("S") || token\r
.equals(" ")))\r
{\r
// Either this character represents a helix or sheet\r
sg.getStartRes(), sg.getEndRes() + 1);\r
\r
c.calculate();\r
- c.verdict(false, 25);\r
+ c.verdict(false, 25); // TODO: refer to conservation percent threshold\r
\r
sg.cs.setConservation(c);\r
\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
*/
public static final String[] READABLE_EXTENSIONS = new String[]
{ "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar",
- "sto" }; // ,
+ "sto,stk" }; // ,
// ".blast"
// };
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
// SelectAllFilter needs to be set first before adding further
// file filters to fix bug on Mac OSX
setAcceptAllFileFilterUsed(selectAll);
-
+
for (int i = 0; i < suffix.length; i++)
{
JalviewFileFilter jvf = new JalviewFileFilter(suffix[i], desc[i]);
addChoosableFileFilter(jvf);
-
if ((selected != null) && selected.equalsIgnoreCase(desc[i]))
{
chosen = jvf;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
\r
import com.stevesoft.pat.*;\r
import jalview.datamodel.*;\r
+import jalview.analysis.Rna;\r
\r
// import org.apache.log4j.*;\r
\r
Hashtable seqs = new Hashtable();\r
Regex p, r, rend, s, x;\r
\r
+ // Temporary line for processing RNA annotation\r
+ // String RNAannot = "";\r
+\r
// ------------------ Parsing File ----------------------\r
// First, we have to check that this file has STOCKHOLM format, i.e. the\r
// first line must match\r
r = new Regex("#=(G[FSRC]?)\\s+(.*)"); // Finds any annotation line\r
x = new Regex("(\\S+)\\s+(\\S+)"); // split id from sequence\r
\r
+ // Convert all bracket types to parentheses (necessary for passing to VARNA)\r
+ Regex openparen = new Regex("(<|\\[)", "(");\r
+ Regex closeparen = new Regex("(>|\\])", ")");\r
+\r
+ // Detect if file is RNA by looking for bracket types\r
+ Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");\r
+\r
rend.optimize();\r
p.optimize();\r
s.optimize();\r
r.optimize();\r
x.optimize();\r
+ openparen.optimize();\r
+ closeparen.optimize();\r
\r
while ((line = nextLine()) != null)\r
{\r
int start = 1;\r
int end = -1;\r
String sid = acc;\r
- // Retrieve hash of annotations for this accession\r
+ /*\r
+ * Retrieve hash of annotations for this accession\r
+ * Associate Annotation with accession\r
+ */\r
Hashtable accAnnotations = null;\r
\r
if (seqAnn != null && seqAnn.containsKey(acc))\r
{\r
accAnnotations = (Hashtable) seqAnn.remove(acc);\r
+ //TODO: add structures to sequence\r
}\r
\r
// Split accession in id and from/to\r
jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn);\r
// seqO.addDBRef(dbref);\r
}\r
+ } \r
+ if (accAnnotations != null && accAnnotations.containsKey("SS"))\r
+ {\r
+ Vector v = (Vector) accAnnotations.get("SS");\r
+ \r
+ for (int i = 0; i < v.size(); i++)\r
+ {\r
+ AlignmentAnnotation an = (AlignmentAnnotation) v.elementAt(i);\r
+ seqO.addAlignmentAnnotation(an);\r
+ //annotations.add(an);\r
+ }\r
}\r
+ \r
Hashtable features = null;\r
// We need to adjust the positions of all features to account for gaps\r
try\r
ann = new Hashtable();\r
seqAnn.put(acc, ann);\r
}\r
-\r
+ //TODO test structure, call parseAnnotationRow with vector from hashtable for specific sequence\r
Hashtable features;\r
// Get an object with all the content for an annotation\r
if (ann.containsKey("features"))\r
}\r
ns += seq;\r
content.put(description, ns);\r
+
+ if(type.equals("SS")){\r
+ Hashtable strucAnn;\r
+ if (seqAnn.containsKey(acc))\r
+ {\r
+ strucAnn = (Hashtable) seqAnn.get(acc);\r
+ }\r
+ else\r
+ {\r
+ strucAnn = new Hashtable();\r
+ }\r
+ \r
+ Vector newStruc=new Vector();\r
+ parseAnnotationRow(newStruc, type,ns);\r
+ \r
+ strucAnn.put(type, newStruc);\r
+ seqAnn.put(acc, strucAnn);\r
+ }\r
}\r
else\r
{\r
private AlignmentAnnotation parseAnnotationRow(Vector annotation,\r
String label, String annots)\r
{\r
+ String convert1, convert2 = null;\r
+\r
+ // Convert all bracket types to parentheses\r
+ Regex openparen = new Regex("(<|\\[)", "(");\r
+ Regex closeparen = new Regex("(>|\\])", ")");\r
+\r
+ // Detect if file is RNA by looking for bracket types\r
+ Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");\r
+\r
+ convert1 = openparen.replaceAll(annots);\r
+ convert2 = closeparen.replaceAll(convert1);\r
+ annots = convert2;\r
+\r
String type = (label.indexOf("_cons") == label.length() - 5) ? label\r
.substring(0, label.length() - 5) : label;\r
boolean ss = false;\r
// be written out\r
if (ss)\r
{\r
- ann.secondaryStructure = jalview.schemes.ResidueProperties\r
- .getDssp3state(pos).charAt(0);\r
+ if (detectbrackets.search(pos))\r
+ {\r
+ ann.secondaryStructure = jalview.schemes.ResidueProperties\r
+ .getRNASecStrucState(pos).charAt(0);\r
+ }\r
+ else\r
+ {\r
+ ann.secondaryStructure = jalview.schemes.ResidueProperties\r
+ .getDssp3state(pos).charAt(0);\r
+ }\r
+\r
if (ann.secondaryStructure == pos.charAt(0) || pos.charAt(0) == 'C')\r
{\r
ann.displayCharacter = ""; // null; // " ";\r
annot.annotations.length);\r
System.arraycopy(els, 0, anns, annot.annotations.length, els.length);\r
annot.annotations = anns;\r
+ //System.out.println("else: ");\r
}\r
return annot;\r
}\r
+ id);\r
return id;\r
}\r
+ /**\r
+ * //ssline is complete secondary structure line private AlignmentAnnotation\r
+ * addHelices(Vector annotation, String label, String ssline) {\r
+ * \r
+ * // decide on secondary structure or not. Annotation[] els = new\r
+ * Annotation[ssline.length()]; for (int i = 0; i < ssline.length(); i++) {\r
+ * String pos = ssline.substring(i, i + 1); Annotation ann; ann = new\r
+ * Annotation(pos, "", ' ', 0f); // 0f is 'valid' null - will not\r
+ * \r
+ * ann.secondaryStructure =\r
+ * jalview.schemes.ResidueProperties.getRNAssState(pos).charAt(0);\r
+ * \r
+ * ann.displayCharacter = "x" + ann.displayCharacter;\r
+ * \r
+ * System.out.println(ann.displayCharacter);\r
+ * \r
+ * els[i] = ann; } AlignmentAnnotation helicesAnnot = null; Enumeration e =\r
+ * annotation.elements(); while (e.hasMoreElements()) { helicesAnnot =\r
+ * (AlignmentAnnotation) e.nextElement(); if (helicesAnnot.label.equals(type))\r
+ * break; helicesAnnot = null; } if (helicesAnnot == null) { helicesAnnot =\r
+ * new AlignmentAnnotation(type, type, els);\r
+ * annotation.addElement(helicesAnnot); } else { Annotation[] anns = new\r
+ * Annotation[helicesAnnot.annotations.length + els.length];\r
+ * System.arraycopy(helicesAnnot.annotations, 0, anns, 0,\r
+ * helicesAnnot.annotations.length); System.arraycopy(els, 0, anns,\r
+ * helicesAnnot.annotations.length, els.length); helicesAnnot.annotations =\r
+ * anns; }\r
+ * \r
+ * helicesAnnot.features = Rna.GetBasePairs(ssline);\r
+ * Rna.HelixMap(helicesAnnot.features);\r
+ * \r
+ * \r
+ * return helicesAnnot; }\r
+ */\r
}\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
+ protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
+ // protected JRadioButtonMenuItem covariationColour = new
+ // JRadioButtonMenuItem();
+
JMenuItem njTreeBlosumMenuItem = new JMenuItem();
JMenuItem avDistanceTreeBlosumMenuItem = new JMenuItem();
public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
- protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
-
JMenuItem deleteGroups = new JMenuItem();
JMenuItem delete = new JMenuItem();
protected JMenu showProducts = new JMenu();
- public JMenuItem featureSettings = new JMenuItem();
+ public JMenuItem openFeatureSettings = new JMenuItem();
JMenuItem fetchSequence = new JMenuItem();
JMenuItem annotationColour = new JMenuItem();
+ protected JMenuItem rnahelicesColour = new JMenuItem();
+
JMenuItem associatedData = new JMenuItem();
protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
+
protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
private JMenuItem grpsFromSelection = new JMenuItem();
colours.add(PIDColour);
colours.add(BLOSUM62Colour);
colours.add(nucleotideColour);
+ colours.add(purinePyrimidineColour);
+ // colours.add(covariationColour);
setColourSelected(jalview.bin.Cache
.getDefault("DEFAULT_COLOUR", "None"));
break;
+ case ColourSchemeProperty.PURINEPYRIMIDINE:
+ purinePyrimidineColour.setSelected(true);
+
+ break;
+ /*
+ * case ColourSchemeProperty.COVARIATION:
+ * covariationColour.setSelected(true);
+ *
+ * break;
+ */
case ColourSchemeProperty.USER_DEFINED:
userDefinedColour.setSelected(true);
BLOSUM62Colour_actionPerformed(e);
}
});
+ nucleotideColour.setText("Nucleotide");
+ nucleotideColour.addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ nucleotideColour_actionPerformed(e);
+ }
+ });
+
+ purinePyrimidineColour.setText("Purine/Pyrimidine");
+ purinePyrimidineColour
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ purinePyrimidineColour_actionPerformed(e);
+ }
+ });
+ /*
+ * covariationColour.setText("Covariation");
+ * covariationColour.addActionListener(new java.awt.event.ActionListener() {
+ * public void actionPerformed(ActionEvent e) {
+ * covariationColour_actionPerformed(e); } });
+ */
+
avDistanceTreeBlosumMenuItem.setText("Average Distance Using BLOSUM62");
avDistanceTreeBlosumMenuItem
.addActionListener(new java.awt.event.ActionListener()
}
});
+ normaliseSequenceLogo.setText("Normalise Consensus Logo");
+ normaliseSequenceLogo.addActionListener(new ActionListener()
+ {
+
+ public void actionPerformed(ActionEvent e)
+ {
+ normaliseSequenceLogo_actionPerformed(e);
+ }
+
+ });
applyAutoAnnotationSettings.setText("Apply to all groups");
applyAutoAnnotationSettings.setState(false);
applyAutoAnnotationSettings.setVisible(true);
* public void actionPerformed(ActionEvent e) {
* showProducts_actionPerformed(e); } });
*/
- featureSettings.setText("Feature Settings...");
- featureSettings.addActionListener(new ActionListener()
+ openFeatureSettings.setText("Feature Settings...");
+ openFeatureSettings.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
annotationColour_actionPerformed(e);
}
});
+
+ rnahelicesColour.setText("By RNA helices");
+ rnahelicesColour.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ rnahelicesColour_actionPerformed(e);
+ }
+ });
+
associatedData.setText("Load Features / Annotations");
associatedData.addActionListener(new ActionListener()
{
autoAnnMenu.add(applyAutoAnnotationSettings);
autoAnnMenu.add(showConsensusHistogram);
autoAnnMenu.add(showSequenceLogo);
+ autoAnnMenu.add(normaliseSequenceLogo);
autoAnnMenu.addSeparator();
autoAnnMenu.add(showGroupConservation);
autoAnnMenu.add(showGroupConsensus);
viewMenu.add(showSeqFeatures);
// viewMenu.add(showSeqFeaturesHeight);
- viewMenu.add(featureSettings);
+ viewMenu.add(openFeatureSettings);
tooltipSettingsMenu.add(showDbRefsMenuitem);
tooltipSettingsMenu.add(showNpFeatsMenuitem);
viewMenu.add(tooltipSettingsMenu);
colourMenu.add(turnColour);
colourMenu.add(buriedColour);
colourMenu.add(nucleotideColour);
+ colourMenu.add(purinePyrimidineColour);
+ // colourMenu.add(covariationColour);
colourMenu.add(userDefinedColour);
colourMenu.addSeparator();
colourMenu.add(conservationMenuItem);
colourMenu.add(abovePIDThreshold);
colourMenu.add(modifyPID);
colourMenu.add(annotationColour);
+ colourMenu.add(rnahelicesColour);
calculateMenu.add(sort);
calculateMenu.add(calculateTree);
calculateMenu.addSeparator();
//selectMenu.add(listenToViewSelections);
}
+ protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
protected void listenToViewSelections_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
{
}
+ protected void purinePyrimidineColour_actionPerformed(ActionEvent e)
+ {
+ }
+
+ /*
+ * protected void covariationColour_actionPerformed(ActionEvent e) { }
+ */
+
protected void noColourmenuItem_actionPerformed(ActionEvent e)
{
}
}
+ public void rnahelicesColour_actionPerformed(ActionEvent e)
+ {
+
+ }
+
public void associatedData_actionPerformed(ActionEvent e)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.jbgui;
+
+import javax.swing.*;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+public class GRnaStructureViewer extends JInternalFrame
+{
+ public GRnaStructureViewer()
+ {
+ try
+ {
+ jbInit();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ private void jbInit() throws Exception
+ {
+
+ }
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
buriedColour_actionPerformed(actionEvent);
}
});
+ purinePyrimidineColour.setText("Purine/Pyrimidine");
+ purinePyrimidineColour.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ purinePyrimidineColour_actionPerformed(actionEvent);
+ }
+ });
+
userColour.setText("User Defined ...");
userColour.addActionListener(new ActionListener()
{
colourMenu.add(strandColour);
colourMenu.add(turnColour);
colourMenu.add(buriedColour);
+ colourMenu.add(purinePyrimidineColour);
colourMenu.add(userColour);
colourMenu.add(jmolColour);
colourMenu.add(backGround);
protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
+
+ protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
protected JRadioButtonMenuItem userColour = new JRadioButtonMenuItem();
{
}
+
+ public void purinePyrimidineColour_actionPerformed(ActionEvent actionEvent)
+ {
+
+ }
public void userColour_actionPerformed(ActionEvent actionEvent)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+package jalview.renderer;
+
+import jalview.analysis.AAFrequency;
+import jalview.analysis.StructureFrequency;
+import jalview.api.AlignViewportI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.ColumnSelection;
+import jalview.schemes.ColourSchemeI;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.font.LineMetrics;
+import java.awt.geom.AffineTransform;
+import java.awt.image.ImageObserver;
+import java.util.Hashtable;
+
+import com.stevesoft.pat.Regex;
+
+public class AnnotationRenderer
+{
+
+ public AnnotationRenderer()
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ public void drawStemAnnot(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+ {
+ g.setColor(STEM_COLOUR);
+ int sCol = (lastSSX / charWidth) + startRes;
+ int x1 = lastSSX;
+ int x2 = (x * charWidth);
+ Regex closeparen = new Regex("(\\))");
+
+ String dc = (column == 0 || row.annotations[column-1]==null) ? ""
+ : row.annotations[column - 1].displayCharacter;
+
+ boolean diffupstream = sCol == 0 || row.annotations[sCol - 1] == null
+ || !dc.equals(row.annotations[sCol - 1].displayCharacter);
+ boolean diffdownstream = !validRes || !validEnd
+ || row.annotations[column] == null
+ || !dc.equals(row.annotations[column].displayCharacter);
+ // System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream);
+ // If a closing base pair half of the stem, display a backward arrow
+ if (column > 0 && closeparen.search(dc))
+ {
+ if (diffupstream)
+ // if (validRes && column>1 && row.annotations[column-2]!=null &&
+ // dc.equals(row.annotations[column-2].displayCharacter))
+ {
+ g.fillPolygon(new int[]
+ { lastSSX + 5, lastSSX + 5, lastSSX }, new int[]
+ { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3);
+ x1 += 5;
+ }
+ if (diffdownstream)
+ {
+ x2 -= 1;
+ }
+ }
+ else
+ {
+ // display a forward arrow
+ if (diffdownstream)
+ {
+ g.fillPolygon(new int[]
+ { x2 - 5, x2 - 5, x2 }, new int[]
+ { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3);
+ x2 -= 5;
+ }
+ if (diffupstream)
+ {
+ x1 += 1;
+ }
+ }
+ // draw arrow body
+ g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 7);
+ }
+ private int charWidth,endRes,charHeight;
+ private boolean validCharWidth, hasHiddenColumns;
+ private FontMetrics fm;
+ private boolean MAC=new jalview.util.Platform().isAMac();
+ boolean av_renderHistogram = true, av_renderProfile = true, av_normaliseProfile=false;
+ ColourSchemeI profcolour=null;
+ private ColumnSelection columnSelection;
+ private Hashtable[] hconsensus;
+ private Hashtable[] hStrucConsensus;
+ private boolean av_ignoreGapsConsensus;
+
+ /**
+ * attributes set from AwtRenderPanelI
+ */
+ /**
+ * old image used when data is currently being calculated and cannot be rendered
+ */
+ private Image fadedImage;
+ /**
+ * panel being rendered into
+ */
+ private ImageObserver annotationPanel;
+ /**
+ * width of image to render in panel
+ */
+ private int imgWidth;
+
+ // public void updateFromAnnotationPanel(FontMetrics annotFM, AlignViewportI av)
+ public void updateFromAwtRenderPanel(AwtRenderPanelI annotPanel, AlignViewportI av)
+ {
+ fm = annotPanel.getFontMetrics();
+ annotationPanel = annotPanel;
+ fadedImage=annotPanel.getFadedImage();
+ imgWidth=annotPanel.getFadedImageWidth();
+ updateFromAlignViewport(av);
+ }
+ public void updateFromAlignViewport(AlignViewportI av)
+ {
+ charWidth = av.getCharWidth();
+ endRes = av.getEndRes();
+ charHeight = av.getCharHeight();
+ hasHiddenColumns = av.hasHiddenColumns();
+ validCharWidth = av.isValidCharWidth();
+ av_renderHistogram = av.isShowConsensusHistogram();
+ av_renderProfile = av.isShowSequenceLogo();
+ av_normaliseProfile= av.isNormaliseSequenceLogo();
+ profcolour = av.getGlobalColourScheme();
+ if (profcolour == null)
+ {
+ // Set the default colour for sequence logo if the alignnent has no colourscheme set
+ profcolour = av.getAlignment().isNucleotide() ? new jalview.schemes.NucleotideColourScheme() : new jalview.schemes.ZappoColourScheme();
+ }
+ columnSelection = av.getColumnSelection();
+ hconsensus = av.getSequenceConsensusHash();//hconsensus;
+ hStrucConsensus = av.getRnaStructureConsensusHash(); //hStrucConsensus;
+ av_ignoreGapsConsensus=av.getIgnoreGapsConsensus();
+ }
+ public int[] getProfileFor(AlignmentAnnotation aa, int column)
+ {
+ // TODO : consider refactoring the global alignment calculation properties/rendering attributes as a global 'alignment group' which holds all vis settings for the alignment as a whole rather than a subset
+ //
+ if (aa.autoCalculated && aa.label.startsWith("Consensus"))
+ {
+ if (aa.groupRef != null && aa.groupRef.consensusData != null
+ && aa.groupRef.isShowSequenceLogo())
+ {
+ return AAFrequency.extractProfile(
+ aa.groupRef.consensusData[column], aa.groupRef
+ .getIgnoreGapsConsensus());
+ }
+ // TODO extend annotation row to enable dynamic and static profile data to
+ // be stored
+ if (aa.groupRef == null && aa.sequenceRef == null
+ && av_renderProfile)
+ {
+ return AAFrequency.extractProfile(hconsensus[column], av_ignoreGapsConsensus);
+ }
+ }
+ else
+ {
+ if (aa.autoCalculated && aa.label.startsWith("StrucConsensus"))
+ {
+ // TODO implement group structure consensus
+ /* if (aa.groupRef != null && aa.groupRef.consensusData != null
+ && aa.groupRef.isShowSequenceLogo())
+ {
+ //TODO check what happens for group selections
+ return StructureFrequency.extractProfile(
+ aa.groupRef.consensusData[column], aa.groupRef
+ .getIgnoreGapsConsensus());
+ }
+ */
+ // TODO extend annotation row to enable dynamic and static profile data
+ // to
+ // be stored
+ if (aa.groupRef == null && aa.sequenceRef == null
+ && av_renderProfile && hStrucConsensus!=null && hStrucConsensus.length>column)
+ {
+ return StructureFrequency.extractProfile(hStrucConsensus[column],
+ av_ignoreGapsConsensus);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param annotationPanel TODO
+ * @param g
+ * DOCUMENT ME!
+ * @param startRes
+ * DOCUMENT ME!
+ * @param endRes
+ * DOCUMENT ME!
+ */
+ public void drawComponent(AwtRenderPanelI annotPanel, AlignViewportI av, Graphics g, int activeRow, int startRes, int endRes)
+ {
+ // NOTES:
+ // AnnotationPanel needs to implement: ImageObserver, access to AlignViewport
+ updateFromAwtRenderPanel(annotPanel, av);
+ fm = g.getFontMetrics();
+ AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
+
+ int x = 0, y = 0;
+ int column = 0;
+ char lastSS;
+ int lastSSX;
+ int iconOffset = 0;
+ boolean validRes = false;
+ boolean validEnd = false;
+ boolean labelAllCols = false;
+ boolean centreColLabels, centreColLabelsDef = av
+ .getCentreColumnLabels();
+ boolean scaleColLabel = false;
+ boolean[] graphGroupDrawn = new boolean[aa.length];
+ int charOffset = 0; // offset for a label
+ float fmWidth, fmScaling = 1f; // scaling for a label to fit it into a
+ // column.
+ Font ofont = g.getFont();
+ // \u03B2 \u03B1
+ for (int i = 0; i < aa.length; i++)
+ {
+ AlignmentAnnotation row = aa[i];
+
+ if (!row.visible)
+ {
+ continue;
+ }
+ centreColLabels = row.centreColLabels || centreColLabelsDef;
+ labelAllCols = row.showAllColLabels;
+ scaleColLabel = row.scaleColLabel;
+ lastSS = ' ';
+ lastSSX = 0;
+ if (row.graph > 0)
+ {
+ if (row.graphGroup > -1 && graphGroupDrawn[row.graphGroup])
+ {
+ continue;
+ }
+
+ // this is so that we draw the characters below the graph
+ y += row.height;
+
+ if (row.hasText)
+ {
+ iconOffset = charHeight - fm.getDescent();
+ y -= charHeight;
+ }
+ }
+ else if (row.hasText)
+ {
+ iconOffset = charHeight - fm.getDescent();
+
+ }
+ else
+ {
+ iconOffset = 0;
+ }
+
+ if (aa[i].autoCalculated && av.isCalculationInProgress(aa[i]))
+ {
+ y += charHeight;
+
+ g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
+ - row.height, imgWidth, y, annotationPanel);
+ g.setColor(Color.black);
+ // g.drawString("Calculating "+aa[i].label+"....",20, y-row.height/2);
+
+ continue;
+ }
+
+/* else if (annotationPanel.av.updatingConservation
+ && aa[i].label.equals("Conservation"))
+ {
+
+ y += charHeight;
+ g.drawImage(annotationPanel.fadedImage, 0, y - row.height, annotationPanel.imgWidth, y, 0, y
+ - row.height, annotationPanel.imgWidth, y, annotationPanel);
+
+ g.setColor(Color.black);
+ // g.drawString("Calculating Conservation.....",20, y-row.height/2);
+
+ continue;
+ }
+ else if (annotationPanel.av.updatingConservation && aa[i].label.equals("Quality"))
+ {
+
+ y += charHeight;
+ g.drawImage(annotationPanel.fadedImage, 0, y - row.height, annotationPanel.imgWidth, y, 0, y
+ - row.height, annotationPanel.imgWidth, y, annotationPanel);
+ g.setColor(Color.black);
+ // / g.drawString("Calculating Quality....",20, y-row.height/2);
+
+ continue;
+ }
+ */
+ // first pass sets up state for drawing continuation from left-hand column
+ // of startRes
+ x = (startRes == 0) ? 0 : -1;
+ while (x < endRes - startRes)
+ {
+ if (hasHiddenColumns)
+ {
+ column = columnSelection.adjustForHiddenColumns(
+ startRes + x);
+ if (column > row.annotations.length - 1)
+ {
+ break;
+ }
+ }
+ else
+ {
+ column = startRes + x;
+ }
+
+ if ((row.annotations == null) || (row.annotations.length <= column)
+ || (row.annotations[column] == null))
+ {
+ validRes = false;
+ }
+ else
+ {
+ validRes = true;
+ }
+ if (x > -1)
+ {
+ if (activeRow == i)
+ {
+ g.setColor(Color.red);
+
+ if (columnSelection != null)
+ {
+ for (int n = 0; n < columnSelection.size(); n++)
+ {
+ int v = columnSelection.columnAt(n);
+
+ if (v == column)
+ {
+ g.fillRect(x * charWidth, y, charWidth,
+ charHeight);
+ }
+ }
+ }
+ }
+ if (!row.isValidStruc())
+ {
+ g.setColor(Color.orange);
+ g.fillRect((int)row.getInvalidStrucPos()*charWidth, y, charWidth, charHeight);
+ }
+ if (validCharWidth
+ && validRes
+ && row.annotations[column].displayCharacter != null
+ && (row.annotations[column].displayCharacter.length() > 0))
+ {
+
+ if (centreColLabels || scaleColLabel)
+ {
+ fmWidth = (float) fm.charsWidth(
+ row.annotations[column].displayCharacter
+ .toCharArray(), 0,
+ row.annotations[column].displayCharacter.length());
+
+ if (scaleColLabel)
+ {
+ // justify the label and scale to fit in column
+ if (fmWidth > charWidth)
+ {
+ // scale only if the current font isn't already small enough
+ fmScaling = charWidth;
+ fmScaling /= fmWidth;
+ g.setFont(ofont.deriveFont(AffineTransform
+ .getScaleInstance(fmScaling, 1.0)));
+ // and update the label's width to reflect the scaling.
+ fmWidth = charWidth;
+ }
+ }
+ }
+ else
+ {
+ fmWidth = (float) fm
+ .charWidth(row.annotations[column].displayCharacter
+ .charAt(0));
+ }
+ charOffset = (int) ((charWidth - fmWidth) / 2f);
+
+ if (row.annotations[column].colour == null)
+ g.setColor(Color.black);
+ else
+ g.setColor(row.annotations[column].colour);
+
+ if (column == 0 || row.graph > 0)
+ {
+ g.drawString(row.annotations[column].displayCharacter,
+ (x * charWidth) + charOffset, y + iconOffset);
+ }
+ else if (row.annotations[column - 1] == null
+ || (labelAllCols
+ || !row.annotations[column].displayCharacter
+ .equals(row.annotations[column - 1].displayCharacter) || (row.annotations[column].displayCharacter
+ .length() < 2 && row.annotations[column].secondaryStructure == ' ')))
+ {
+ g.drawString(row.annotations[column].displayCharacter, x
+ * charWidth + charOffset, y + iconOffset);
+ }
+ g.setFont(ofont);
+ }
+ }
+ if (row.hasIcons)
+ {
+ char ss = validRes ? row.annotations[column].secondaryStructure
+ : ' ';
+ if (ss == 'S')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row.annotations[column].displayCharacter.indexOf(')') > -1)
+ {
+ ss = 's';
+ }
+ }
+ if (!validRes || (ss != lastSS))
+ {
+ if (x > -1)
+ {
+ switch (lastSS)
+ {
+ case 'H':
+ drawHelixAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
+
+ case 'E':
+ drawSheetAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
+
+ case 'S': // Stem case for RNA secondary structure
+ case 's': // and opposite direction
+ drawStemAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
+
+ default:
+ g.setColor(Color.gray);
+ g.fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth)
+ - lastSSX, 2);
+
+ break;
+ }
+ }
+ if (validRes)
+ {
+ lastSS = ss;
+ }
+ else
+ {
+ lastSS = ' ';
+ }
+ if (x > -1)
+ {
+ lastSSX = (x * charWidth);
+ }
+ }
+ }
+ column++;
+ x++;
+ }
+ if (column >= row.annotations.length)
+ {
+ column = row.annotations.length - 1;
+ validEnd = false;
+ }
+ else
+ {
+ validEnd = true;
+ }
+ if ((row.annotations == null) || (row.annotations.length <= column)
+ || (row.annotations[column] == null))
+ {
+ validRes = false;
+ }
+ else
+ {
+ validRes = true;
+ }
+
+ // x ++;
+
+ if (row.hasIcons)
+ {
+ switch (lastSS)
+ {
+ case 'H':
+ drawHelixAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
+
+ case 'E':
+ drawSheetAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
+ case 's':
+ case 'S': // Stem case for RNA secondary structure
+ drawStemAnnot(g, row, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
+ default:
+ drawGlyphLine(g, row, lastSSX, x, y, iconOffset, startRes,
+ column, validRes, validEnd);
+ break;
+ }
+ }
+
+ if (row.graph > 0 && row.graphHeight > 0)
+ {
+ if (row.graph == AlignmentAnnotation.LINE_GRAPH)
+ {
+ if (row.graphGroup > -1 && !graphGroupDrawn[row.graphGroup])
+ {
+ float groupmax = -999999, groupmin = 9999999;
+ for (int gg = 0; gg < aa.length; gg++)
+ {
+ if (aa[gg].graphGroup != row.graphGroup)
+ {
+ continue;
+ }
+
+ if (aa[gg] != row)
+ {
+ aa[gg].visible = false;
+ }
+
+ if (aa[gg].graphMax > groupmax)
+ {
+ groupmax = aa[gg].graphMax;
+ }
+ if (aa[gg].graphMin < groupmin)
+ {
+ groupmin = aa[gg].graphMin;
+ }
+ }
+
+ for (int gg = 0; gg < aa.length; gg++)
+ {
+ if (aa[gg].graphGroup == row.graphGroup)
+ {
+ drawLineGraph(g, aa[gg], startRes, endRes, y, groupmin,
+ groupmax, row.graphHeight);
+ }
+ }
+
+ graphGroupDrawn[row.graphGroup] = true;
+ }
+ else
+ {
+ drawLineGraph( g, row, startRes, endRes, y, row.graphMin,
+ row.graphMax, row.graphHeight);
+ }
+ }
+ else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
+ {
+ drawBarGraph(g, row, startRes, endRes, row.graphMin,
+ row.graphMax, y);
+ }
+ }
+
+ if (row.graph > 0 && row.hasText)
+ {
+ y += charHeight;
+ }
+
+ if (row.graph == 0)
+ {
+ y += aa[i].height;
+ }
+ }
+ }
+
+ private Color GLYPHLINE_COLOR=Color.gray;
+ private Color SHEET_COLOUR=Color.green;
+ private Color HELIX_COLOUR=Color.red;
+ private Color STEM_COLOUR=Color.blue;
+
+
+ public void drawGlyphLine(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+ {
+ g.setColor(GLYPHLINE_COLOR);
+ g
+ .fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth)
+ - lastSSX, 2);
+ }
+
+ public void drawSheetAnnot(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+ {
+ g.setColor(SHEET_COLOUR);
+
+ if (!validEnd || !validRes || row.annotations[column] == null
+ || row.annotations[column].secondaryStructure != 'E')
+ {
+ g.fillRect(lastSSX, y + 4 + iconOffset, (x * charWidth) - lastSSX
+ - 4, 7);
+ g.fillPolygon(
+ new int[]
+ { (x * charWidth) - 4, (x * charWidth) - 4,
+ (x * charWidth) }, new int[]
+ { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset },
+ 3);
+ }
+ else
+ {
+ g.fillRect(lastSSX, y + 4 + iconOffset, (x + 1) * charWidth
+ - lastSSX, 7);
+ }
+
+ }
+
+ public void drawHelixAnnot(Graphics g, AlignmentAnnotation row, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd)
+ {
+ g.setColor(HELIX_COLOUR);
+
+ int sCol = (lastSSX / charWidth) + startRes;
+ int x1 = lastSSX;
+ int x2 = (x * charWidth);
+
+ if (MAC)
+ {
+ int ofs = charWidth / 2;
+ // Off by 1 offset when drawing rects and ovals
+ // to offscreen image on the MAC
+ g.fillRoundRect(lastSSX, y + 4 + iconOffset, x2 - x1, 8, 8, 8);
+ if (sCol == 0 || row.annotations[sCol - 1] == null
+ || row.annotations[sCol - 1].secondaryStructure != 'H')
+ {
+ }
+ else
+ {
+ // g.setColor(Color.orange);
+ g.fillRoundRect(lastSSX, y + 4 + iconOffset, x2 - x1 - ofs + 1, 8,
+ 0, 0);
+ }
+ if (!validRes || row.annotations[column] == null
+ || row.annotations[column].secondaryStructure != 'H')
+ {
+
+ }
+ else
+ {
+ // g.setColor(Color.magenta);
+ g.fillRoundRect(lastSSX + ofs, y + 4 + iconOffset, x2 - x1 - ofs
+ + 1, 8, 0, 0);
+
+ }
+
+ return;
+ }
+
+ if (sCol == 0 || row.annotations[sCol - 1] == null
+ || row.annotations[sCol - 1].secondaryStructure != 'H')
+ {
+ g.fillArc(lastSSX, y + 4 + iconOffset, charWidth, 8, 90, 180);
+ x1 += charWidth / 2;
+ }
+
+ if (!validRes || row.annotations[column] == null
+ || row.annotations[column].secondaryStructure != 'H')
+ {
+ g.fillArc((x * charWidth) - charWidth, y + 4 + iconOffset,
+ charWidth, 8, 270, 180);
+ x2 -= charWidth / 2;
+ }
+
+ g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 8);
+ }
+
+ public void drawLineGraph(Graphics g, AlignmentAnnotation aa, int sRes, int eRes, int y, float min, float max, int graphHeight)
+ {
+ if (sRes > aa.annotations.length)
+ {
+ return;
+ }
+
+ int x = 0;
+
+ // Adjustment for fastpaint to left
+ if (eRes < endRes)
+ {
+ eRes++;
+ }
+
+ eRes = Math.min(eRes, aa.annotations.length);
+
+ if (sRes == 0)
+ {
+ x++;
+ }
+
+ int y1 = y, y2 = y;
+ float range = max - min;
+
+ // //Draw origin
+ if (min < 0)
+ {
+ y2 = y - (int) ((0 - min / range) * graphHeight);
+ }
+
+ g.setColor(Color.gray);
+ g.drawLine(x - charWidth, y2, (eRes - sRes + 1) * charWidth, y2);
+
+ eRes = Math.min(eRes, aa.annotations.length);
+
+ int column;
+ int aaMax = aa.annotations.length - 1;
+
+ while (x < eRes - sRes)
+ {
+ column = sRes + x;
+ if (hasHiddenColumns)
+ {
+ column = columnSelection.adjustForHiddenColumns(column);
+ }
+
+ if (column > aaMax)
+ {
+ break;
+ }
+
+ if (aa.annotations[column] == null
+ || aa.annotations[column - 1] == null)
+ {
+ x++;
+ continue;
+ }
+
+ if (aa.annotations[column].colour == null)
+ g.setColor(Color.black);
+ else
+ g.setColor(aa.annotations[column].colour);
+
+ y1 = y
+ - (int) (((aa.annotations[column - 1].value - min) / range) * graphHeight);
+ y2 = y
+ - (int) (((aa.annotations[column].value - min) / range) * graphHeight);
+
+ g.drawLine(x * charWidth - charWidth / 2, y1, x * charWidth
+ + charWidth / 2, y2);
+ x++;
+ }
+
+ if (aa.threshold != null)
+ {
+ g.setColor(aa.threshold.colour);
+ Graphics2D g2 = (Graphics2D) g;
+ g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
+ BasicStroke.JOIN_ROUND, 3f, new float[]
+ { 5f, 3f }, 0f));
+
+ y2 = (int) (y - ((aa.threshold.value - min) / range) * graphHeight);
+ g.drawLine(0, y2, (eRes - sRes) * charWidth, y2);
+ g2.setStroke(new BasicStroke());
+ }
+ }
+
+ public void drawBarGraph(Graphics g, AlignmentAnnotation aa, int sRes, int eRes, float min, float max, int y)
+ {
+ if (sRes > aa.annotations.length)
+ {
+ return;
+ }
+ Font ofont = g.getFont();
+ eRes = Math.min(eRes, aa.annotations.length);
+
+ int x = 0, y1 = y, y2 = y;
+
+ float range = max - min;
+
+ if (min < 0)
+ {
+ y2 = y - (int) ((0 - min / (range)) * aa.graphHeight);
+ }
+
+ g.setColor(Color.gray);
+
+ g.drawLine(x, y2, (eRes - sRes) * charWidth, y2);
+
+ int column;
+ int aaMax = aa.annotations.length - 1;
+ boolean renderHistogram = true, renderProfile = true, normaliseProfile=false;
+ // if (aa.autoCalculated && aa.label.startsWith("Consensus"))
+ {
+ // TODO: generalise this to have render styles for consensus/profile data
+ if (aa.groupRef != null)
+ {
+ renderHistogram = aa.groupRef.isShowConsensusHistogram();
+ renderProfile = aa.groupRef.isShowSequenceLogo();
+ normaliseProfile= aa.groupRef.isNormaliseSequenceLogo();
+ }
+ else
+ {
+ renderHistogram = av_renderHistogram;
+ renderProfile = av_renderProfile;
+ normaliseProfile= av_normaliseProfile;
+ }
+ }
+ while (x < eRes - sRes)
+ {
+ column = sRes + x;
+ if (hasHiddenColumns)
+ {
+ column = columnSelection.adjustForHiddenColumns(column);
+ }
+
+ if (column > aaMax)
+ {
+ break;
+ }
+
+ if (aa.annotations[column] == null)
+ {
+ x++;
+ continue;
+ }
+ if (aa.annotations[column].colour == null)
+ g.setColor(Color.black);
+ else
+ g.setColor(aa.annotations[column].colour);
+
+ y1 = y
+ - (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
+
+ if (renderHistogram)
+ {
+ if (y1 - y2 > 0)
+ {
+ g.fillRect(x * charWidth, y2, charWidth, y1 - y2);
+ }
+ else
+ {
+ g.fillRect(x * charWidth, y1, charWidth, y2 - y1);
+ }
+ }
+ // draw profile if available
+ if (renderProfile && aa.annotations[column].value != 0)
+ {
+
+ int profl[] = getProfileFor(aa, column);
+ // just try to draw the logo if profl is not null
+ if (profl != null)
+ {
+
+ float ht = normaliseProfile ? y-aa.graphHeight : y1;
+ double htn = normaliseProfile ? aa.graphHeight : (y2 - y1);// aa.graphHeight;
+ float wdth;
+ double ht2 = 0;
+ char[] dc;
+
+ /**
+ * profl.length == 52 indicates that the profile of a secondary
+ * structure conservation row was accesed.
+ * Therefore dc gets length 2, to have space for a basepair instead of
+ * just a single nucleotide
+ */
+ if (profl.length == 52)
+ {
+ dc = new char[2];
+ }
+ else
+ {
+ dc = new char[1];
+ }
+ LineMetrics lm=g.getFontMetrics(ofont).getLineMetrics("Q", g);
+ double scale = 1f/(normaliseProfile ? profl[1] : 100f);
+ float ofontHeight = 1f/lm.getAscent();// magnify to fill box
+ double scl=0.0;
+ for (int c = 2; profl != null && c < profl[0];)
+ {
+ dc[0] = (char) profl[c++];
+
+ if (aa.label.startsWith("StrucConsensus"))
+ {
+ dc[1] = (char) profl[c++];
+ }
+
+ wdth = charWidth;
+ wdth /= (float) fm.charsWidth(dc, 0, dc.length);
+
+ ht += scl;
+ {
+ // if (aa.annotations[column].value==0) {
+ // g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(wdth,
+ // (ht2=(aa.graphHeight*0.1/av.charHeight)))));
+ // ht = y2-(int)ht2;
+ // } else {
+ scl=((double)htn)*scale* ((double) profl[c++]);
+ lm = ofont.getLineMetrics(dc, 0, 1, g.getFontMetrics().getFontRenderContext());
+ g.setFont(ofont.deriveFont(AffineTransform.getScaleInstance(
+ wdth, scl/lm.getAscent())));
+ lm = g.getFontMetrics().getLineMetrics(dc, 0, 1, g);
+
+ // htn -=ht2;
+ // }
+ // ? );// try to get a
+ // colourscheme for the
+ // group(aa.groupRef.cs==null)
+ // ? av.textColour2 :
+ // cs.findColour(dc));
+ // System.out.println(dc[0]);
+ // Debug - render boxes around characters
+ // g.setColor(Color.red);
+ // g.drawRect(x*av.charWidth, (int)ht, av.charWidth, (int)(scl));
+ // g.setColor(profcolour.findColour(dc[0]).darker());
+ g.setColor(profcolour.findColour(dc[0]));
+ // (av.globalColourScheme!=null)
+ g.drawChars(dc, 0, dc.length, x * charWidth,
+ (int) (ht + (scl-lm.getDescent()-lm.getBaselineOffsets()[lm.getBaselineIndex()])));
+ // ht+=g.getFontMetrics().getAscent()-g.getFontMetrics().getDescent();
+ }
+ }
+ g.setFont(ofont);
+ }
+ }
+ x++;
+ }
+ if (aa.threshold != null)
+ {
+ g.setColor(aa.threshold.colour);
+ Graphics2D g2 = (Graphics2D) g;
+ g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE,
+ BasicStroke.JOIN_ROUND, 3f, new float[]
+ { 5f, 3f }, 0f));
+
+ y2 = (int) (y - ((aa.threshold.value - min) / range) * aa.graphHeight);
+ g.drawLine(0, y2, (eRes - sRes) * charWidth, y2);
+ g2.setStroke(new BasicStroke());
+ }
+ }
+ // used by overview window
+ public void drawGraph(Graphics g, AlignmentAnnotation aa, int width,
+ int y, int sRes, int eRes)
+ {
+ eRes = Math.min(eRes, aa.annotations.length);
+ g.setColor(Color.white);
+ g.fillRect(0, 0, width, y);
+ g.setColor(new Color(0, 0, 180));
+
+ int x = 0, height;
+
+ for (int j = sRes; j < eRes; j++)
+ {
+ if (aa.annotations[j] != null)
+ {
+ if (aa.annotations[j].colour == null)
+ g.setColor(Color.black);
+ else
+ g.setColor(aa.annotations[j].colour);
+
+ height = (int) ((aa.annotations[j].value / aa.graphMax) * y);
+ if (height > y)
+ {
+ height = y;
+ }
+
+ g.fillRect(x, y - height, charWidth, height);
+ }
+ x += charWidth;
+ }
+ }
+}
--- /dev/null
+package jalview.renderer;
+
+import java.awt.FontMetrics;
+import java.awt.Image;
+import java.awt.image.ImageObserver;
+
+public interface AwtRenderPanelI extends ImageObserver
+{
+ /**
+ * old image used when data is currently being calculated and cannot be rendered
+ */
+ Image getFadedImage();
+
+ /**
+ * FontMetrics to use for rendering into Panel
+ * @return
+ */
+ FontMetrics getFontMetrics();
+
+ /**
+ * width of image to render in panel
+ */
+ int getFadedImageWidth();
+
+}
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
{
ret = NONE;
}
+ else if (name.equalsIgnoreCase("Purine/Pyrimidine"))
+ {
+ ret = PURINEPYRIMIDINE;
+ }
+ // else if (name.equalsIgnoreCase("Covariation"))
+ // {
+ // ret = COVARIATION;
+ // }
return ret;
}
{
index = NUCLEOTIDE;
}
+ else if (cs instanceof PurinePyrimidineColourScheme)
+ {
+ index = PURINEPYRIMIDINE;
+ }
+ /*
+ * else if (cs instanceof CovariationColourScheme) { index = COVARIATION; }
+ */
else if (cs instanceof UserColourScheme)
{
if ((((UserColourScheme) cs).getName() != null)
break;
+ case PURINEPYRIMIDINE:
+ ret = "Purine/Pyrimidine";
+
+ break;
+
+ /*
+ * case COVARIATION: ret = "Covariation";
+ *
+ * break;
+ */
case USER_DEFINED:
ret = "User Defined";
break;
+ case PURINEPYRIMIDINE:
+ cs = new PurinePyrimidineColourScheme();
+
+ break;
+
+ // case COVARIATION:
+ // cs = new CovariationColourScheme(annotation);
+
+ // break;
+
case USER_DEFINED:
Color[] col = new Color[24];
for (int i = 0; i < 24; i++)
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.schemes;
+
+import java.awt.*;
+import java.util.Hashtable;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+/**
+ * Became RNAHelicesColour.java. Placeholder for true covariation color scheme
+ *
+ * @author Lauren Michelle Lui
+ * @version 2.5
+ */
+public class CovariationColourScheme extends ResidueColourScheme
+{
+ public Hashtable helixcolorhash = new Hashtable();
+
+ public Hashtable positionsToHelix = new Hashtable();
+
+ int numHelix = 0;
+
+ public AlignmentAnnotation annotation;
+
+ /**
+ * Creates a new CovariationColourScheme object.
+ */
+ public CovariationColourScheme(AlignmentAnnotation annotation)
+ {
+ this.annotation = annotation;
+
+ for (int x = 0; x < this.annotation._rnasecstr.length; x++)
+ {
+ // System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+ // this.annotation._rnasecstr[x].getBegin());
+ // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+ // pairs.put(this.annotation._rnasecstr[x].getBegin(),
+ // this.annotation._rnasecstr[x].getEnd());
+
+ positionsToHelix.put(this.annotation._rnasecstr[x].getBegin(),
+ this.annotation._rnasecstr[x].getFeatureGroup());
+ positionsToHelix.put(this.annotation._rnasecstr[x].getEnd(),
+ this.annotation._rnasecstr[x].getFeatureGroup());
+
+ if (Integer.parseInt(this.annotation._rnasecstr[x].getFeatureGroup()) > numHelix)
+ {
+ numHelix = Integer.parseInt(this.annotation._rnasecstr[x]
+ .getFeatureGroup());
+ }
+
+ }
+
+ for (int j = 0; j <= numHelix; j++)
+ {
+ helixcolorhash.put(Integer.toString(j), jalview.util.ColorUtils
+ .generateRandomColor(Color.white));
+ }
+
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public Color findColour(char c)
+ {
+ // System.out.println("called"); log.debug
+ // Generate a random pastel color
+
+ return ResidueProperties.purinepyrimidine[ResidueProperties.purinepyrimidineIndex[c]];// jalview.util.ColorUtils.generateRandomColor(Color.white);
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n
+ * DOCUMENT ME!
+ * @param j
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public Color findColour(char c, int j)
+ {
+ Color currentColour = Color.white;
+ String currentHelix = null;
+ // System.out.println(c + " " + j);
+ currentHelix = (String) positionsToHelix.get(j);
+ // System.out.println(positionsToHelix.get(j));
+
+ if (currentHelix != null)
+ {
+ currentColour = (Color) helixcolorhash.get(currentHelix);
+ }
+
+ // System.out.println(c + " " + j + " helix " + currentHelix + " " +
+ // currentColour);
+ return currentColour;
+ }
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.schemes;
+
+import java.awt.*;
+
+/**
+ * Class is based off of NucleotideColourScheme
+ *
+ * @author Lauren Michelle Lui
+ */
+public class PurinePyrimidineColourScheme extends ResidueColourScheme
+{
+ /**
+ * Creates a new PurinePyrimidineColourScheme object.
+ */
+ public PurinePyrimidineColourScheme()
+ {
+ super(ResidueProperties.purinepyrimidine, 0);
+ }
+
+ /**
+ * Finds the corresponding color for the type of character inputed
+ *
+ * @param c
+ * Character in sequence
+ *
+ * @return Color from purinepyrimidineIndex in
+ * jalview.schemes.ResidueProperties
+ */
+ public Color findColour(char c)
+ {
+ return colors[ResidueProperties.purinepyrimidineIndex[c]];
+ }
+
+ /**
+ * Returns color based on conservation
+ *
+ * @param c
+ * Character in sequence
+ * @param j
+ * Threshold
+ *
+ * @return Color in RGB
+ */
+ public Color findColour(char c, int j)
+ {
+ Color currentColour;
+ if ((threshold == 0) || aboveThreshold(c, j))
+ {
+ try
+ {
+ currentColour = colors[ResidueProperties.purinepyrimidineIndex[c]];
+ } catch (Exception ex)
+ {
+ return Color.white;
+ }
+ }
+ else
+ {
+ return Color.white;
+ }
+
+ if (conservationColouring)
+ {
+ currentColour = applyConservation(currentColour, j);
+ }
+
+ return currentColour;
+ }
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.schemes;
+
+import java.awt.*;
+import java.util.Hashtable;
+
+import jalview.datamodel.AlignmentAnnotation;
+
+/**
+ * Looks at the information computed from an RNA Stockholm format file on the
+ * secondary structure of the alignment. Extracts the information on the
+ * positions of the helices present and assigns colors.
+ *
+ * @author Lauren Michelle Lui
+ * @version 2.5
+ */
+public class RNAHelicesColour extends ResidueColourScheme
+{
+
+ /**
+ * Stores random colors generated for the number of helices
+ */
+ public Hashtable helixcolorhash = new Hashtable();
+
+ /**
+ * Maps sequence positions to the RNA helix they belong to. Key: position,
+ * Value: helix
+ */
+ public Hashtable positionsToHelix = new Hashtable();
+
+ /**
+ * Number of helices in the RNA secondary structure
+ */
+ int numHelix = 0;
+
+ public AlignmentAnnotation annotation;
+
+ /**
+ * Creates a new RNAHelicesColour object.
+ */
+ public RNAHelicesColour(AlignmentAnnotation annotation)
+ {
+ this.annotation = annotation;
+ refresh();
+ }
+
+ private long lastrefresh = -1;
+
+ public void refresh()
+ {
+ if (lastrefresh != annotation._rnasecstr.hashCode() && annotation.isValidStruc())
+ {
+ annotation.getRNAStruc();
+ lastrefresh = annotation._rnasecstr.hashCode();
+ numHelix = 0;
+ positionsToHelix = new Hashtable();
+
+ // Figure out number of helices
+ // Length of rnasecstr is the number of pairs of positions that base pair
+ // with each other in the secondary structure
+ for (int x = 0; x < this.annotation._rnasecstr.length; x++)
+ {
+
+ /*
+ * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+ * this.annotation._rnasecstr[x].getBegin());
+ */
+ // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+
+ positionsToHelix.put(this.annotation._rnasecstr[x].getBegin(),
+ this.annotation._rnasecstr[x].getFeatureGroup());
+ positionsToHelix.put(this.annotation._rnasecstr[x].getEnd(),
+ this.annotation._rnasecstr[x].getFeatureGroup());
+
+ if (Integer.parseInt(this.annotation._rnasecstr[x]
+ .getFeatureGroup()) > numHelix)
+ {
+ numHelix = Integer.parseInt(this.annotation._rnasecstr[x]
+ .getFeatureGroup());
+ }
+
+ }
+
+ // Generate random colors and store
+ for (int j = 0; j <= numHelix; j++)
+ {
+ if (!helixcolorhash.containsKey(Integer.toString(j)))
+ {
+ helixcolorhash.put(Integer.toString(j),
+ jalview.util.ColorUtils.generateRandomColor(Color.white));
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns default color base on purinepyrimidineIndex in
+ * jalview.schemes.ResidueProperties (Allows coloring in sequence logo)
+ *
+ * @param c
+ * Character in sequence
+ *
+ * @return color in RGB
+ */
+ public Color findColour(char c)
+ {
+ return ResidueProperties.purinepyrimidine[ResidueProperties.purinepyrimidineIndex[c]];
+ // random colors for all positions
+ // jalview.util.ColorUtils.generateRandomColor(Color.white); If you want
+ }
+
+ /**
+ * Returns color based on helices
+ *
+ * @param c
+ * Character in sequence
+ * @param j
+ * Threshold
+ *
+ * @return Color in RGB
+ */
+ public Color findColour(char c, int j)
+ {
+ refresh();
+ Color currentColour = Color.white;
+ String currentHelix = null;
+ currentHelix = (String) positionsToHelix.get(j);
+
+ if (currentHelix != null)
+ {
+ currentColour = (Color) helixcolorhash.get(currentHelix);
+ }
+
+ // System.out.println(c + " " + j + " helix " + currentHelix + " " +
+ // currentColour);
+ return currentColour;
+ }
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.schemes;
+
+import java.util.*;
+import java.awt.event.*;
+
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.*;
+import jalview.schemes.*;
+
+/**
+ * Helps generate the colors for RNA secondary structure. Future: add option to
+ * change colors based on covariation.
+ *
+ * @author Lauren Michelle Lui
+ *
+ */
+public class RNAHelicesColourChooser
+{
+
+ AlignViewportI av;
+
+ AlignmentViewPanel ap;
+
+ ColourSchemeI oldcs;
+
+ Hashtable oldgroupColours;
+
+ jalview.datamodel.AlignmentAnnotation currentAnnotation;
+
+ boolean adjusting = false;
+
+ public RNAHelicesColourChooser(AlignViewportI av, final AlignmentViewPanel ap)
+ {
+ oldcs = av.getGlobalColourScheme();
+ if (av.getAlignment().getGroups() != null)
+ {
+ oldgroupColours = new Hashtable();
+ Vector allGroups = ap.getAlignment().getGroups();
+ SequenceGroup sg;
+ for (int g = 0; g < allGroups.size(); g++)
+ {
+ sg = (SequenceGroup) allGroups.get(g);
+ if (sg.cs != null)
+ {
+ oldgroupColours.put(sg, sg.cs);
+ }
+ }
+ }
+ this.av = av;
+ this.ap = ap;
+
+ if (oldcs instanceof RNAHelicesColour)
+ {
+ RNAHelicesColour rhc = (RNAHelicesColour) oldcs;
+
+ }
+
+ adjusting = true;
+ Vector list = new Vector();
+ int index = 1;
+ for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
+ {
+ String label = av.getAlignment().getAlignmentAnnotation()[i].label;
+ if (!list.contains(label))
+ list.addElement(label);
+ else
+ list.addElement(label + "_" + (index++));
+ }
+
+ adjusting = false;
+
+ changeColour();
+
+ }
+
+ void changeColour()
+ {
+ // Check if combobox is still adjusting
+ if (adjusting)
+ {
+ return;
+ }
+
+ currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
+
+ RNAHelicesColour rhc = null;
+
+ rhc = new RNAHelicesColour(currentAnnotation);
+
+ av.setGlobalColourScheme(rhc);
+
+ if (av.getAlignment().getGroups() != null)
+ {
+ Vector allGroups = ap.getAlignment().getGroups();
+ SequenceGroup sg;
+ for (int g = 0; g < allGroups.size(); g++)
+ {
+ sg = (SequenceGroup) allGroups.get(g);
+
+ if (sg.cs == null)
+ {
+ continue;
+ }
+
+ sg.cs = new RNAHelicesColour(currentAnnotation);
+
+ }
+ }
+
+ ap.paintAlignment(false);
+ }
+
+ void reset()
+ {
+ av.setGlobalColourScheme(oldcs);
+ if (av.getAlignment().getGroups() != null)
+ {
+ Vector allGroups = ap.getAlignment().getGroups();
+ SequenceGroup sg;
+ for (int g = 0; g < allGroups.size(); g++)
+ {
+ sg = (SequenceGroup) allGroups.get(g);
+ sg.cs = (ColourSchemeI) oldgroupColours.get(sg);
+ }
+ }
+ }
+
+ public void annotations_actionPerformed(ActionEvent e)
+ {
+ changeColour();
+ }
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
public static final int[] nucleotideIndex;
+ public static final int[] purinepyrimidineIndex;
+
public static final Hashtable aa3Hash = new Hashtable();
public static final Hashtable aa2Triplet = new Hashtable();
nucleotideName.put("y", "Unknown Pyrimidine");
nucleotideName.put("N", "Unknown");
nucleotideName.put("n", "Unknown");
+ nucleotideName.put("W", "Weak nucleotide (A or T)");
+ nucleotideName.put("w", "Weak nucleotide (A or T)");
+ nucleotideName.put("S", "Strong nucleotide (G or C)");
+ nucleotideName.put("s", "Strong nucleotide (G or C)");
+ nucleotideName.put("M", "Amino (A or C)");
+ nucleotideName.put("m", "Amino (A or C)");
+ nucleotideName.put("K", "Keto (G or T)");
+ nucleotideName.put("k", "Keto (G or T)");
+ nucleotideName.put("B", "Not A (G or C or T)");
+ nucleotideName.put("b", "Not A (G or C or T)");
+ nucleotideName.put("H", "Not G (A or C or T)");
+ nucleotideName.put("h", "Not G (A or C or T)");
+ nucleotideName.put("D", "Not C (A or G or T)");
+ nucleotideName.put("d", "Not C (A or G or T)");
+ nucleotideName.put("V", "Not T (A or G or C");
+ nucleotideName.put("v", "Not T (A or G or C");
+
+ }
+
+ static
+ {
+ purinepyrimidineIndex = new int[255];
+ for (int i = 0; i < 255; i++)
+ {
+ purinepyrimidineIndex[i] = 3; // non-nucleotide symbols are all non-gap
+ // gaps.
+ }
+
+ purinepyrimidineIndex['A'] = 0;
+ purinepyrimidineIndex['a'] = 0;
+ purinepyrimidineIndex['C'] = 1;
+ purinepyrimidineIndex['c'] = 1;
+ purinepyrimidineIndex['G'] = 0;
+ purinepyrimidineIndex['g'] = 0;
+ purinepyrimidineIndex['T'] = 1;
+ purinepyrimidineIndex['t'] = 1;
+ purinepyrimidineIndex['U'] = 1;
+ purinepyrimidineIndex['u'] = 1;
+ purinepyrimidineIndex['I'] = 2;
+ purinepyrimidineIndex['i'] = 2;
+ purinepyrimidineIndex['X'] = 2;
+ purinepyrimidineIndex['x'] = 2;
+ purinepyrimidineIndex['R'] = 0;
+ purinepyrimidineIndex['r'] = 0;
+ purinepyrimidineIndex['Y'] = 1;
+ purinepyrimidineIndex['y'] = 1;
+ purinepyrimidineIndex['N'] = 2;
+ purinepyrimidineIndex['n'] = 2;
}
static
new Color(235, 65, 60), // G
new Color(60, 136, 238), // T
new Color(60, 136, 238), // U
- Color.white, // I
- Color.white, // X
+ Color.white, // I (inosine)
+ Color.white, // X (xanthine)
Color.white, // R
Color.white, // Y
Color.white, // N
Color.white, // Gap
};
+ // Added for PurinePyrimidineColourScheme
+ public static final Color[] purinepyrimidine =
+ { new Color(255, 131, 250), // A, G, R purines purplish/orchid
+ new Color(64, 224, 208), // C,U, T, Y pyrimidines turquoise
+ Color.white, // all other nucleotides
+ Color.white // Gap
+ };
+
// Zappo
public static final Color[] zappo =
{ Color.pink, // A
return ss.toString();
}
+ /**
+ * Used by getRNASecStrucState
+ *
+ */
+ public static Hashtable toRNAssState;
+ static
+ {
+ toRNAssState = new Hashtable();
+ toRNAssState.put(")", "S");
+ toRNAssState.put("(", "S");
+ }
+
+ /**
+ * translate to RNA secondary structure representation
+ *
+ * @param ssstring
+ * @return ssstring as a RNA-state secondary structure assignment.
+ */
+ public static String getRNASecStrucState(String ssstring)
+ {
+ if (ssstring == null)
+ {
+ return null;
+ }
+ StringBuffer ss = new StringBuffer();
+ for (int i = 0; i < ssstring.length(); i++)
+ {
+ String ssc = ssstring.substring(i, i + 1);
+ if (toRNAssState.containsKey(ssc))
+ {
+ ss.append((String) toRNAssState.get(ssc));
+ }
+ else
+ {
+ ss.append(" ");
+ }
+ }
+ return ss.toString();
+ }
+
// main method generates perl representation of residue property hash
// / cut here
public static void main(String[] args)
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.structure;
+
+import jalview.datamodel.*;
+
+public interface SecondaryStructureListener
+{
+ public void mouseOverSequence(SequenceI sequence, int index);
+ public void mouseOverStructure(int atomIndex, String strInfo);
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
((VamsasListener) listeners.elementAt(i)).mouseOver(seq,
indexpos, source);
}
+ else if(listeners.elementAt(i) instanceof SecondaryStructureListener){
+ ((SecondaryStructureListener) listeners.elementAt(i)).mouseOverSequence(seq,indexpos);
+ }
}
}
}
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * author: Lauren Michelle Lui
+ */
+
+package jalview.util;
+
+import java.awt.Color;
+import java.util.Random;
+
+public class ColorUtils
+{
+
+ /**
+ * Generates a random color, will mix with input color. Code taken from
+ * http://stackoverflow
+ * .com/questions/43044/algorithm-to-randomly-generate-an-aesthetically
+ * -pleasing-color-palette
+ *
+ * @param mix
+ * @return Random color in RGB
+ */
+ public static final Color generateRandomColor(Color mix)
+ {
+ Random random = new Random();
+ int red = random.nextInt(256);
+ int green = random.nextInt(256);
+ int blue = random.nextInt(256);
+
+ // mix the color
+ if (mix != null)
+ {
+ red = (red + mix.getRed()) / 2;
+ green = (green + mix.getGreen()) / 2;
+ blue = (blue + mix.getBlue()) / 2;
+ }
+
+ Color color = new Color(red, green, blue);
+ return color;
+
+ }
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.viewmodel;
+
+import jalview.analysis.Conservation;
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.schemes.ClustalxColourScheme;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
+import jalview.workers.AlignCalcManager;
+import jalview.workers.ConsensusThread;
+import jalview.workers.ConservationThread;
+import jalview.workers.StrucConsensusThread;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+/**
+ * base class holding visualization and analysis attributes and common logic for an active alignment view displayed in the GUI
+ * @author jimp
+ *
+ */
+public abstract class AlignmentViewport implements AlignViewportI
+{
+ /**
+ * alignment displayed in the viewport. Please use get/setter
+ */
+ protected AlignmentI alignment;
+
+ protected String sequenceSetID;
+
+ /**
+ * probably unused indicator that view is of a dataset rather than an alignment
+ */
+ protected boolean isDataset = false;
+
+ private Hashtable hiddenRepSequences;
+
+ protected ColumnSelection colSel = new ColumnSelection();
+
+
+ public boolean autoCalculateConsensus = true;
+
+ protected boolean autoCalculateStrucConsensus = true;
+
+ protected boolean ignoreGapsInConsensusCalculation = false;
+
+
+ protected ColourSchemeI globalColourScheme = null;
+
+
+ public void setGlobalColourScheme(ColourSchemeI cs)
+ {
+ globalColourScheme = cs;
+ }
+
+ public ColourSchemeI getGlobalColourScheme()
+ {
+ return globalColourScheme;
+ }
+
+
+ protected AlignmentAnnotation consensus;
+
+ protected AlignmentAnnotation strucConsensus;
+
+ protected AlignmentAnnotation conservation;
+
+ protected AlignmentAnnotation quality;
+
+ protected AlignmentAnnotation[] groupConsensus;
+
+ protected AlignmentAnnotation[] groupConservation;
+
+ /**
+ * results of alignment consensus analysis for visible portion of view
+ */
+ protected Hashtable[] hconsensus=null;
+
+ /**
+ * results of secondary structure base pair consensus for visible portion of view
+ */
+ protected Hashtable[] hStrucConsensus=null;
+
+ /**
+ * percentage gaps allowed in a column before all amino acid properties should be considered unconserved
+ */
+ int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
+
+
+ public int getConsPercGaps()
+ {
+ return ConsPercGaps;
+ }
+ @Override
+ public void setSequenceConsensusHash(Hashtable[] hconsensus)
+ {
+ this.hconsensus=hconsensus;
+
+ }
+
+ @Override
+ public Hashtable[] getSequenceConsensusHash()
+ {
+ return hconsensus;
+ }
+
+ @Override
+ public Hashtable[] getRnaStructureConsensusHash()
+ {
+ return hStrucConsensus;
+ }
+ @Override
+ public void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus)
+ {
+ this.hStrucConsensus=hStrucConsensus;
+
+ }
+ @Override
+ public AlignmentAnnotation getAlignmentQualityAnnot()
+ {
+ return quality;
+ }
+
+ @Override
+ public AlignmentAnnotation getAlignmentConservationAnnotation()
+ {
+ return conservation;
+ }
+ @Override
+ public AlignmentAnnotation getAlignmentConsensusAnnotation()
+ {
+ return consensus;
+ }
+ @Override
+ public AlignmentAnnotation getAlignmentStrucConsensusAnnotation()
+ {
+ return strucConsensus;
+ }
+
+ protected AlignCalcManagerI calculator=new AlignCalcManager();
+
+ /**
+ * trigger update of conservation annotation
+ */
+ public void updateConservation(final AlignmentViewPanel ap)
+ {
+ // see note in mantis : issue number 8585
+ if (alignment.isNucleotide() || conservation == null
+ || !autoCalculateConsensus)
+ {
+ return;
+ }
+ if (!calculator.startRegisteredWorkersOfClass(jalview.workers.ConservationThread.class))
+ {
+ calculator.registerWorker(new jalview.workers.ConservationThread(this, ap));
+ }
+ }
+
+ /**
+ * trigger update of consensus annotation
+ */
+ public void updateConsensus(final AlignmentViewPanel ap)
+ {
+ // see note in mantis : issue number 8585
+ if (consensus == null || !autoCalculateConsensus)
+ {
+ return;
+ }
+ if (!calculator.startRegisteredWorkersOfClass(ConsensusThread.class))
+ {
+ calculator.registerWorker(new ConsensusThread(this, ap));
+ }
+ }
+
+ // --------START Structure Conservation
+ public void updateStrucConsensus(final AlignmentViewPanel ap)
+ {
+ if (autoCalculateStrucConsensus && strucConsensus==null && alignment.isNucleotide() && alignment.hasRNAStructure())
+ {
+
+ }
+
+ // see note in mantis : issue number 8585
+ if (strucConsensus == null || !autoCalculateStrucConsensus)
+ {
+ return;
+ }
+ if (!calculator.startRegisteredWorkersOfClass(StrucConsensusThread.class))
+ {
+ calculator.registerWorker(new StrucConsensusThread(this,ap));
+ }
+ }
+
+ public boolean isCalcInProgress()
+ {
+ return calculator.isWorking();
+ }
+
+ public boolean isCalculationInProgress(
+ AlignmentAnnotation alignmentAnnotation)
+ {
+ if (!alignmentAnnotation.autoCalculated)
+ return false;
+ if (calculator.workingInvolvedWith(alignmentAnnotation))
+ {
+// System.err.println("grey out ("+alignmentAnnotation.label+")");
+ return true;
+ }
+ return false;
+ }
+ @Override
+ public boolean isClosed()
+ {
+ // TODO: check that this isClosed is only true after panel is closed, not before it is fully constructed.
+ return alignment==null;
+ }
+
+ @Override
+ public AlignCalcManagerI getCalcManager()
+ {
+ return calculator;
+ }
+
+ /**
+ * should conservation rows be shown for groups
+ */
+ protected boolean showGroupConservation = false;
+
+ /**
+ * should consensus rows be shown for groups
+ */
+ protected boolean showGroupConsensus = false;
+
+ /**
+ * should consensus profile be rendered by default
+ */
+ protected boolean showSequenceLogo = false;
+ /**
+ * should consensus profile be rendered normalised to row height
+ */
+ protected boolean normaliseSequenceLogo = false;
+ /**
+ * should consensus histograms be rendered by default
+ */
+ protected boolean showConsensusHistogram = true;
+
+ /**
+ * @return the showConsensusProfile
+ */
+ public boolean isShowSequenceLogo()
+ {
+ return showSequenceLogo;
+ }
+
+ /**
+ * @param showSequenceLogo
+ * the new value
+ */
+ public void setShowSequenceLogo(boolean showSequenceLogo)
+ {
+ if (showSequenceLogo != this.showSequenceLogo)
+ {
+ // TODO: decouple settings setting from calculation when refactoring
+ // annotation update method from alignframe to viewport
+ this.showSequenceLogo = showSequenceLogo;
+ calculator.updateAnnotationFor(ConsensusThread.class);
+ calculator.updateAnnotationFor(StrucConsensusThread.class);
+ }
+ this.showSequenceLogo = showSequenceLogo;
+ }
+
+ /**
+ * @param showConsensusHistogram
+ * the showConsensusHistogram to set
+ */
+ public void setShowConsensusHistogram(boolean showConsensusHistogram)
+ {
+ this.showConsensusHistogram = showConsensusHistogram;
+ }
+
+ /**
+ * @return the showGroupConservation
+ */
+ public boolean isShowGroupConservation()
+ {
+ return showGroupConservation;
+ }
+
+ /**
+ * @param showGroupConservation
+ * the showGroupConservation to set
+ */
+ public void setShowGroupConservation(boolean showGroupConservation)
+ {
+ this.showGroupConservation = showGroupConservation;
+ }
+
+ /**
+ * @return the showGroupConsensus
+ */
+ public boolean isShowGroupConsensus()
+ {
+ return showGroupConsensus;
+ }
+
+ /**
+ * @param showGroupConsensus
+ * the showGroupConsensus to set
+ */
+ public void setShowGroupConsensus(boolean showGroupConsensus)
+ {
+ this.showGroupConsensus = showGroupConsensus;
+ }
+
+ /**
+ *
+ * @return flag to indicate if the consensus histogram should be rendered by
+ * default
+ */
+ public boolean isShowConsensusHistogram()
+ {
+ return this.showConsensusHistogram;
+ }
+
+ /**
+ * show non-conserved residues only
+ */
+ protected boolean showUnconserved = false;
+
+
+ /**
+ * when set, updateAlignment will always ensure sequences are of equal length
+ */
+ private boolean padGaps = false;
+
+ /**
+ * when set, alignment should be reordered according to a newly opened tree
+ */
+ public boolean sortByTree = false;
+
+ public boolean getShowUnconserved()
+ {
+ return showUnconserved;
+ }
+
+ public void setShowUnconserved(boolean showunconserved)
+ {
+ showUnconserved = showunconserved;
+ }
+
+ /**
+ * @param showNonconserved
+ * the showUnconserved to set
+ */
+ public void setShowunconserved(boolean displayNonconserved)
+ {
+ this.showUnconserved = displayNonconserved;
+ }
+
+ /**
+ *
+ *
+ * @return null or the currently selected sequence region
+ */
+ public SequenceGroup getSelectionGroup()
+ {
+ return selectionGroup;
+ }
+
+ /**
+ * Set the selection group for this window.
+ *
+ * @param sg
+ * - group holding references to sequences in this alignment view
+ *
+ */
+ public void setSelectionGroup(SequenceGroup sg)
+ {
+ selectionGroup = sg;
+ }
+
+ public void setHiddenColumns(ColumnSelection colsel)
+ {
+ this.colSel = colsel;
+ if (colSel.getHiddenColumns() != null)
+ {
+ hasHiddenColumns = true;
+ }
+ }
+
+ public ColumnSelection getColumnSelection()
+ {
+ return colSel;
+ }
+ public void setColumnSelection(ColumnSelection colSel)
+ {
+ this.colSel=colSel;
+ }
+ public Hashtable getHiddenRepSequences()
+ {
+ return hiddenRepSequences;
+ }
+ public void setHiddenRepSequences(Hashtable hiddenRepSequences)
+ {
+ this.hiddenRepSequences = hiddenRepSequences;
+ }
+ protected boolean hasHiddenColumns = false;
+
+ public void updateHiddenColumns()
+ {
+ hasHiddenColumns = colSel.getHiddenColumns() != null;
+ }
+
+ protected boolean hasHiddenRows = false;
+
+ public boolean hasHiddenRows() {
+ return hasHiddenRows;
+ }
+
+ protected SequenceGroup selectionGroup;
+
+ public void setSequenceSetId(String newid)
+ {
+ if (sequenceSetID!=null)
+ {
+ System.err.println("Warning - overwriting a sequenceSetId for a viewport!");
+ }
+ sequenceSetID=new String(newid);
+ }
+ public String getSequenceSetId()
+ {
+ if (sequenceSetID == null)
+ {
+ sequenceSetID = alignment.hashCode() + "";
+ }
+
+ return sequenceSetID;
+ }
+ /**
+ * unique viewId for synchronizing state (e.g. with stored Jalview Project)
+ *
+ */
+ protected String viewId = null;
+
+ public String getViewId()
+ {
+ if (viewId == null)
+ {
+ viewId = this.getSequenceSetId() + "." + this.hashCode() + "";
+ }
+ return viewId;
+ }
+ public void setIgnoreGapsConsensus(boolean b, AlignmentViewPanel ap)
+ {
+ ignoreGapsInConsensusCalculation = b;
+ if (ap!=null) {updateConsensus(ap);
+ if (globalColourScheme != null)
+ {
+ globalColourScheme.setThreshold(globalColourScheme.getThreshold(),
+ ignoreGapsInConsensusCalculation);
+ }}
+
+ }
+ private long sgrouphash = -1, colselhash = -1;
+
+ /**
+ * checks current SelectionGroup against record of last hash value, and
+ * updates record.
+ *
+ * @param b
+ * update the record of last hash value
+ *
+ * @return true if SelectionGroup changed since last call (when b is true)
+ */
+ public boolean isSelectionGroupChanged(boolean b)
+ {
+ int hc = (selectionGroup == null || selectionGroup.getSize() == 0) ? -1
+ : selectionGroup.hashCode();
+ if (hc != -1 && hc != sgrouphash)
+ {
+ if (b)
+ {
+ sgrouphash = hc;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * checks current colsel against record of last hash value, and optionally
+ * updates record.
+ *
+ * @param b
+ * update the record of last hash value
+ * @return true if colsel changed since last call (when b is true)
+ */
+ public boolean isColSelChanged(boolean b)
+ {
+ int hc = (colSel == null || colSel.size() == 0) ? -1 : colSel
+ .hashCode();
+ if (hc != -1 && hc != colselhash)
+ {
+ if (b)
+ {
+ colselhash = hc;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public boolean getIgnoreGapsConsensus()
+ {
+ return ignoreGapsInConsensusCalculation;
+ }
+
+ /// property change stuff
+
+ // JBPNote Prolly only need this in the applet version.
+ private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
+ this);
+
+ protected boolean showConservation = true;
+
+ protected boolean showQuality = true;
+
+ protected boolean showConsensus = true;
+
+
+ /**
+ * Property change listener for changes in alignment
+ *
+ * @param listener
+ * DOCUMENT ME!
+ */
+ public void addPropertyChangeListener(
+ java.beans.PropertyChangeListener listener)
+ {
+ changeSupport.addPropertyChangeListener(listener);
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param listener
+ * DOCUMENT ME!
+ */
+ public void removePropertyChangeListener(
+ java.beans.PropertyChangeListener listener)
+ {
+ changeSupport.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * Property change listener for changes in alignment
+ *
+ * @param prop
+ * DOCUMENT ME!
+ * @param oldvalue
+ * DOCUMENT ME!
+ * @param newvalue
+ * DOCUMENT ME!
+ */
+ public void firePropertyChange(String prop, Object oldvalue,
+ Object newvalue)
+ {
+ changeSupport.firePropertyChange(prop, oldvalue, newvalue);
+ }
+
+ // common hide/show column stuff
+
+
+ public void hideSelectedColumns()
+ {
+ if (colSel.size() < 1)
+ {
+ return;
+ }
+
+ colSel.hideSelectedColumns();
+ setSelectionGroup(null);
+
+ hasHiddenColumns = true;
+ }
+
+ public void hideColumns(int start, int end)
+ {
+ if (start == end)
+ {
+ colSel.hideColumns(start);
+ }
+ else
+ {
+ colSel.hideColumns(start, end);
+ }
+
+ hasHiddenColumns = true;
+ }
+
+ public void showColumn(int col)
+ {
+ colSel.revealHiddenColumns(col);
+ if (colSel.getHiddenColumns() == null)
+ {
+ hasHiddenColumns = false;
+ }
+ }
+
+ public void showAllHiddenColumns()
+ {
+ colSel.revealAllHiddenColumns();
+ hasHiddenColumns = false;
+ }
+
+
+ // common hide/show seq stuff
+ public void showAllHiddenSeqs()
+ {
+ if (alignment.getHiddenSequences().getSize() > 0)
+ {
+ if (selectionGroup == null)
+ {
+ selectionGroup = new SequenceGroup();
+ selectionGroup.setEndRes(alignment.getWidth() - 1);
+ }
+ Vector tmp = alignment.getHiddenSequences().showAll(
+ hiddenRepSequences);
+ for (int t = 0; t < tmp.size(); t++)
+ {
+ selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
+ }
+
+ hasHiddenRows = false;
+ hiddenRepSequences = null;
+
+ firePropertyChange("alignment", null, alignment.getSequences());
+ // used to set hasHiddenRows/hiddenRepSequences here, after the property changed event
+ sendSelection();
+ }
+ }
+
+ public void showSequence(int index)
+ {
+ Vector tmp = alignment.getHiddenSequences().showSequence(index,
+ hiddenRepSequences);
+ if (tmp.size() > 0)
+ {
+ if (selectionGroup == null)
+ {
+ selectionGroup = new SequenceGroup();
+ selectionGroup.setEndRes(alignment.getWidth() - 1);
+ }
+
+ for (int t = 0; t < tmp.size(); t++)
+ {
+ selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
+ }
+ // JBPNote: refactor: only update flag if we modified visiblity (used to do this regardless)
+ if (alignment.getHiddenSequences().getSize() < 1)
+ {
+ hasHiddenRows = false;
+ }
+ firePropertyChange("alignment", null, alignment.getSequences());
+ sendSelection();
+ }
+ }
+
+
+
+ public void hideAllSelectedSeqs()
+ {
+ if (selectionGroup == null || selectionGroup.getSize() < 1)
+ {
+ return;
+ }
+
+ SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
+
+ hideSequence(seqs);
+
+ setSelectionGroup(null);
+ }
+
+
+ public void hideSequence(SequenceI[] seq)
+ {
+ if (seq != null)
+ {
+ for (int i = 0; i < seq.length; i++)
+ {
+ alignment.getHiddenSequences().hideSequence(seq[i]);
+ }
+ hasHiddenRows = true;
+ firePropertyChange("alignment", null, alignment.getSequences());
+ }
+ }
+
+ public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)
+ {
+ int sSize = sg.getSize();
+ if (sSize < 2)
+ {
+ return;
+ }
+
+ if (hiddenRepSequences == null)
+ {
+ hiddenRepSequences = new Hashtable();
+ }
+
+ hiddenRepSequences.put(repSequence, sg);
+
+ // Hide all sequences except the repSequence
+ SequenceI[] seqs = new SequenceI[sSize - 1];
+ int index = 0;
+ for (int i = 0; i < sSize; i++)
+ {
+ if (sg.getSequenceAt(i) != repSequence)
+ {
+ if (index == sSize - 1)
+ {
+ return;
+ }
+
+ seqs[index++] = sg.getSequenceAt(i);
+ }
+ }
+ sg.setSeqrep(repSequence); // note: not done in 2.7applet
+ sg.setHidereps(true); // note: not done in 2.7applet
+ hideSequence(seqs);
+
+ }
+
+ public boolean isHiddenRepSequence(SequenceI seq)
+ {
+ return hiddenRepSequences != null
+ && hiddenRepSequences.containsKey(seq);
+ }
+ public SequenceGroup getRepresentedSequences(SequenceI seq)
+ {
+ return (SequenceGroup) (hiddenRepSequences == null ? null : hiddenRepSequences.get(seq));
+ }
+
+ public int adjustForHiddenSeqs(int alignmentIndex)
+ {
+ return alignment.getHiddenSequences().adjustForHiddenSeqs(
+ alignmentIndex);
+ }
+
+ // Selection manipulation
+ /**
+ * broadcast selection to any interested parties
+ */
+ public abstract void sendSelection();
+
+
+ public void invertColumnSelection()
+ {
+ colSel.invertColumnSelection(0, alignment.getWidth());
+ }
+
+
+ /**
+ * This method returns an array of new SequenceI objects derived from the
+ * whole alignment or just the current selection with start and end points
+ * adjusted
+ *
+ * @note if you need references to the actual SequenceI objects in the
+ * alignment or currently selected then use getSequenceSelection()
+ * @return selection as new sequenceI objects
+ */
+ public SequenceI[] getSelectionAsNewSequence()
+ {
+ SequenceI[] sequences;
+ // JBPNote: Need to test jalviewLite.getSelectedSequencesAsAlignmentFrom - this was the only caller in the applet for this method
+ // JBPNote: in applet, this method returned references to the alignment sequences, and it did not honour the presence/absence of annotation attached to the alignment (probably!)
+ if (selectionGroup == null)
+ {
+ sequences = alignment.getSequencesArray();
+ AlignmentAnnotation[] annots = alignment.getAlignmentAnnotation();
+ for (int i = 0; i < sequences.length; i++)
+ {
+ sequences[i] = new Sequence(sequences[i], annots); // construct new
+ // sequence with
+ // subset of visible
+ // annotation
+ }
+ }
+ else
+ {
+ sequences = selectionGroup.getSelectionAsNewSequences(alignment);
+ }
+
+ return sequences;
+ }
+
+
+ /**
+ * get the currently selected sequence objects or all the sequences in the
+ * alignment.
+ *
+ * @return array of references to sequence objects
+ */
+ public SequenceI[] getSequenceSelection()
+ {
+ SequenceI[] sequences = null;
+ if (selectionGroup != null)
+ {
+ sequences = selectionGroup.getSequencesInOrder(alignment);
+ }
+ if (sequences == null)
+ {
+ sequences = alignment.getSequencesArray();
+ }
+ return sequences;
+ }
+
+
+ /**
+ * This method returns the visible alignment as text, as seen on the GUI, ie
+ * if columns are hidden they will not be returned in the result. Use this for
+ * calculating trees, PCA, redundancy etc on views which contain hidden
+ * columns.
+ *
+ * @return String[]
+ */
+ public jalview.datamodel.CigarArray getViewAsCigars(
+ boolean selectedRegionOnly)
+ {
+ return new jalview.datamodel.CigarArray(alignment,
+ (hasHiddenColumns ? colSel : null),
+ (selectedRegionOnly ? selectionGroup : null));
+ }
+
+ /**
+ * return a compact representation of the current alignment selection to pass
+ * to an analysis function
+ *
+ * @param selectedOnly
+ * boolean true to just return the selected view
+ * @return AlignmentView
+ */
+ public jalview.datamodel.AlignmentView getAlignmentView(
+ boolean selectedOnly)
+ {
+ return getAlignmentView(selectedOnly, false);
+ }
+
+ /**
+ * return a compact representation of the current alignment selection to pass
+ * to an analysis function
+ *
+ * @param selectedOnly
+ * boolean true to just return the selected view
+ * @param markGroups
+ * boolean true to annotate the alignment view with groups on the
+ * alignment (and intersecting with selected region if selectedOnly
+ * is true)
+ * @return AlignmentView
+ */
+ public jalview.datamodel.AlignmentView getAlignmentView(
+ boolean selectedOnly, boolean markGroups)
+ {
+ return new AlignmentView(alignment, colSel, selectionGroup,
+ hasHiddenColumns, selectedOnly, markGroups);
+ }
+
+
+ /**
+ * This method returns the visible alignment as text, as seen on the GUI, ie
+ * if columns are hidden they will not be returned in the result. Use this for
+ * calculating trees, PCA, redundancy etc on views which contain hidden
+ * columns.
+ *
+ * @return String[]
+ */
+ public String[] getViewAsString(boolean selectedRegionOnly)
+ {
+ String[] selection = null;
+ SequenceI[] seqs = null;
+ int i, iSize;
+ int start = 0, end = 0;
+ if (selectedRegionOnly && selectionGroup != null)
+ {
+ iSize = selectionGroup.getSize();
+ seqs = selectionGroup.getSequencesInOrder(alignment);
+ start = selectionGroup.getStartRes();
+ end = selectionGroup.getEndRes() + 1;
+ }
+ else
+ {
+ iSize = alignment.getHeight();
+ seqs = alignment.getSequencesArray();
+ end = alignment.getWidth();
+ }
+
+ selection = new String[iSize];
+ if (hasHiddenColumns)
+ {
+ selection = colSel.getVisibleSequenceStrings(start, end, seqs);
+ }
+ else
+ {
+ for (i = 0; i < iSize; i++)
+ {
+ selection[i] = seqs[i].getSequenceAsString(start, end);
+ }
+
+ }
+ return selection;
+ }
+
+
+ /**
+ * return visible region boundaries within given column range
+ * @param min first column (inclusive, from 0)
+ * @param max last column (exclusive)
+ * @return int[][] range of {start,end} visible positions
+ */
+ public int[][] getVisibleRegionBoundaries(int min, int max)
+ {
+ Vector regions = new Vector();
+ int start = min;
+ int end = max;
+
+ do
+ {
+ if (hasHiddenColumns)
+ {
+ if (start == 0)
+ {
+ start = colSel.adjustForHiddenColumns(start);
+ }
+
+ end = colSel.getHiddenBoundaryRight(start);
+ if (start == end)
+ {
+ end = max;
+ }
+ if (end > max)
+ {
+ end = max;
+ }
+ }
+
+ regions.addElement(new int[]
+ { start, end });
+
+ if (hasHiddenColumns)
+ {
+ start = colSel.adjustForHiddenColumns(end);
+ start = colSel.getHiddenBoundaryLeft(start) + 1;
+ }
+ } while (end < max);
+
+ int[][] startEnd = new int[regions.size()][2];
+
+ regions.copyInto(startEnd);
+
+ return startEnd;
+
+ }
+ /**
+ * @return the padGaps
+ */
+ public boolean isPadGaps()
+ {
+ return padGaps;
+ }
+ /**
+ * @param padGaps the padGaps to set
+ */
+ public void setPadGaps(boolean padGaps)
+ {
+ this.padGaps = padGaps;
+ }
+ /**
+ * apply any post-edit constraints and trigger any calculations needed after an edit has been performed on the alignment
+ * @param ap
+ */
+ public void alignmentChanged(AlignmentViewPanel ap)
+ {
+ if (isPadGaps())
+ {
+ alignment.padGaps();
+ }
+ if (autoCalculateConsensus)
+ {
+ updateConsensus(ap);
+ }
+ if (hconsensus != null && autoCalculateConsensus)
+ {
+ updateConservation(ap);
+ }
+ if (autoCalculateStrucConsensus)
+ {
+ updateStrucConsensus(ap);
+ }
+
+ // Reset endRes of groups if beyond alignment width
+ int alWidth = alignment.getWidth();
+ Vector groups = alignment.getGroups();
+ if (groups != null)
+ {
+ for (int i = 0; i < groups.size(); i++)
+ {
+ SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
+ if (sg.getEndRes() > alWidth)
+ {
+ sg.setEndRes(alWidth - 1);
+ }
+ }
+ }
+
+ if (selectionGroup != null && selectionGroup.getEndRes() > alWidth)
+ {
+ selectionGroup.setEndRes(alWidth - 1);
+ }
+
+ resetAllColourSchemes();
+ calculator.restartWorkers();
+ // alignment.adjustSequenceAnnotations();
+ }
+
+
+ /**
+ * reset scope and do calculations for all applied colourschemes on alignment
+ */
+ void resetAllColourSchemes()
+ {
+ ColourSchemeI cs = globalColourScheme;
+ if (cs != null)
+ {
+ if (cs instanceof ClustalxColourScheme)
+ {
+ ((ClustalxColourScheme) cs).resetClustalX(alignment.getSequences(),
+ alignment.getWidth());
+ }
+
+ cs.setConsensus(hconsensus);
+ if (cs.conservationApplied())
+ {
+ cs.setConservation(Conservation.calculateConservation("All",
+ ResidueProperties.propHash, 3, alignment.getSequences(), 0,
+ alignment.getWidth(), false, getConsPercGaps(), false));
+ }
+ }
+
+ int s, sSize = alignment.getGroups().size();
+ for (s = 0; s < sSize; s++)
+ {
+ SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s);
+ if (sg.cs != null && sg.cs instanceof ClustalxColourScheme)
+ {
+ ((ClustalxColourScheme) sg.cs).resetClustalX(sg
+ .getSequences(hiddenRepSequences), sg.getWidth());
+ }
+ sg.recalcConservation();
+ }
+ }
+
+ protected void initAutoAnnotation()
+ {
+ // TODO: add menu option action that nulls or creates consensus object
+ // depending on if the user wants to see the annotation or not in a
+ // specific alignment
+
+ if (hconsensus == null && !isDataset)
+ {
+ if (!alignment.isNucleotide())
+ {
+ if (showConservation)
+ {
+ if (conservation==null)
+ {
+ conservation = new AlignmentAnnotation("Conservation",
+ "Conservation of total alignment less than " + getConsPercGaps()
+ + "% gaps", new Annotation[1], 0f, 11f,
+ AlignmentAnnotation.BAR_GRAPH);
+ conservation.hasText = true;
+ conservation.autoCalculated = true;
+ alignment.addAnnotation(conservation);
+ }
+ }
+ if (showQuality)
+ {
+ if (quality==null)
+ {
+ quality = new AlignmentAnnotation("Quality",
+ "Alignment Quality based on Blosum62 scores",
+ new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
+ quality.hasText = true;
+ quality.autoCalculated = true;
+ alignment.addAnnotation(quality);
+ }
+ }
+ } else {
+ if (alignment.hasRNAStructure())
+ {
+ strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ strucConsensus.hasText = true;
+ strucConsensus.autoCalculated = true;
+ }
+ }
+
+ consensus = new AlignmentAnnotation("Consensus", "PID",
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ consensus.hasText = true;
+ consensus.autoCalculated = true;
+
+ if (showConsensus)
+ {
+ alignment.addAnnotation(consensus);
+ if (strucConsensus!=null)
+ {
+ alignment.addAnnotation(strucConsensus);
+ }
+ }
+ }
+ }
+
+}
--- /dev/null
+package jalview.workers;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignCalcWorkerI;
+import jalview.datamodel.AlignmentAnnotation;
+
+public class AlignCalcManager implements AlignCalcManagerI
+{
+ private volatile List<AlignCalcWorkerI> restartable = new ArrayList<AlignCalcWorkerI>();
+
+ private List<Class> blackList = new ArrayList<Class>();
+
+ /**
+ * global record of calculations in progress
+ */
+ private static Hashtable<Class, AlignCalcWorkerI> inProgress = new Hashtable<Class, AlignCalcWorkerI>();
+
+ /**
+ * record of calculations pending or in progress in the current context
+ */
+ private Map<Class, List<AlignCalcWorkerI>> updating = new Hashtable<Class, List<AlignCalcWorkerI>>();
+
+ @Override
+ public void notifyStart(AlignCalcWorkerI worker)
+ {
+ List<AlignCalcWorkerI> upd = updating.get(worker.getClass());
+ if (upd == null)
+ {
+ updating.put(worker.getClass(),
+ upd = new ArrayList<AlignCalcWorkerI>());
+ }
+ upd.add(worker);
+ }
+
+ @Override
+ public synchronized boolean alreadyDoing(AlignCalcWorkerI worker)
+ {
+ return inProgress.containsKey(worker.getClass());
+ }
+
+ @Override
+ public synchronized boolean notifyWorking(AlignCalcWorkerI worker)
+ {
+ // synchronized (inProgress)
+ {
+ // TODO: decide if we should throw exceptions here if multiple workers
+ // start to work
+ if (inProgress.get(worker.getClass()) != null)
+ {
+ if (false)
+ {
+ System.err
+ .println("Warning: Multiple workers are running of type "
+ + worker.getClass());
+ }
+ return false;
+ }
+ inProgress.put(worker.getClass(), worker);
+ }
+ return true;
+ }
+
+ private HashSet<AlignCalcWorkerI> canUpdate=new HashSet<AlignCalcWorkerI>();
+ @Override
+ public synchronized void workerComplete(AlignCalcWorkerI worker)
+ {
+ inProgress.remove(worker.getClass());
+ List<AlignCalcWorkerI> upd = updating.get(worker.getClass());
+ if (upd != null)
+ {
+ upd.remove(worker);
+ canUpdate.add(worker);
+ }
+
+ }
+
+ @Override
+ public void workerCannotRun(AlignCalcWorkerI worker)
+ {
+ blackList.add(worker.getClass());
+ }
+
+ public boolean isBlackListed(Class workerType)
+ {
+ return blackList.contains(workerType);
+ }
+
+ @Override
+ public void startWorker(AlignCalcWorkerI worker)
+ {
+ new Thread(worker).start();
+ }
+
+ @Override
+ public synchronized boolean isWorking(AlignCalcWorkerI worker)
+ {
+ // System.err.println("isWorking : worker "+(worker!=null ?
+ // worker.getClass():"null")+ " "+hashCode());
+ return worker != null && inProgress.get(worker.getClass()) == worker;
+ }
+
+ @Override
+ public boolean isWorking()
+ {
+ // System.err.println("isWorking "+hashCode());
+ return inProgress.size() > 0;
+ }
+
+ @Override
+ public void registerWorker(AlignCalcWorkerI worker)
+ {
+ if (!restartable.contains(worker))
+ {
+ restartable.add(worker);
+ }
+ startWorker(worker);
+ }
+
+ @Override
+ public void restartWorkers()
+ {
+ for (AlignCalcWorkerI worker : restartable)
+ {
+ startWorker(worker);
+ }
+ }
+
+ @Override
+ public boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation)
+ {
+ if (isWorking())
+ {
+ for (List<AlignCalcWorkerI> workers: updating.values())
+ {
+ for (AlignCalcWorkerI worker:workers)
+ if (worker.involves(alignmentAnnotation))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void updateAnnotationFor(Class workerClass)
+ {
+ for (AlignCalcWorkerI worker:canUpdate.toArray(new AlignCalcWorkerI[0]))
+ {
+ if (workerClass.equals(worker.getClass()))
+ {
+ worker.updateAnnotation();
+ }
+ }
+ }
+
+ @Override
+ public List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
+ Class workerClass)
+ {
+ List<AlignCalcWorkerI> workingClass=new ArrayList<AlignCalcWorkerI>();
+ for (AlignCalcWorkerI worker:canUpdate.toArray(new AlignCalcWorkerI[0]))
+ {
+ if (workerClass.equals(worker.getClass()))
+ {
+ workingClass.add(worker);
+ }
+ }
+ return (workingClass.size()==0) ? null : workingClass;
+ }
+
+ @Override
+ public boolean startRegisteredWorkersOfClass(Class workerClass)
+ {
+ List<AlignCalcWorkerI> workers=getRegisteredWorkersOfClass(workerClass);
+ if (workers==null)
+ {
+ return false;
+ }
+ for (AlignCalcWorkerI worker: workers) {
+ startWorker(worker);
+ }
+ return true;
+ }
+
+ @Override
+ public void workerMayRun(AlignCalcWorkerI worker)
+ {
+ if (blackList.contains(worker.getClass()))
+ {
+ blackList.remove(worker.getClass());
+ }
+ }
+}
--- /dev/null
+/**
+ *
+ */
+package jalview.workers;
+
+import java.util.List;
+
+import jalview.api.AlignCalcManagerI;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+
+/**
+ * Base class for alignment calculation workers
+ * @author jimp
+ *
+ */
+public abstract class AlignCalcWorker implements AlignCalcWorkerI
+{
+ /**
+ * manager and data source for calculations
+ */
+ protected AlignViewportI alignViewport;
+ protected AlignCalcManagerI calcMan;
+ protected AlignmentViewPanel ap;
+ protected List<AlignmentAnnotation> ourAnnots=null;
+
+ public AlignCalcWorker(AlignViewportI alignViewport,
+ AlignmentViewPanel alignPanel)
+ {
+ this.alignViewport = alignViewport;
+ calcMan=alignViewport.getCalcManager();
+ ap = alignPanel;
+ }
+ protected void abortAndDestroy()
+ {
+ if (calcMan!=null) {
+ calcMan.workerComplete(this);
+ }
+ alignViewport=null;
+ calcMan=null;
+ ap=null;
+
+ }
+ public boolean involves(AlignmentAnnotation i)
+ {
+ return ourAnnots!=null && ourAnnots.contains(i);
+ }
+
+ // TODO: allow GUI to query workers associated with annotation to add items to annotation label panel popup menu
+
+}
--- /dev/null
+package jalview.workers;
+
+import jalview.analysis.AAFrequency;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.schemes.ColourSchemeI;
+
+import java.util.Hashtable;
+
+public class ConsensusThread extends AlignCalcWorker implements AlignCalcWorkerI
+{
+ public ConsensusThread(AlignViewportI alignViewport,
+ AlignmentViewPanel alignPanel)
+ {
+ super(alignViewport, alignPanel);
+ }
+
+ public void run()
+ {
+ try
+ {
+ AlignmentAnnotation consensus = alignViewport.getAlignmentConsensusAnnotation();
+ if (consensus==null) { return;
+ }
+ calcMan.notifyStart(this);
+ while (!calcMan.notifyWorking(this))
+ {
+ try
+ {
+ if (ap != null)
+ {
+ ap.paintAlignment(false);
+ }
+
+ Thread.sleep(200);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ calcMan.notifyWorking(this);
+ if (alignViewport.isClosed())
+ {
+ abortAndDestroy();
+ }
+ AlignmentI alignment = alignViewport.getAlignment();
+
+ int aWidth = -1;
+
+ if (alignment == null || (aWidth = alignment.getWidth()) < 0)
+ {
+ calcMan.workerComplete(this);
+ // .updatingConservation = false;
+ // AlignViewport.UPDATING_CONSERVATION = false;
+
+ return;
+ }
+ consensus = alignViewport
+ .getAlignmentConsensusAnnotation();
+
+ consensus.annotations = null;
+ consensus.annotations = new Annotation[aWidth];
+ Hashtable[] hconsensus = alignViewport.getSequenceConsensusHash();
+ hconsensus = new Hashtable[aWidth];
+ AAFrequency.calculate(alignment.getSequencesArray(), 0,
+ alignment.getWidth(), hconsensus, true);
+ alignViewport.setSequenceConsensusHash(hconsensus);
+ updateResultAnnotation(true);
+ ColourSchemeI globalColourScheme = alignViewport
+ .getGlobalColourScheme();
+ if (globalColourScheme != null)
+ {
+ globalColourScheme.setConsensus(hconsensus);
+ }
+
+ } catch (OutOfMemoryError error)
+ {
+ calcMan.workerCannotRun(this);
+
+ // consensus = null;
+ // hconsensus = null;
+ ap.raiseOOMWarning("calculating consensus", error);
+ }
+
+ calcMan.workerComplete(this);
+ if (ap != null)
+ {
+ ap.paintAlignment(true);
+ }
+ }
+
+ /**
+ * update the consensus annotation from the sequence profile data using
+ * current visualization settings.
+ */
+ public void updateAnnotation()
+ {
+ updateResultAnnotation(false);
+ }
+
+ public void updateResultAnnotation(boolean immediate)
+ {
+ AlignmentAnnotation consensus = alignViewport
+ .getAlignmentConsensusAnnotation();
+ Hashtable[] hconsensus = alignViewport.getSequenceConsensusHash();
+ if (immediate || !calcMan.isWorking(this) && consensus!=null && hconsensus!=null)
+ {
+ AAFrequency.completeConsensus(consensus, hconsensus, 0,
+ hconsensus.length, alignViewport.getIgnoreGapsConsensus(),
+ alignViewport.isShowSequenceLogo());
+ }
+ }
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.workers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jalview.analysis.Conservation;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.AlignViewportI;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+
+public class ConservationThread extends AlignCalcWorker implements AlignCalcWorkerI
+{
+
+ private int ConsPercGaps = 25; // JBPNote : This should be a configurable property!
+
+ public ConservationThread(AlignViewportI alignViewport, AlignmentViewPanel alignPanel)
+ {
+ super(alignViewport, alignPanel);
+ ConsPercGaps = alignViewport.getConsPercGaps();
+ }
+
+ private Conservation cons;
+ AlignmentAnnotation conservation,quality;
+ int alWidth;
+ public void run()
+ {
+ try
+ {
+ calcMan.notifyStart(this); // updatingConservation = true;
+
+ while (!calcMan.notifyWorking(this))
+ {
+ try
+ {
+ if (ap != null)
+ {
+ ap.paintAlignment(false);
+ }
+ Thread.sleep(200);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ if (alignViewport.isClosed()) {
+ abortAndDestroy();
+ }
+ List<AlignmentAnnotation>ourAnnot = new ArrayList<AlignmentAnnotation>();
+ AlignmentI alignment=alignViewport.getAlignment();
+ conservation=alignViewport.getAlignmentConservationAnnotation();
+ quality=alignViewport.getAlignmentQualityAnnot();
+ ourAnnot.add(conservation);
+ ourAnnot.add(quality);
+ ourAnnots = ourAnnot;
+
+ // AlignViewport.UPDATING_CONSERVATION = true;
+
+ if (alignment==null || (alWidth=alignment.getWidth())< 0)
+ {
+ calcMan.workerComplete(this);
+ //.updatingConservation = false;
+ //AlignViewport.UPDATING_CONSERVATION = false;
+
+ return;
+ }
+
+ cons = Conservation.calculateConservation("All",
+ jalview.schemes.ResidueProperties.propHash, 3,
+ alignment.getSequences(), 0, alWidth - 1, false, ConsPercGaps, quality!=null);
+ updateResultAnnotation(true);
+ } catch (OutOfMemoryError error)
+ {
+ ap.raiseOOMWarning("calculating conservation", error);
+ calcMan.workerCannotRun(this);
+ // alignViewport.conservation = null;
+ // this.alignViewport.quality = null;
+
+ }
+ calcMan.workerComplete(this);
+
+ if (ap != null)
+ {
+ ap.paintAlignment(true);
+ }
+
+ }
+
+ private void updateResultAnnotation(boolean b)
+ {
+ if (b || !calcMan.isWorking(this) && cons!=null && conservation!=null && quality!=null)
+ cons.completeAnnotations(conservation,
+ quality, 0, alWidth);
+ }
+ @Override
+ public void updateAnnotation()
+ {
+ updateResultAnnotation(false);
+
+ }
+}
--- /dev/null
+package jalview.workers;
+
+import java.util.Hashtable;
+
+import jalview.analysis.AAFrequency;
+import jalview.analysis.StructureFrequency;
+import jalview.api.AlignCalcWorkerI;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+
+public class StrucConsensusThread extends AlignCalcWorker implements AlignCalcWorkerI
+{
+ public StrucConsensusThread(AlignViewportI alignViewport,
+ AlignmentViewPanel alignPanel)
+ {
+ super(alignViewport, alignPanel);
+ }
+ AlignmentAnnotation strucConsensus;
+ Hashtable[] hStrucConsensus;
+
+ public void run()
+ {
+ try
+ {
+ calcMan.notifyStart(this);
+ while (!calcMan.notifyWorking(this))
+ {
+ try
+ {
+ if (ap != null)
+ {
+ ap.paintAlignment(false);
+ }
+
+ Thread.sleep(200);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ if (alignViewport.isClosed())
+ {
+ abortAndDestroy();
+ }
+ AlignmentI alignment = alignViewport.getAlignment();
+
+ int aWidth = -1;
+
+ if (alignment == null || (aWidth = alignment.getWidth()) < 0)
+ {
+ calcMan.workerComplete(this);
+ return;
+ }
+ strucConsensus=alignViewport.getAlignmentStrucConsensusAnnotation();
+ hStrucConsensus=alignViewport.getRnaStructureConsensusHash();
+ strucConsensus.annotations = null;
+ strucConsensus.annotations = new Annotation[aWidth];
+
+ hStrucConsensus = new Hashtable[aWidth];
+
+ AlignmentAnnotation[] aa = alignViewport.getAlignment()
+ .getAlignmentAnnotation();
+ AlignmentAnnotation rnaStruc = null;
+ // select rna struct to use for calculation
+ for (int i = 0; i < aa.length; i++)
+ {
+ if (aa[i].getRNAStruc() != null && aa[i].isValidStruc())
+ {
+ rnaStruc = aa[i];
+ break;
+ }
+ }
+ // check to see if its valid
+
+ if (rnaStruc==null || !rnaStruc.isValidStruc())
+ {
+ calcMan.workerComplete(this);
+ return;
+ }
+
+ jalview.analysis.StructureFrequency.calculate(alignment.getSequencesArray(), 0,
+ alignment.getWidth(), hStrucConsensus, true, rnaStruc);
+ alignViewport.setRnaStructureConsensusHash(hStrucConsensus);
+ // TODO AlignmentAnnotation rnaStruc!!!
+ updateResultAnnotation(true);
+ if (alignViewport.getGlobalColourScheme()!= null)
+ {
+ alignViewport.getGlobalColourScheme().setConsensus(hStrucConsensus);
+ }
+
+ } catch (OutOfMemoryError error)
+ {
+ calcMan.workerCannotRun(this);
+
+ // consensus = null;
+ // hconsensus = null;
+ ap.raiseOOMWarning("calculating RNA structure consensus", error);
+ }
+
+ calcMan.workerComplete(this);
+ if (ap != null)
+ {
+ ap.paintAlignment(true);
+ }
+
+ }
+ /**
+ * update the consensus annotation from the sequence profile data using
+ * current visualization settings.
+ */
+ public void updateAnnotation()
+ {
+ updateResultAnnotation(false);
+ }
+
+ public void updateResultAnnotation(boolean immediate)
+ {
+ if (immediate || !calcMan.isWorking(this) && strucConsensus!=null && hStrucConsensus!=null)
+ {
+ StructureFrequency.completeConsensus(strucConsensus,
+ hStrucConsensus, 0, hStrucConsensus.length,
+ alignViewport.getIgnoreGapsConsensus(),
+ alignViewport.isShowSequenceLogo());
+ }
+ }
+
+}
\ No newline at end of file
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
// alignment is\r
// 'default' for\r
// PFAM\r
+ addDBRefSourceImpl(jalview.ws.dbsources.RfamFull.class);\r
+ addDBRefSourceImpl(jalview.ws.dbsources.RfamSeed.class);\r
registerDasSequenceSources();\r
}\r
\r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
* @author JimP\r
* \r
*/\r
-abstract public class Pfam extends DbSourceProxyImpl implements\r
+abstract public class Pfam extends Xfam implements\r
DbSourceProxy\r
{\r
\r
* \r
* @see jalview.ws.DbSourceProxy#getDbVersion()\r
*/\r
- public String getDbVersion()\r
+ @Override\r
+public String getDbVersion()\r
{\r
// TODO Auto-generated method stub\r
return null;\r
}\r
\r
- /**\r
+ /**Returns base URL for selected Pfam alignment type\r
* \r
* @return PFAM URL stub for this DbSource\r
*/\r
- protected abstract String getPFAMURL();\r
+ @Override\r
+protected abstract String getXFAMURL();\r
\r
/*\r
* (non-Javadoc)\r
// individual references to each sequence in each family alignment that's\r
// retrieved.\r
startQuery();\r
- AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getPFAMURL()\r
+ AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getXFAMURL()\r
+ queries.trim().toUpperCase(), jalview.io.FormatAdapter.URL,\r
"STH");\r
for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)\r
/*\r
* public String getDbName() { return "PFAM"; // getDbSource(); }\r
*/\r
+ \r
+ \r
+ public String getXfamSource() { return jalview.datamodel.DBRefSource.PFAM; }\r
+ \r
+ \r
}\r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
* \r
* @see jalview.ws.dbsources.Pfam#getPFAMURL()\r
*/\r
- protected String getPFAMURL()\r
+ protected String getXFAMURL()\r
{\r
return "http://pfam.sanger.ac.uk/family/alignment/download/format?alnType=full&format=stockholm&order=t&case=l&gaps=default&entry=";\r
}\r
return "PF03760";\r
}\r
\r
+public String getDbVersion() {\r
+ return null;\r
+}\r
+\r
}\r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
* \r
* @see jalview.ws.dbsources.Pfam#getPFAMURL()\r
*/\r
- protected String getPFAMURL()\r
+ protected String getXFAMURL()\r
{\r
return "http://pfam.sanger.ac.uk/family/alignment/download/format?alnType=seed&format=stockholm&order=t&case=l&gaps=default&entry=";\r
}\r
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.ws.dbsources;
+
+import com.stevesoft.pat.Regex;
+
+import jalview.ws.seqfetcher.DbSourceProxy;
+
+/**
+ * Contains methods for fetching sequences from Rfam database
+ *
+ * @author Lauren Michelle Lui
+ */
+abstract public class Rfam extends Xfam implements DbSourceProxy
+{
+
+ public Rfam()
+ {
+ super();
+ // all extensions of this RFAM source base class are DOMAINDB sources
+ addDbSourceProperty(jalview.datamodel.DBRefSource.DOMAINDB);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.DbSourceProxy#getAccessionSeparator() Left here for
+ * consistency with Pfam class
+ */
+ public String getAccessionSeparator()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.DbSourceProxy#getAccessionValidator() * Left here for
+ */
+ public Regex getAccessionValidator()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * Left here for consistency with Pfam class
+ *
+ * @see jalview.ws.DbSourceProxy#getDbSource() public String getDbSource() { *
+ * this doesn't work - DbSource is key for the hash of DbSourceProxy instances
+ * - 1:many mapping for DbSource to proxy will be lost. * suggest : RFAM is an
+ * 'alignment' source - means proxy is higher level than a sequence source.
+ * return jalview.datamodel.DBRefSource.RFAM; }
+ */
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.DbSourceProxy#getDbVersion()
+ */
+ @Override
+ public String getDbVersion()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**Returns base URL for selected Rfam alignment type
+ *
+ * @return RFAM URL stub for this DbSource
+ */
+ @Override
+ protected abstract String getXFAMURL();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
+ */
+ public boolean isValidReference(String accession)
+ {
+ return accession.indexOf("RF") == 0;
+ }
+
+ /* (non-Javadoc)
+ * @see jalview.ws.dbsources.Xfam#getXfamSource()
+ */
+ public String getXfamSource()
+ {
+ return jalview.datamodel.DBRefSource.RFAM;
+ }
+
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package jalview.ws.dbsources;
+
+import jalview.ws.seqfetcher.DbSourceProxy;
+
+/**
+ * Flyweight class specifying retrieval of Full family alignments from RFAM
+ *
+ * @author Lauren Michelle Lui
+ *
+ */
+public class RfamFull extends Rfam implements DbSourceProxy
+{
+ public RfamFull()
+ {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.dbsources.Rfam#getXFAMURL()
+ */
+ protected String getXFAMURL()
+ {
+ return "http://rfam.sanger.ac.uk/family/alignment/download/format?alnType=full&nseLabels=0&format=stockholm&acc=";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.seqfetcher.DbSourceProxy#getDbName()
+ */
+ public String getDbName()
+ {
+ return "RFAM (Full)";
+ }
+
+ public String getDbSource()
+ {
+ return getDbName(); // so we have unique DbSource string.
+ }
+
+ public String getTestQuery()
+ {
+ // Can be retrieved from http://rfam.janelia.org/cgi-bin/getdesc?acc=RF00014
+ // or
+ // http://rfam.sanger.ac.uk/family/alignment/download/format?alnType=full&nseLabels=0&format=stockholm&acc=RF00014
+ return "RF00014";
+ }
+
+ public String getDbVersion()
+ {
+ return null;
+ }
+
+}
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.ws.dbsources;
+
+import jalview.ws.seqfetcher.DbSourceProxy;
+
+/**
+ * Flyweight class specifying retrieval of Seed family alignments from RFAM
+ *
+ * @author Lauren Michelle Lui
+ *
+ */
+public class RfamSeed extends Rfam implements DbSourceProxy
+{
+ public RfamSeed()
+ {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.dbsources.Rfam#getRFAMURL()
+ */
+ protected String getXFAMURL()
+ {
+ return "http://rfam.sanger.ac.uk/family/alignment/download/format?alnType=seed&nseLabels=0&format=stockholm&acc=";
+ // Janelia Farms url
+ // "http://rfam.janelia.org/cgi-bin/getalignment?type=seed&fmt=stockholm&acc=";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.seqfetcher.DbSourceProxy#getDbName()
+ */
+ public String getDbName()
+ {
+ return "RFAM (Seed)";
+ }
+
+ public String getDbSource()
+ {
+ return getDbName(); // so we have unique DbSource string.
+ }
+
+ public String getTestQuery()
+ {
+ return "RF00014";
+ } // http://rfam.janelia.org/cgi-bin/getdesc?acc=RF00014
+
+ public String getDbVersion()
+ {
+ return null;
+ }
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ */
+package jalview.ws.dbsources;
+
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.DBRefEntry;
+import jalview.ws.seqfetcher.DbSourceProxyImpl;
+
+/**
+ * Acts as a superclass for the Rfam and Pfam classes
+ *
+ * @author Lauren Michelle Lui
+ *
+ */
+public abstract class Xfam extends DbSourceProxyImpl
+{
+
+ public Xfam()
+ {
+ super();
+ }
+
+ protected abstract String getXFAMURL();
+
+ public abstract String getDbVersion();
+
+ abstract String getXfamSource();
+
+ public AlignmentI getSequenceRecords(String queries) throws Exception
+ {
+ // TODO: this is not a perfect implementation. We need to be able to add
+ // individual references to each sequence in each family alignment that's
+ // retrieved.
+ startQuery();
+ AlignmentI rcds = new jalview.io.FormatAdapter().readFile(getXFAMURL()
+ + queries.trim().toUpperCase(), jalview.io.FormatAdapter.URL,
+ "STH");
+ for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
+ {
+ rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getXfamSource(),
+ // getDbSource(),
+ getDbVersion(), queries.trim().toUpperCase()));
+ if (!getDbSource().equals(getXfamSource()))
+ { // add the specific ref too
+ rcds.getSequenceAt(s).addDBRef(
+ new DBRefEntry(getDbSource(), getDbVersion(), queries
+ .trim().toUpperCase()));
+ }
+ }
+ stopQuery();
+ return rcds;
+ }
+
+}
\ No newline at end of file
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+package jalview.ws.jws2;
+
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.gui.AlignFrame;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeSet;
+
+import compbio.data.sequence.Score;
+import compbio.metadata.Argument;
+
+public class AAConsClient extends JabawsAlignCalcWorker
+{
+
+ public AAConsClient(Jws2Instance service, AlignFrame alignFrame,
+ WsParamSetI preset, List<Argument> paramset)
+ {
+ super(service, alignFrame, preset, paramset);
+ submitGaps=true;
+ alignedSeqs=true;
+ nucleotidesAllowed=false;
+ proteinAllowed=true;
+ }
+
+ public String getServiceActionText()
+ {
+ return "calculating Amino acid consensus using AACons service";
+ }
+
+ /**
+ * update the consensus annotation from the sequence profile data using
+ * current visualization settings.
+ */
+
+ public void updateResultAnnotation(boolean immediate)
+ {
+
+ if (immediate || !calcMan.isWorking(this) && scoremanager != null)
+ {
+ AlignmentAnnotation annotation;
+ ;
+ Map<String, TreeSet<Score>> scoremap = scoremanager.asMap();
+ int alWidth = alignViewport.getAlignment().getWidth();
+ AlignmentI alignment;
+ int ann = (alignment = alignViewport.getAlignment())
+ .getAlignmentAnnotation().length;
+ ArrayList<AlignmentAnnotation> ourAnnot = new ArrayList<AlignmentAnnotation>();
+ for (String score : scoremap.keySet())
+ {
+ TreeSet<Score> scores = scoremap.get(score);
+ for (Score scr : scores)
+ {
+ if (scr.getRanges() != null && scr.getRanges().size() > 0)
+ {
+ /**
+ * annotation in range annotation = findOrCreate(scr.getMethod(),
+ * true, null, null); Annotation[] elm = new Annotation[alWidth];
+ * Iterator<Float> vals = scr.getScores().iterator(); for (Range rng
+ * : scr.getRanges()) { float val = vals.next().floatValue(); for
+ * (int i = rng.from; i <= rng.to; i++) { elm[i] = new
+ * Annotation("", "", ' ', val); } } annotation.annotations = elm;
+ * annotation.validateRangeAndDisplay();
+ */
+ }
+ else
+ {
+ // simple annotation row
+ annotation = findOrCreate(scr.getMethod(), true, null, null);
+ Annotation[] elm = new Annotation[alWidth];
+ if (alWidth == scr.getScores().size())
+ {
+ Iterator<Float> vals = scr.getScores().iterator();
+ float m = 0f, x = 0f;
+ for (int i = 0; vals.hasNext(); i++)
+ {
+ float val = vals.next().floatValue();
+ if (i == 0)
+ {
+ m = val;
+ x = val;
+ }
+ else
+ {
+ if (m > val)
+ {
+ m = val;
+ }
+ ;
+ if (x < val)
+ {
+ x = val;
+ }
+ }
+ elm[i] = new Annotation("", "" + val, ' ', val);
+ }
+
+ annotation.annotations = elm;
+ annotation.belowAlignment = true;
+ if (x < 0)
+ {
+ x = 0;
+ }
+ x += (x - m) * 0.1;
+ annotation.graphMax = x;
+ annotation.graphMin = m;
+ annotation.validateRangeAndDisplay();
+ ourAnnot.add(annotation);
+ }
+ }
+ }
+ }
+ if (ourAnnot.size() > 0)
+ {
+ List<AlignmentAnnotation> our = ourAnnots;
+ ourAnnots = ourAnnot;
+ if (our != null)
+ {
+ if (our.size() > 0)
+ {
+ for (AlignmentAnnotation an : our)
+ {
+ if (!ourAnnots.contains(an))
+ {
+ // remove the old annotation
+ alignment.deleteAnnotation(an);
+ }
+ }
+ }
+ our.clear();
+ }
+ }
+ // if (ann !=
+ // alignViewport.getAlignment().getAlignmentAnnotation().length)
+ {
+ ap.adjustAnnotationHeight();
+ }
+ /*
+ * else { ap.paintAlignment(true); }
+ */
+ }
+ }
+
+}
--- /dev/null
+package jalview.ws.jws2;
+
+import jalview.api.AlignCalcWorkerI;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.Iterator;
+import java.util.List;
+
+import compbio.data.sequence.Range;
+import compbio.data.sequence.Score;
+import compbio.data.sequence.ScoreManager.ScoreHolder;
+import compbio.metadata.Argument;
+
+public class AADisorderClient extends JabawsAlignCalcWorker implements
+ AlignCalcWorkerI
+{
+
+ String typeName;
+
+ String methodName;
+
+ String groupName;
+
+ AlignFrame af;
+
+ public AADisorderClient(Jws2Instance sh, AlignFrame alignFrame,
+ WsParamSetI preset, List<Argument> paramset)
+ {
+ super(sh, alignFrame, preset, paramset);
+ af = alignFrame;
+ typeName = sh.action;
+ methodName = sh.serviceType;
+
+ submitGaps = false;
+ alignedSeqs = false;
+ nucleotidesAllowed = false;
+ proteinAllowed = true;
+ bySequence = true;
+ }
+
+ @Override
+ public String getServiceActionText()
+ {
+ return "Submitting amino acid sequences for disorder prediction.";
+ }
+
+ @Override
+ public void updateResultAnnotation(boolean immediate)
+ {
+
+ if (immediate || !calcMan.isWorking(this) && scoremanager != null)
+ {
+ boolean dispFeatures = false;
+ for (String seqId : seqNames.keySet())
+ {
+ SequenceI dseq, seq = seqNames.get(seqId);
+ int base = seq.getStart() - 1;
+ while ((dseq = seq).getDatasetSequence() != null)
+ {
+ seq = seq.getDatasetSequence();
+ }
+ ;
+ ScoreHolder scores = scoremanager.getAnnotationForSequence(seqId);
+
+ for (Score scr : scores.scores)
+ {
+
+ if (scr.getRanges() != null && scr.getRanges().size() > 0)
+ {
+ Iterator<Float> vals = scr.getScores().iterator();
+ // make features on sequence
+ for (Range rn : scr.getRanges())
+ {
+
+ SequenceFeature sf;
+ if (vals.hasNext())
+ {
+ sf = new SequenceFeature(typeName + "(" + scr.getMethod()
+ + ")", "Disordered Region", base + rn.from, base
+ + rn.to, vals.next().floatValue(), methodName);
+ }
+ else
+ {
+ sf = new SequenceFeature(typeName + "(" + scr.getMethod()
+ + ")", "Disordered Region", null, base + rn.from,
+ base + rn.to, methodName);
+ }
+ dseq.addSequenceFeature(sf);
+ dispFeatures = true;
+ }
+ }
+ else
+ {
+ Iterator<Float> vals = scr.getScores().iterator();
+ for (int start = base + 1; vals.hasNext(); start++)
+ {
+ SequenceFeature sf = new SequenceFeature(typeName + "("
+ + scr.getMethod() + ")", "Disordered Region", start,
+ start, vals.next().floatValue(), methodName);
+ dseq.addSequenceFeature(sf);
+ dispFeatures = true;
+ }
+ }
+ }
+ }
+ {
+ if (dispFeatures)
+ {
+ af.alignPanel.av.setShowSequenceFeatures(true);
+ ap.paintAlignment(true);
+ }
+ }
+ /*
+ * else { ap.paintAlignment(true); }
+ */
+ }
+ }
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import compbio.metadata.PresetManager;
import compbio.metadata.RunnerConfig;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
import jalview.ws.jws2.dm.JabaOption;
import jalview.ws.jws2.dm.JabaParameter;
import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.ParamDatastoreI;
import jalview.ws.params.ParamManager;
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
*/
package jalview.ws.jws2;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.WsParamSetI;
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
package jalview.ws.jws2;
import jalview.bin.Cache;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
-import compbio.data.msa.MsaWS;
+import java.util.HashSet;
+import java.util.Set;
+
+import compbio.data.msa.Category;
+import compbio.data.msa.JABAService;
import compbio.ws.client.Jws2Client;
import compbio.ws.client.Services;
/**
* @author JimP
- *
+ *
*/
public class JabaWsServerQuery implements Runnable
{
- Jws2Discoverer jws2Discoverer=null;
- String jwsservers=null;
- boolean quit=false,
- running=false;
+ Jws2Discoverer jws2Discoverer = null;
+
+ String jwsservers = null;
+
+ boolean quit = false, running = false;
+
/**
* @return the running
*/
- public boolean isRunning()
+ public boolean isRunning()
{
return running;
}
/**
- * @param quit the quit to set
+ * @param quit
+ * the quit to set
*/
public void setQuit(boolean quit)
{
public JabaWsServerQuery(Jws2Discoverer jws2Discoverer, String jwsservers)
{
this.jws2Discoverer = jws2Discoverer;
- this.jwsservers=jwsservers;
+ this.jwsservers = jwsservers;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Runnable#run()
*/
@Override
public void run()
{
- running=true;
- try
+ running = true;
+ try
{
if (Jws2Client.validURL(jwsservers))
{
- boolean noservices=true;
+ compbio.data.msa.RegistryWS registry = null;
+ Set svccategories = null;
+ boolean noservices = true;
// look for services
- for (Services srv : Services.values())
+ boolean jabasws2 = false;
+ // If we are dealing with a JABAWS2 service, then just go and ask the
+ // JABAWS 2 service registry
+ Set<Services> srv_set = new HashSet<Services>();
+
+ Set<Category> categories = Category.getCategories();
+ String svc_cat;
+
+ try
{
- if (quit)
+ // JBPNote: why is RegistryWS in compbio.data.msa ?
+ registry = Jws2Client.connectToRegistry(jwsservers);
+ if (registry != null)
{
- running=false;
- return;
+ // System.err.println("Test Services Output\n"
+ // + registry.testAllServices());
+ // TODO: enumerate services and test those that haven't been tested
+ // in the last n-days/hours/etc.
+
+ jabasws2 = true;
+ srv_set = registry.getSupportedServices();
+ svccategories = registry.getServiceCategories();
+
}
- MsaWS service = null;
- try
+ } catch (Exception ex)
+ {
+ System.err.println("Exception whilst trying to get at registry:");
+ ex.printStackTrace();
+ // if that failed, then we are probably working with a JABAWS1 server.
+ // in that case, look for each service endpoint
+ System.err.println("JWS2 Discoverer: " + jwsservers
+ + " is a JABAWS1 server. Using hardwired list.");
+ for (Services srv : new Services[]
+ { Services.ClustalWS, Services.MuscleWS, Services.MafftWS,
+ Services.ProbconsWS, Services.TcoffeeWS })
{
- service = Jws2Client.connect(jwsservers, srv);
- } catch (Exception e)
+ srv_set.add(srv);
+ }
+ }
+ for (Category cat : categories)
+ {
+ for (Services srv : cat.getServices())
{
- System.err.println("Jws2 Discoverer: Problem on "
- + jwsservers + " with service " + srv + ":\n"
- + e.getMessage());
- if (!(e instanceof javax.xml.ws.WebServiceException))
+ if (quit)
{
- e.printStackTrace();
+ running = false;
+ return;
}
- // For moment, report service as a problem.
- jws2Discoverer.addInvalidServiceUrl(jwsservers);
- }
- ;
- if (service != null)
- {
- noservices=false;
- jws2Discoverer.addService(jwsservers, srv, service);
+ if (!srv_set.contains(srv))
+ {
+ continue;
+ }
+ JABAService service = null;
+ try
+ {
+ service = Jws2Client.connect(jwsservers, srv);
+ } catch (Exception e)
+ {
+ System.err.println("Jws2 Discoverer: Problem on "
+ + jwsservers + " with service " + srv + ":\n"
+ + e.getMessage());
+ if (!(e instanceof javax.xml.ws.WebServiceException))
+ {
+ e.printStackTrace();
+ }
+ // For moment, report service as a problem.
+ jws2Discoverer.addInvalidServiceUrl(jwsservers);
+ }
+ ;
+ if (service != null)
+ {
+ noservices = false;
+ Jws2Instance svc = null;
+ if (registry != null)
+ {
+
+ String description = registry.getServiceDescription(srv);
+
+ svc = new Jws2Instance(jwsservers, srv.toString(),
+ cat.name, description, service);
+ }
+ if (svc == null)
+ {
+ svc = new Jws2Instance(jwsservers, srv.toString(), cat.name,
+ "JABAWS 1 Alignment Service", service);
+ }
+ jws2Discoverer.addService(jwsservers, svc);
+ }
+
}
}
+
if (noservices)
{
jws2Discoverer.addUrlwithnoservices(jwsservers);
Cache.log.error("Exception when discovering Jws2 services.", e);
jws2Discoverer.addInvalidServiceUrl(jwsservers);
}
- running=false;
+ running = false;
}
}
--- /dev/null
+package jalview.ws.jws2;
+
+import jalview.analysis.AlignSeq;
+import jalview.analysis.SeqsetUtils;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.workers.AlignCalcWorker;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import compbio.data.msa.SequenceAnnotation;
+import compbio.data.sequence.FastaSequence;
+import compbio.data.sequence.ScoreManager;
+import compbio.metadata.Argument;
+import compbio.metadata.ChunkHolder;
+import compbio.metadata.JobStatus;
+import compbio.metadata.JobSubmissionException;
+import compbio.metadata.Option;
+import compbio.metadata.ResultNotAvailableException;
+import compbio.metadata.WrongParameterException;
+
+public abstract class JabawsAlignCalcWorker extends AlignCalcWorker
+{
+
+ @SuppressWarnings("unchecked")
+ protected SequenceAnnotation aaservice;
+
+ protected ScoreManager scoremanager;
+
+ protected WsParamSetI preset;
+
+ protected List<Argument> arguments;
+
+ public JabawsAlignCalcWorker(AlignViewportI alignViewport,
+ AlignmentViewPanel alignPanel)
+ {
+ super(alignViewport, alignPanel);
+ }
+
+ public JabawsAlignCalcWorker(Jws2Instance service, AlignFrame alignFrame,
+ WsParamSetI preset, List<Argument> paramset)
+ {
+ this(alignFrame.getCurrentView(), alignFrame.alignPanel);
+ this.preset = preset;
+ this.arguments = paramset;
+ aaservice = (SequenceAnnotation) service.service;
+
+ }
+
+ public WsParamSetI getPreset()
+ {
+ return preset;
+ }
+
+ public List<Argument> getArguments()
+ {
+ return arguments;
+ }
+
+ /**
+ * reconfigure and restart the AAConsClient. This method will spawn a new
+ * thread that will wait until any current jobs are finished, modify the
+ * parameters and restart the conservation calculation with the new values.
+ *
+ * @param newpreset
+ * @param newarguments
+ */
+ public void updateParameters(final WsParamSetI newpreset,
+ final List<Argument> newarguments)
+ {
+ if (calcMan.isWorking(this))
+ {
+ new Thread(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+
+ try
+ {
+ Thread.sleep(200);
+ } catch (InterruptedException x)
+ {
+ }
+ ;
+ updateParameters(newpreset, newarguments);
+ }
+ }).start();
+ }
+ else
+ {
+ preset = newpreset;
+ arguments = newarguments;
+ calcMan.startWorker(this);
+ }
+ }
+
+ public List<Option> getJabaArguments()
+ {
+ List<Option> newargs = new ArrayList<Option>();
+ if (preset != null && preset instanceof JabaWsParamSet)
+ {
+ newargs.addAll(((JabaWsParamSet) preset).getjabaArguments());
+ }
+ if (arguments != null && arguments.size() > 0)
+ {
+ for (Argument rg : arguments)
+ {
+ if (Option.class.isAssignableFrom(rg.getClass()))
+ {
+ newargs.add((Option) rg);
+ }
+ }
+ }
+ return newargs;
+ }
+
+ @Override
+ public void run()
+ {
+ if (aaservice == null)
+ {
+ return;
+ }
+
+ try
+ {
+ if (checkDone())
+ {
+ return;
+ }
+ List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(alignViewport
+ .getAlignment());
+
+ if (seqs == null)
+ {
+ calcMan.workerComplete(this);
+ return;
+ }
+
+ AlignmentAnnotation[] aa = alignViewport.getAlignment()
+ .getAlignmentAnnotation();
+
+ String rslt;
+ if (preset == null)
+ {
+ rslt = aaservice.analize(seqs);
+ }
+ else
+ {
+ try
+ {
+ rslt = aaservice.customAnalize(seqs, getJabaArguments());
+ } catch (WrongParameterException x)
+ {
+ throw new JobSubmissionException(
+ "Invalid paremeter set. Check Jalview implementation.", x);
+
+ }
+ }
+ boolean finished = false;
+ long rpos = 0;
+ do
+ {
+ JobStatus status = aaservice.getJobStatus(rslt);
+ if (status.equals(JobStatus.FINISHED))
+ {
+ finished = true;
+ }
+ long cpos;
+ ChunkHolder stats;
+ do
+ {
+ cpos = rpos;
+ try
+ {
+ stats = aaservice.pullExecStatistics(rslt, rpos);
+ } catch (Exception x)
+ {
+
+ if (x.getMessage().contains(
+ "Position in a file could not be negative!"))
+ {
+ // squash index out of bounds exception- seems to happen for
+ // disorder predictors which don't (apparently) produce any
+ // progress information and JABA server throws an exception
+ // because progress length is -1.
+ stats = null;
+ }
+ else
+ {
+ throw x;
+ }
+ }
+ if (stats != null)
+ {
+ System.out.print(stats.getChunk());
+ rpos = stats.getNextPosition();
+ }
+ } while (stats != null && rpos > cpos);
+
+ if (!finished && status.equals(JobStatus.FAILED))
+ {
+ try
+ {
+ Thread.sleep(200);
+ } catch (InterruptedException x)
+ {
+ }
+ ;
+ }
+
+ } while (!finished);
+ try
+ {
+ Thread.sleep(200);
+ } catch (InterruptedException x)
+ {
+ }
+ ;
+ scoremanager = aaservice.getAnnotation(rslt);
+ if (scoremanager != null)
+ {
+ updateResultAnnotation(true);
+ }
+ } catch (JobSubmissionException x)
+ {
+
+ System.err.println("submission error:");
+ x.printStackTrace();
+ calcMan.workerCannotRun(this);
+ } catch (ResultNotAvailableException x)
+ {
+ System.err.println("collection error:");
+ x.printStackTrace();
+ calcMan.workerCannotRun(this);
+
+ } catch (OutOfMemoryError error)
+ {
+ calcMan.workerCannotRun(this);
+
+ // consensus = null;
+ // hconsensus = null;
+ ap.raiseOOMWarning(getServiceActionText(), error);
+ } catch (Exception x)
+ {
+ calcMan.workerCannotRun(this);
+
+ // consensus = null;
+ // hconsensus = null;
+ System.err
+ .println("Blacklisting worker due to unexpected exception:");
+ x.printStackTrace();
+ } finally
+ {
+
+ calcMan.workerComplete(this);
+ if (ap != null)
+ {
+ ap.paintAlignment(true);
+ }
+ }
+
+ }
+
+ public void updateAnnotation()
+ {
+ updateResultAnnotation(false);
+ }
+
+ public abstract void updateResultAnnotation(boolean immediate);
+
+ public abstract String getServiceActionText();
+
+ boolean submitGaps = true;
+
+ boolean alignedSeqs = true;
+
+ boolean nucleotidesAllowed = false;
+
+ boolean proteinAllowed = false;
+
+ /**
+ * record sequences for mapping result back to afterwards
+ */
+ protected boolean bySequence = false;
+
+ Map<String, SequenceI> seqNames;
+
+ public List<FastaSequence> getInputSequences(AlignmentI alignment)
+ {
+
+ if (alignment == null || alignment.getWidth() <= 0
+ || alignment.getSequences() == null
+// || (alignedSeqs && !alignment.isAligned() && !submitGaps)
+ || alignment.isNucleotide() ? !nucleotidesAllowed
+ : !proteinAllowed)
+ {
+ return null;
+ }
+ List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
+
+ int minlen = 10;
+ int ln=-1;
+ if (bySequence)
+ {
+ seqNames = new HashMap<String, SequenceI>();
+ }
+ for (SequenceI sq : ((List<SequenceI>) alignment.getSequences()))
+ {
+
+ if (sq.getEnd() - sq.getStart() > minlen - 1)
+ {
+ String newname = SeqsetUtils.unique_name(seqs.size() + 1);
+ // make new input sequence with or without gaps
+ if (seqNames != null)
+ {
+ seqNames.put(newname, sq);
+ }
+ FastaSequence seq;
+ seqs.add(seq=new compbio.data.sequence.FastaSequence(newname,
+ (submitGaps) ? sq.getSequenceAsString() : AlignSeq
+ .extractGaps(jalview.util.Comparison.GapChars,
+ sq.getSequenceAsString())));
+ if (seq.getSequence().length()>ln)
+ {
+ ln = seq.getSequence().length();
+ }
+ }
+ }
+ if (alignedSeqs && submitGaps)
+ {
+ // try real hard to return something submittable
+ // TODO: some of AAcons measures need a minimum of two or three amino acids at each position, and aacons doesn't gracefully degrade.
+ for (int p=0; p<seqs.size();p++)
+ {
+ FastaSequence sq=seqs.get(p);
+ int l=sq.getSequence().length();
+ if (l<ln)
+ {
+ char[] padded=new char[ln];
+ System.arraycopy(sq.getSequence().toCharArray(),0,padded,0,sq.getSequence().length());
+ while (l<ln)
+ {
+ padded[l++]='-';
+ }
+ seqs.set(p, new compbio.data.sequence.FastaSequence(sq.getId(), new String(padded)));
+ }
+ }
+
+ }
+ return seqs;
+ }
+
+ protected AlignmentAnnotation findOrCreate(String name, boolean autoCalc,
+ SequenceI seqRef, SequenceGroup groupRef)
+ {
+ for (AlignmentAnnotation annot : alignViewport.getAlignment()
+ .getAlignmentAnnotation())
+ {
+ if (annot.autoCalculated == autoCalc
+ && annot.getCalcId().equals(name)
+ && annot.sequenceRef == seqRef && annot.groupRef == groupRef)
+ {
+ return annot;
+ }
+ }
+ AlignmentAnnotation annot = new AlignmentAnnotation(name, name,
+ new Annotation[1], 0f, 0f, AlignmentAnnotation.BAR_GRAPH);
+ annot.hasText = false;
+ annot.setCalcId(new String(name));
+ annot.autoCalculated = autoCalc;
+ if (seqRef != null)
+ {
+ annot.setSequenceRef(seqRef);
+ }
+ annot.groupRef = groupRef;
+ alignViewport.getAlignment().addAnnotation(annot);
+
+ return annot;
+ }
+
+ /**
+ * notify manager that we have started, and wait for a free calculation slot
+ *
+ * @return true if slot is obtained and work still valid, false if another
+ * thread has done our work for us.
+ */
+ boolean checkDone()
+ {
+ calcMan.notifyStart(this);
+ // ap.paintAlignment(false);
+ while (!calcMan.notifyWorking(this))
+ {
+ if (calcMan.isWorking(this))
+ {
+ return true;
+ }
+ try
+ {
+ if (ap != null)
+ {
+ ap.paintAlignment(false);
+ }
+
+ Thread.sleep(200);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ if (alignViewport.isClosed())
+ {
+ abortAndDestroy();
+ return true;
+ }
+ return false;
+ }
+
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
*/
package jalview.ws.jws2;
+import java.util.List;
+
import javax.swing.JMenu;
+import compbio.metadata.Argument;
+
import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
import jalview.gui.WebserviceInfo;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
+import jalview.gui.WsJobParameters;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
/**
- * provides metadata for a jws2 service instance - resolves names, etc.
+ * provides metadata for a jabaws2 service instance - resolves names, etc.
*
* @author JimP
*
*/
public abstract class Jws2Client extends jalview.ws.WSClient
{
+ protected AlignFrame alignFrame;
+
+ protected WsParamSetI preset;
+
+ protected List<Argument> paramset;
+
+ public Jws2Client(AlignFrame _alignFrame,
+ WsParamSetI preset, List<Argument> arguments)
+ {
+ alignFrame = _alignFrame;
+ this.preset = preset;
+ if (preset != null)
+ {
+ if (!((preset instanceof JabaPreset) || preset instanceof JabaWsParamSet))
+ {
+ /*
+ * { this.preset = ((JabaPreset) preset).p; } else if (preset instanceof
+ * JabaWsParamSet) { List<Argument> newargs = new ArrayList<Argument>();
+ * JabaWsParamSet pset = ((JabaWsParamSet) preset); for (Option opt :
+ * pset.getjabaArguments()) { newargs.add(opt); } if (arguments != null
+ * && arguments.size() > 0) { // merge arguments with preset's own
+ * arguments. for (Argument opt : arguments) { newargs.add(opt); } }
+ * paramset = newargs; } else {
+ */
+ throw new Error(
+ "Implementation error: Can only instantiate Jaba parameter sets.");
+ }
+ }
+ else
+ {
+ // just provided with a bunch of arguments
+ this.paramset = arguments;
+ }
+ }
+
+ boolean processParams(Jws2Instance sh, boolean editParams)
+ {
+ return processParams(sh, editParams, false);
+ }
+ protected boolean processParams(Jws2Instance sh, boolean editParams,
+ boolean adjustingExisting)
+ {
+
+ if (editParams)
+ {
+ if (sh.paramStore == null)
+ {
+ sh.paramStore = new JabaParamStore(sh,
+ Desktop.getUserParameterStore());
+ }
+ WsJobParameters jobParams = new WsJobParameters(sh, preset);
+ if (adjustingExisting)
+ {
+ jobParams.setName("Adjusting parameters for existing Calculation");
+ }
+ if (!jobParams.showRunDialog())
+ {
+ return false;
+ }
+ WsParamSetI prset = jobParams.getPreset();
+ if (prset == null)
+ {
+ paramset = JabaParamStore.getJabafromJwsArgs(jobParams
+ .getJobParams());
+ }
+ else
+ {
+ this.preset = prset; // ((JabaPreset) prset).p;
+ paramset = null; // no user supplied parameters.
+ }
+ }
+ return true;
+
+ }
+
+ public Jws2Client()
+ {
+ // anonymous constructor - used for headless method calls only
+ }
+
protected WebserviceInfo setWebService(Jws2Instance serv, boolean b)
{
// serviceHandle = serv;
- String serviceInstance = serv.service.getClass().getName();
+ String serviceInstance = serv.action; // serv.service.getClass().getName();
WebServiceName = serv.serviceType;
WebServiceJobTitle = serv.getActionText();
WsURL = serv.hosturl;
if (!b)
{
return new WebserviceInfo(WebServiceJobTitle, WebServiceJobTitle
- + " using service hosted at " + serv.hosturl);
+ + " using service hosted at " + serv.hosturl + "\n"
+ + (serv.description != null ? serv.description : ""));
}
return null;
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.io.Closeable;
import java.net.ConnectException;
import java.net.URL;
import java.util.ArrayList;
import jalview.gui.JalviewChangeSupport;
import jalview.gui.JvSwingUtils;
import jalview.ws.WSMenuEntryProviderI;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
-import jalview.ws.params.ParamDatastoreI;
-import compbio.data.msa.MsaWS;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import compbio.data.msa.JABAService;
import compbio.metadata.Option;
import compbio.metadata.Preset;
-import compbio.metadata.PresetManager;
-import compbio.metadata.RunnerConfig;
import compbio.ws.client.Jws2Client;
import compbio.ws.client.Services;
* @param srv
* @param service2
*/
- synchronized void addService(String jwsservers, Services srv,
- MsaWS service2)
+ synchronized void addService(String jwsservers, Jws2Instance service)
{
if (services == null)
{
services = new Vector<Jws2Instance>();
}
System.out.println("Discovered service: " + jwsservers + " "
- + srv.toString());
- Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(),
- service2);
+ + service.toString());
+// Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(),
+// service2);
services.add(service);
// retrieve the presets and parameter set and cache now
service.hasParameters();
}
- public class Jws2Instance
- {
- public String hosturl;
-
- public String serviceType;
-
- public MsaWS service;
-
- public Jws2Instance(String hosturl, String serviceType, MsaWS service)
- {
- super();
- this.hosturl = hosturl;
- this.serviceType = serviceType;
- this.service = service;
- }
-
- PresetManager presets = null;
-
- public JabaParamStore paramStore = null;
-
- /**
- * non thread safe - gets the presets for this service (blocks whilst it
- * calls the service to get the preset set)
- *
- * @return service presets or null if exceptions were raised.
- */
- public PresetManager getPresets()
- {
- if (presets == null)
- {
- try
- {
- presets = service.getPresets();
- } catch (Exception ex)
- {
- System.err
- .println("Exception when retrieving presets for service "
- + serviceType + " at " + hosturl);
- }
- }
- return presets;
- }
-
- public String getHost()
- {
- return hosturl;
- /*
- * try { URL serviceurl = new URL(hosturl); if (serviceurl.getPort()!=80)
- * { return serviceurl.getHost()+":"+serviceurl.getPort(); } return
- * serviceurl.getHost(); } catch (Exception e) {
- * System.err.println("Failed to parse service URL '" + hosturl +
- * "' as a valid URL!"); } return null;
- */
- }
-
- /**
- * @return short description of what the service will do
- */
- public String getActionText()
- {
- return "Align with " + serviceType;
- }
-
- /**
- * non-thread safe - blocks whilst accessing service to get complete set of
- * available options and parameters
- *
- * @return
- */
- public RunnerConfig getRunnerConfig()
- {
- return service.getRunnerOptions();
- }
-
- @Override
- protected void finalize() throws Throwable
- {
- if (service != null)
- {
- try
- {
- Closeable svc = (Closeable) service;
- service = null;
- svc.close();
- } catch (Exception e)
- {
- }
- ;
- }
- super.finalize();
- }
-
- public ParamDatastoreI getParamStore()
- {
- if (paramStore == null)
- {
- try
- {
- paramStore = new JabaParamStore(this,
- (Desktop.instance != null ? Desktop
- .getUserParameterStore() : null));
- } catch (Exception ex)
- {
- }
-
- }
- return paramStore;
- }
-
- public String getUri()
- {
- // this is only valid for Jaba 1.0 - this formula might have to change!
- return hosturl
- + (hosturl.lastIndexOf("/") == (hosturl.length() - 1) ? ""
- : "/") + serviceType;
- }
-
- private boolean hasParams = false, lookedForParams = false;
-
- public boolean hasParameters()
- {
- if (!lookedForParams)
- {
- lookedForParams = true;
- try
- {
- hasParams = (getRunnerConfig().getArguments().size() > 0);
- } catch (Exception e)
- {
-
- }
- }
- return hasParams;
- }
- };
-
/**
* holds list of services.
*/
protected Vector<Jws2Instance> services;
-
+ /**
+ * attach all available web services to the appropriate submenu in the given JMenu
+ */
public void attachWSMenuEntry(JMenu wsmenu, final AlignFrame alignFrame)
{
// dynamically regenerate service list.
- final JMenu jws2al = wsmenu; // new JMenu("JABAWS Alignment");
- jws2al.addMenuListener(new MenuListener()
- {
- // TODO: future: add menu listener to parent menu - so submenus are
- // populated *before* they are selected.
- @Override
- public void menuSelected(MenuEvent e)
- {
- populateWSMenuEntry(jws2al, alignFrame);
- }
-
- @Override
- public void menuDeselected(MenuEvent e)
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void menuCanceled(MenuEvent e)
- {
- // TODO Auto-generated method stub
-
- }
-
- });
- wsmenu.add(jws2al);
-
+ populateWSMenuEntry(wsmenu, alignFrame, null);
}
- private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame)
+ private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame, String typeFilter)
{
if (running || services == null || services.size() == 0)
{
jalview.util.QuickSort.sort(sortbytype, orderedsvcs);
for (final Jws2Instance service : orderedsvcs)
{
- atpoint = jws2al;
+ atpoint = JvSwingUtils.findOrCreateMenu(jws2al,service.action);
String type = service.serviceType;
if (byhost)
{
// hostLabels.addElement(host + (bytype ?
// service.serviceType+service.getActionText() : ""));
}
- msacl.attachWSMenuEntry(atpoint, service, alignFrame);
+
+ service.attachWSMenuEntry(atpoint, alignFrame);
/*
* JMenuItem sitem = new JMenuItem(service.serviceType);
* sitem.setToolTipText("Hosted at " + service.hosturl);
public static void main(String[] args)
{
+ if (args.length>0)
+ {
+ testUrls = new Vector<String>();
+ for (String url:args)
+ {
+ testUrls.add(url);
+ };
+ }
Thread runner = getDiscoverer().startDiscoverer(
new PropertyChangeListener()
{
}
}
+ private static Vector<String> testUrls=null;
public static Vector<String> getServiceUrls()
{
+ if (testUrls!=null)
+ {
+ // return test urls, if there are any, instead of touching cache
+ return testUrls;
+ }
String surls = Cache.getDefault(JWS2HOSTURLS,
"http://www.compbio.dundee.ac.uk/jabaws");
Vector<String> urls = new Vector<String>();
}
return null;
}
-
}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
import compbio.metadata.Option;
import compbio.metadata.Preset;
import compbio.metadata.PresetManager;
-import jalview.ws.jws2.Jws2Discoverer.Jws2Instance;
import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
/**
*/
MsaWS server;
- AlignFrame alignFrame;
-
- private WsParamSetI preset;
-
- private List<Argument> paramset;
-
- public MsaWSClient(Jws2Discoverer.Jws2Instance sh, String altitle,
+ public MsaWSClient(Jws2Instance sh, String altitle,
jalview.datamodel.AlignmentView msa, boolean submitGaps,
boolean preserveOrder, Alignment seqdataset,
AlignFrame _alignFrame)
// TODO Auto-generated constructor stub
}
- public MsaWSClient(Jws2Discoverer.Jws2Instance sh, WsParamSetI preset,
+ public MsaWSClient(Jws2Instance sh, WsParamSetI preset,
String altitle, jalview.datamodel.AlignmentView msa,
boolean submitGaps, boolean preserveOrder, Alignment seqdataset,
AlignFrame _alignFrame)
* DOCUMENT ME!
*/
- public MsaWSClient(Jws2Discoverer.Jws2Instance sh, WsParamSetI preset,
+ public MsaWSClient(Jws2Instance sh, WsParamSetI preset,
List<Argument> arguments, boolean editParams, String altitle,
jalview.datamodel.AlignmentView msa, boolean submitGaps,
boolean preserveOrder, Alignment seqdataset,
AlignFrame _alignFrame)
{
- super();
- alignFrame = _alignFrame;
+ super(_alignFrame, preset, arguments);
+ if (!processParams(sh, editParams))
+ {
+ return;
+ }
+
if (!(sh.service instanceof MsaWS))
{
// redundant at mo - but may change
return;
}
- server = sh.service;
- this.preset=preset;
- if (preset != null)
- {
- if (!((preset instanceof JabaPreset) || preset instanceof JabaWsParamSet)) {
- /*{
- this.preset = ((JabaPreset) preset).p;
- }
- else if (preset instanceof JabaWsParamSet)
- {
- List<Argument> newargs = new ArrayList<Argument>();
- JabaWsParamSet pset = ((JabaWsParamSet) preset);
- for (Option opt : pset.getjabaArguments())
- {
- newargs.add(opt);
- }
- if (arguments != null && arguments.size() > 0)
- {
- // merge arguments with preset's own arguments.
- for (Argument opt : arguments)
- {
- newargs.add(opt);
- }
- }
- paramset = newargs;
- }
- else
- {*/
- throw new Error(
- "Implementation error: Can only instantiate Jaba parameter sets.");
- }
- }
- else
- {
- // just provided with a bunch of arguments
- this.paramset = arguments;
- }
- if (editParams)
- {
- if (sh.paramStore == null)
- {
- sh.paramStore = new JabaParamStore(sh,
- Desktop.getUserParameterStore());
- }
- WsJobParameters jobParams = new WsJobParameters(sh, preset);
- if (!jobParams.showRunDialog())
- {
- return;
- }
- WsParamSetI prset = jobParams.getPreset();
- if (prset == null)
- {
- paramset = JabaParamStore.getJabafromJwsArgs(jobParams
- .getJobParams());
- }
- else
- {
- this.preset = prset; // ((JabaPreset) prset).p;
- paramset = null; // no user supplied parameters.
- }
- }
-
+ server = (MsaWS) sh.service;
if ((wsInfo = setWebService(sh, false)) == null)
{
JOptionPane.showMessageDialog(Desktop.desktop,
return (WebServiceName.indexOf("lustal") > -1); // cheat!
}
+
public void attachWSMenuEntry(JMenu rmsawsmenu,
final Jws2Instance service, final AlignFrame alignFrame)
{
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+/**
+ *
+ */
+package jalview.ws.jws2;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.List;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+
+import compbio.metadata.Argument;
+
+import jalview.api.AlignCalcWorkerI;
+import jalview.datamodel.AlignmentView;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.JalviewDialog;
+import jalview.gui.JvSwingUtils;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
+/**
+ * @author jimp
+ *
+ */
+public class SequenceAnnotationWSClient extends Jws2Client
+{
+
+ /**
+ * initialise a client so its attachWSMenuEntry method can be called.
+ */
+ public SequenceAnnotationWSClient()
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ public SequenceAnnotationWSClient(final Jws2Instance sh,
+ AlignFrame alignFrame, WsParamSetI preset, boolean editParams)
+ {
+ super(alignFrame, preset, null);
+ if (alignFrame.getViewport().getAlignment().isNucleotide())
+ {
+ JOptionPane
+ .showMessageDialog(
+ Desktop.desktop,
+ sh.serviceType+" can only be used\nfor amino acid alignments.",
+ "Wrong type of sequences!",
+ JOptionPane.WARNING_MESSAGE);
+ return;
+
+ }
+ if (sh.action.toLowerCase().contains("conservation"))
+ {
+ // Build an AACons style client - take alignment, return annotation for columns
+
+ List<AlignCalcWorkerI> clnts = alignFrame.getViewport()
+ .getCalcManager()
+ .getRegisteredWorkersOfClass(AAConsClient.class);
+ if (clnts == null || clnts.size() == 0)
+ {
+ if (!processParams(sh, editParams))
+ {
+ return;
+ }
+ alignFrame
+ .getViewport()
+ .getCalcManager()
+ .registerWorker(
+ new AAConsClient(sh, alignFrame, preset, paramset));
+ }
+ else
+ {
+ AAConsClient worker = (AAConsClient) clnts.get(0);
+ if (editParams)
+ {
+ paramset = worker.getArguments();
+ preset = worker.getPreset();
+ }
+
+ if (!processParams(sh, editParams, true))
+ return;
+ // reinstate worker if it was blacklisted (might have happened due to
+ // invalid parameters)
+ alignFrame.getViewport().getCalcManager().workerMayRun(worker);
+ worker.updateParameters(preset, paramset);
+
+ }
+ }
+ if (sh.action.toLowerCase().contains("disorder"))
+ {
+ // build IUPred style client. take sequences, returns annotation per sequence.
+ if (!processParams(sh, editParams))
+ {
+ return;
+ }
+
+ alignFrame
+ .getViewport()
+ .getCalcManager()
+ .startWorker(
+ new AADisorderClient(sh, alignFrame, preset, paramset));
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.jws2.Jws2Client#attachWSMenuEntry(javax.swing.JMenu,
+ * jalview.ws.jws2.jabaws2.Jws2Instance, jalview.gui.AlignFrame)
+ */
+ public void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service,
+ final AlignFrame alignFrame)
+ {
+ boolean hasparams = service.hasParameters();
+ // Assume name ends in WS
+ String calcName = service.serviceType.substring(0,service.serviceType.length()-2);
+
+ JMenuItem aacons = new JMenuItem(calcName + " Defaults");
+ aacons.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ new SequenceAnnotationWSClient(service, alignFrame, null, false);
+ }
+ });
+ wsmenu.add(aacons);
+ if (hasparams)
+ {
+ // only add these menu options if the service has user-modifiable
+ // arguments
+ aacons = new JMenuItem("Edit settings and run ...");
+ aacons.setToolTipText("View and change parameters before running calculation");
+
+ aacons.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ new SequenceAnnotationWSClient(service, alignFrame, null, true);
+ }
+ });
+ wsmenu.add(aacons);
+ List<WsParamSetI> presets = service.getParamStore().getPresets();
+ if (presets != null && presets.size() > 0)
+ {
+ JMenu presetlist = new JMenu("Run " + calcName + "with preset");
+
+ for (final WsParamSetI preset : presets)
+ {
+ final JMenuItem methodR = new JMenuItem(preset.getName());
+ methodR.setToolTipText("<html><p>"
+ + JvSwingUtils.wrapTooltip("<strong>"
+ + (preset.isModifiable() ? "User Preset"
+ : "Service Preset") + "</strong><br/>"
+ + preset.getDescription() + "</p>") + "</html>");
+ methodR.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ new SequenceAnnotationWSClient(service, alignFrame, preset,
+ false);
+ }
+
+ });
+ presetlist.add(methodR);
+ }
+ wsmenu.add(presetlist);
+ }
+
+ }
+ }
+}
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
--- /dev/null
+package jalview.ws.jws2.jabaws2;
+
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.ws.jws2.JabaParamStore;
+import jalview.ws.jws2.MsaWSClient;
+import jalview.ws.jws2.SequenceAnnotationWSClient;
+import jalview.ws.params.ParamDatastoreI;
+
+import java.io.Closeable;
+
+import javax.swing.JMenu;
+
+import compbio.data.msa.JABAService;
+import compbio.data.msa.MsaWS;
+import compbio.data.msa.SequenceAnnotation;
+import compbio.metadata.PresetManager;
+import compbio.metadata.RunnerConfig;
+
+public class Jws2Instance
+{
+ public String hosturl;
+
+ public String serviceType;
+ public String action;
+ public JABAService service;
+ public String description;
+
+ public Jws2Instance(String hosturl, String serviceType, String action, String description,
+ JABAService service)
+ {
+ super();
+ this.hosturl = hosturl;
+ this.serviceType = serviceType;
+ this.service = service;
+ this.action=action;
+ this.description = description;
+
+ }
+
+ PresetManager presets = null;
+
+ public JabaParamStore paramStore = null;
+
+ /**
+ * non thread safe - gets the presets for this service (blocks whilst it calls
+ * the service to get the preset set)
+ *
+ * @return service presets or null if exceptions were raised.
+ */
+ public PresetManager getPresets()
+ {
+ if (presets == null)
+ {
+ try
+ {
+ if (service instanceof MsaWS<?>)
+ {
+ presets = ((MsaWS) service).getPresets();
+
+ }
+ if (service instanceof SequenceAnnotation<?>)
+ {
+ presets = ((SequenceAnnotation) service).getPresets();
+ }
+ } catch (Exception ex)
+ {
+ System.err.println("Exception when retrieving presets for service "
+ + serviceType + " at " + hosturl);
+ }
+ }
+ return presets;
+ }
+
+ public String getHost()
+ {
+ return hosturl;
+ /*
+ * try { URL serviceurl = new URL(hosturl); if (serviceurl.getPort()!=80) {
+ * return serviceurl.getHost()+":"+serviceurl.getPort(); } return
+ * serviceurl.getHost(); } catch (Exception e) {
+ * System.err.println("Failed to parse service URL '" + hosturl +
+ * "' as a valid URL!"); } return null;
+ */
+ }
+
+ /**
+ * @return short description of what the service will do
+ */
+ public String getActionText()
+ {
+ return action+" with " + serviceType;
+ }
+
+ /**
+ * non-thread safe - blocks whilst accessing service to get complete set of
+ * available options and parameters
+ *
+ * @return
+ */
+ public RunnerConfig getRunnerConfig()
+ {
+ if (service instanceof MsaWS<?>)
+ {
+ return ((MsaWS) service).getRunnerOptions();
+ }
+ if (service instanceof SequenceAnnotation<?>)
+ {
+ return ((SequenceAnnotation) service).getRunnerOptions();
+ }
+ throw new Error("Implementation Error: Runner Config not available for a JABAWS service of type "+serviceType+" ("+service.getClass()+")");
+ }
+
+ @Override
+ protected void finalize() throws Throwable
+ {
+ if (service != null)
+ {
+ try
+ {
+ Closeable svc = (Closeable) service;
+ service = null;
+ svc.close();
+ } catch (Exception e)
+ {
+ }
+ ;
+ }
+ super.finalize();
+ }
+
+ public ParamDatastoreI getParamStore()
+ {
+ if (paramStore == null)
+ {
+ try
+ {
+ paramStore = new JabaParamStore(this,
+ (Desktop.instance != null ? Desktop.getUserParameterStore()
+ : null));
+ } catch (Exception ex)
+ {
+ }
+
+ }
+ return paramStore;
+ }
+
+ public String getUri()
+ {
+ // this is only valid for Jaba 1.0 - this formula might have to change!
+ return hosturl
+ + (hosturl.lastIndexOf("/") == (hosturl.length() - 1) ? ""
+ : "/") + serviceType;
+ }
+
+ private boolean hasParams = false, lookedForParams = false;
+
+ public boolean hasParameters()
+ {
+ if (!lookedForParams)
+ {
+ lookedForParams = true;
+ try
+ {
+ hasParams = (getRunnerConfig().getArguments().size() > 0);
+ } catch (Exception e)
+ {
+
+ }
+ }
+ return hasParams;
+ }
+
+ public void attachWSMenuEntry(JMenu atpoint, AlignFrame alignFrame)
+ {
+ if (service instanceof MsaWS<?>)
+ {
+ new MsaWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
+ } else
+ if (service instanceof SequenceAnnotation<?>){
+ new SequenceAnnotationWSClient().attachWSMenuEntry(atpoint, this, alignFrame);
+ }
+ }
+}
\ No newline at end of file
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*******************************************************************************
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*\r
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
* \r
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<string><![CDATA[664]]></string>
</property>
<property name="sourceName">
- <string><![CDATA[min-jaba-client.jar]]></string>
+ <string><![CDATA[min-jaba-client-2.0.jar]]></string>
</property>
<property name="overrideUnixPermissions">
<boolean>false</boolean>
<boolean>true</boolean>
</property>
<property name="destinationName">
- <string><![CDATA[min-jaba-client.jar]]></string>
+ <string><![CDATA[min-jaba-client-2.0.jar]]></string>
</property>
<property name="fileSize">
<long>81728</long>
<?xml version="1.0"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*
<html><head>
<!--
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
- * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
*