--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="false" sync-formatter="false">
+ <local-check-config name="JalviewCheckstyle" location="resources/checkstyle/checkstyle.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="source" enabled="true" check-config-name="JalviewCheckstyle" local="true">
+ <file-match-pattern match-pattern="src/.*.java" include-pattern="true"/>
+ <file-match-pattern match-pattern="resources/.*.properties" include-pattern="true"/>
+ </fileset>
+ <filter name="NonSrcDirs" enabled="false"/>
+</fileset-config>
--- /dev/null
+Checkstyle for Jalview
+----------------------
+
+http://checkstyle.sourceforge.net/
+GNU LGPL
+
+To get the Eclipse Checkstyle plugin
+------------------------------------
+ - Help | Eclipse Marketplace
+ - search for checkstyle
+ - install eclipse-cs checkstyle plugin
+The current version is 6.19.1 (August 2016).
+
+Config
+------
+
+ File Jalview/.checkstyle holds configuration for the "JalviewCheckstyle" ruleset.
+ This includes confining its scope to src/*.java and resources/*.properties.
+ This can be modified interactively through the checkstyle properties editor.
+
+ Checkstyle config files in resources/checkstyle:
+ checkstyle.xml : main configuration file with selected checkstyle modules
+ checkstyle-suppress.xml : rules to exclude certain checks / files
+ import-control.xml : package import rules
+
+ Checkstyle error messages can be customised. I've done this for TypeName as an example.
+
+How to use checkstyle
+---------------------
+
+ Option 1: enable it for the Jalview project
+ - right-click on project | Checkstyle | Activate Checkstyle
+ - notice CheckstyleNature gets added to the .project file
+ - don't commit this file unless we all agree to!
+ - Checkstyle will run as you recompile changed code
+ - checking the whole project can be slow and may hang - not recommended for now
+
+ Option 2: on selected code
+ - right-click on a class or package and Checkstyle | Check code with checkstyle
+
+Checkstyle rules
+----------------
+ Documented at http://checkstyle.sourceforge.net/checks.html
+ Should be self-documenting in checkstyle.xml
+ Open for discussion:
+ - which rules to use
+ - what naming and layout standards to apply
+ - settings for complexity metrics
+ - whether any rules should report error instead of warning
+
+Gotchas
+-------
+ Sometimes checkstyle needs a kick before it will refresh its findings.
+ A whitespace edit in checkstyle.xml usually does this. There may be better ways.
+
+ Invalid configuration files may result in checkstyle failing with an error reported
+ in the Eclipse log file.
+ Help | Installation Details | Configuration takes you to a screen with a
+ 'View Error Log' button.
+
+ Sometimes checkstyle can fail silently. Try 'touching' (editing) config files, failing
+ that, carefully check / back out / redo any recent changes to its config.
+
+ Putting <!-- XML comments --> inside a checkstyle <module> causes it to be ignored!
+
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+\r
+<!DOCTYPE suppressions PUBLIC\r
+ "-//Puppy Crawl//DTD Suppressions 1.1//EN"\r
+ "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">\r
+\r
+<suppressions>\r
+ <!-- \r
+ Do not put individual file-level suppressions here.\r
+ Instead use embedded comments to switch checks on and off.\r
+ -->\r
+ \r
+ <!-- \r
+ Suppress check of XML binding generated code packages \r
+ --> \r
+ <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]schemabinding[\\/]*"/>\r
+ <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]binding[\\/]*"/>\r
+ <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]json[\\/]binding[\\/]*"/>\r
+ <suppress checks="[a-zA-Z0-9]*" files="jalview[\\/]xml[\\/]binding[\\/]*"/>\r
+ \r
+ <!-- \r
+ Suppress check of externally sourced code \r
+ --> \r
+ <suppress checks="[a-zA-Z0-9]*" files="com[\\/]*"/>\r
+ <suppress checks="[a-zA-Z0-9]*" files="ext[\\/]*"/>\r
+ <suppress checks="[a-zA-Z0-9]*" files="org[\\/]*"/>\r
+ <suppress checks="[a-zA-Z0-9]*" files="uk[\\/]*"/>\r
+ \r
+ <!-- \r
+ ImportControl can only handle one top level package\r
+ -->\r
+ <suppress checks="ImportControl" files="MCview[\\/]*" />\r
+ <suppress checks="ImportControl" files="vamsas[\\/]*" />\r
+ \r
+ <!-- \r
+ Suppress checks by name \r
+ -->\r
+ <suppress checks="FinalLocalVariable" files=".*\.java"/>\r
+ \r
+ <!-- \r
+ Suppress checks by id \r
+ -->\r
+ <suppress id="InterfaceNaming" files=".*\.java"/>\r
+ <suppress id="NoStaticInitialization" files=".*\.java"/>\r
+ \r
+</suppressions>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+<!--
+ Jalview Checkstyle configuration file
+-->
+<module name="Checker">
+ <!-- Default severity is warning -->
+ <property name="severity" value="warning"/>
+ <property name="fileExtensions" value="java,properties"/>
+
+ <!--
+ Add any metrics that you wish to suppress to the following file.
+ -->
+ <module name="SuppressionFilter">
+ <property name="file" value="${basedir}/resources/checkstyle/checkstyle-suppress.xml"/>
+ </module>
+
+ <!--
+ Allow suppression of rules by comments, e.g.:
+ // CHECKSTYLE.OFF: ParameterNumber
+ ..method declaration
+ // CHECKSTYLE.ON: ParameterNumber
+ -->
+ <module name="SuppressionCommentFilter">
+ <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
+ <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
+ <property name="checkFormat" value="$1"/>
+ </module>
+
+ <!--
+ Maximum line count for source files
+ -->
+ <module name="FileLength">
+ <property name="max" value="1200"/>
+ <property name="fileExtensions" value="java"/>
+ </module>
+
+ <!--
+ Check language bundles have the same keys and no duplicates
+ (ensure Checkstyle is configured to scan non-source files)
+ -->
+ <module name="Translation">
+ <property name="fileExtensions" value="properties"/>
+ <property name="baseName" value="^Messages.*$"/>
+ </module>
+ <module name="UniqueProperties">
+ <property name="fileExtensions" value="properties" />
+ <property name="severity" value="error"/>
+ </module>
+
+ <module name="TreeWalker">
+
+ <property name="tabWidth" value="4"/>
+
+ <!--
+ Enables parsing of suppressions comments
+ see http://checkstyle.sourceforge.net/config_filters.html#SuppressionCommentFilter
+ -->
+ <module name="FileContentsHolder"/>
+
+ <!-- ****************************** -->
+ <!-- NAMING STANDARDS -->
+ <!-- ****************************** -->
+
+ <!--
+ Naming convention for member fields. Start with (optional) underscore, then
+ lower case, then camel case; no internal underscores
+ -->
+ <module name="MemberName">
+ <property name="format" value="^_?[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Naming convention for methods. Start with (optional) underscore, then
+ lower case, then camel case; no internal underscores
+ -->
+ <module name="MethodName">
+ <property name="format" value="^_?[a-z]([a-zA-Z0-9]+)*$"/>
+ </module>
+
+ <!--
+ Name pattern for local final variables.
+ -->
+ <module name="LocalFinalVariableName">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Name pattern for local variables
+ -->
+ <module name="LocalVariableName">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Name pattern for constants (static final fields)
+ -->
+ <module name="ConstantName">
+ <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"/>
+ </module>
+
+ <!--
+ Name pattern for parameters (note no underscores allowed)
+ -->
+ <module name="ParameterName">
+ <property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
+ </module>
+
+ <!--
+ Name pattern for static (non-final) fields
+ -->
+ <module name="StaticVariableName">
+ <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
+ </module>
+
+ <!--
+ Name pattern for classes
+ -->
+ <module name="TypeName">
+ <property name="format" value="[A-Z][a-zA-Z0-9]*$"/>
+ <property name="tokens" value="CLASS_DEF"/>
+ </module>
+
+ <!--
+ Name pattern for interfaces. All interfaces names must end with 'I'.
+ ** currently suppressed in checkstyle-suppress.xml **
+ -->
+ <module name="TypeName">
+ <property name="id" value="InterfaceNaming"/>
+ <property name="format" value="^[A-Z][a-zA-Z0-9]*I$"/>
+ <property name="tokens" value="INTERFACE_DEF"/>
+ <message key="name.invalidPattern" value="Interface names should end in a I"/>
+ </module>
+
+ <!--
+ Java package name pattern
+ -->
+ <module name="PackageName">
+ <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- LAYOUT AND STYLE -->
+ <!-- ****************************** -->
+
+ <!--
+ Only one top level type per source file
+ -->
+ <module name="OuterTypeNumber"/>
+
+ <!--
+ Ensure a class has a package declaration
+ -->
+ <module name="PackageDeclaration"/>
+
+ <!--
+ see http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141855.html#1852
+ 1. Class (static) variables: public, protected, package, private
+ 2. Instance variables: public, protected, package, private
+ 3. Constructors
+ 4. Methods
+ -->
+ <module name="DeclarationOrder"/>
+
+ <!--
+ Modifier order should conform to JLS
+ see http://checkstyle.sourceforge.net/config_modifier.html#ModifierOrder
+ public protected private abstract static final transient volatile synchronized native strictfp
+ -->
+ <module name="ModifierOrder"/>
+
+ <!--
+ Declare variables in separate statements, for readability and bug avoidance
+ -->
+ <module name="MultipleVariableDeclarations"/>
+
+ <!--
+ Only use blocks within control statements
+ -->
+ <module name="AvoidNestedBlocks"/>
+
+ <!--
+ Require at least a comment within a block.
+ Note this will accept auto-generated // TODO comments,
+ (but they should be flagged up by the TodoComment rule)
+ -->
+ <module name="EmptyBlock">
+ <property name="option" value="text"/>
+ </module>
+
+ <!--
+ Require braces round all code blocks within if/else/for/do/while
+ -->
+ <module name="NeedBraces"/>
+
+ <!--
+ Disallow empty ';' statements
+ -->
+ <module name="EmptyStatement"/>
+
+ <!--
+ Maximum number of return statements for a method
+ -->
+ <module name="ReturnCount">
+ <property name="max" value="4"/>
+ </module>
+
+ <!--
+ Don't use modifiers in contexts where their value is not optional,
+ for example all interface methods are always public
+ see http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier
+ -->
+ <module name="RedundantModifier"/>
+
+ <!--
+ Variables whose value is not modified should be declared final, both to show the
+ program's intent, and to allow compiler optimisation
+ ** currently suppressed in checkstyle-suppress.xml **
+ -->
+ <module name="FinalLocalVariable">
+ <property name="tokens" value="VARIABLE_DEF" />
+ </module>
+
+ <!--
+ Disallows shorthand of assigning values within an expression
+ -->
+ <module name="InnerAssignment"/>
+
+ <!--
+ Use Java style array declarations to assist in readability
+ -->
+ <module name="ArrayTypeStyle"/>
+
+ <!--
+ Use L not l to define a long constant
+ -->
+ <module name="UpperEll"/>
+
+ <!-- ****************************** -->
+ <!-- SIZE LIMITS -->
+ <!-- ****************************** -->
+
+ <!--
+ Maximum line count for methods
+ -->
+ <module name="MethodLength">
+ <property name="tokens" value="METHOD_DEF"/>
+ <property name="max" value="50"/>
+ <property name="countEmpty" value="false"/>
+ </module>
+
+ <!--
+ Maximum statement count for methods, constructors,
+ instance initialisation and static initialisation blocks
+ -->
+ <module name="ExecutableStatementCount">
+ <property name="max" value="30"/>
+ <property name="tokens" value="METHOD_DEF"/>
+ </module>
+ <module name="ExecutableStatementCount">
+ <property name="max" value="30"/>
+ <property name="tokens" value="CTOR_DEF"/>
+ </module>
+ <module name="ExecutableStatementCount">
+ <property name="max" value="4"/>
+ <property name="tokens" value="INSTANCE_INIT"/>
+ </module>
+ <module name="ExecutableStatementCount">
+ <property name="id" value="NoStaticInitialization"/>
+ <property name="max" value="0"/>
+ <property name="tokens" value="STATIC_INIT"/>
+ </module>
+
+ <!--
+ Maximum parameter count for methods
+ -->
+ <module name="ParameterNumber">
+ <property name="max" value="5"/>
+ </module>
+
+ <!--
+ Maximum line length for anonymous inner classes
+ -->
+ <module name="AnonInnerLength">
+ <property name="max" value="40"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- IMPORTS -->
+ <!-- ****************************** -->
+
+ <!--
+ Ensures that there are no redundant or unused imports.
+ Should be handled by Save actions if using Eclipse
+ -->
+ <module name="RedundantImport"/>
+ <module name="UnusedImports"/>
+
+ <!--
+ Disallow * imports; may also be enforced by IDE Save Actions
+ -->
+ <module name="AvoidStarImport"/>
+
+ <!--
+ Disallow import of sun.* packages as they are not portable
+ -->
+ <module name="IllegalImport"/>
+
+ <!--
+ rules as to what packages each package may (not) import
+ see http://checkstyle.sourceforge.net/config_imports.html#ImportControl
+ -->
+ <module name="ImportControl">
+ <property name="file" value="${basedir}/resources/checkstyle/import-control.xml"/>
+ <property name="severity" value="error"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- CATCH and THROW -->
+ <!-- ****************************** -->
+
+ <!--
+ Disallow catch of Exception, RunTimeException or Error
+ -->
+ <module name="IllegalCatch"/>
+
+ <!--
+ Disallow throw of Exception, RunTimeException or Error
+ -->
+ <module name="IllegalThrows"/>
+
+ <!-- ****************************** -->
+ <!-- CODING CHECKS -->
+ <!-- ****************************** -->
+
+ <!--
+ Check for use of factory method rather than constructor for specified classes
+ -->
+ <module name="IllegalInstantiation">
+ <property name="classes" value="java.lang.Boolean"/>
+ </module>
+
+ <!--
+ Check that "string".equals(value) is used rather than value.equals("string")
+ -->
+ <module name="EqualsAvoidNull"/>
+
+ <!--
+ Check that equals() and hashCode() are always overridden together
+ -->
+ <module name="EqualsHashCode"/>
+
+ <!--
+ Require switch statements to include a default
+ -->
+ <module name="MissingSwitchDefault"/>
+
+ <!--
+ Check that switch default follows all case statements
+ -->
+ <module name="DefaultComesLast">
+ <property name="severity" value="error"/>
+ </module>
+
+ <!--
+ Disallows fall-through in switch statements
+ i.e. a case without a break, return, throw or continue
+ NB a comment with the words "fall[s] through" suppresses this message
+ -->
+ <module name="FallThrough">
+ <property name="severity" value="error" />
+ </module>
+
+ <!--
+ Warn if boolean expressions can be simplified
+ -->
+ <module name="SimplifyBooleanExpression"/>
+
+ <!--
+ Warn if boolean return expressions can be simplified
+ -->
+ <module name="SimplifyBooleanReturn"/>
+
+ <!--
+ Classes with only private constructors should be declared final
+ -->
+ <module name="FinalClass"/>
+
+ <!--
+ Classes with only static methods should not be instantiable,
+ so should declare a private default constructor.
+ -->
+ <module name="HideUtilityClassConstructor"/>
+
+ <!--
+ An Interface should declare methods (do not use to define constants only)
+ -->
+ <module name="InterfaceIsType"/>
+
+ <!--
+ Disallow public fields in classes (other than constants)
+ -->
+ <module name="VisibilityModifier">
+ <property name="packageAllowed" value="true"/>
+ <property name="allowPublicImmutableFields" value="true"/>
+ </module>
+
+ <!--
+ Checks that a local variable or a parameter does not shadow a field that is defined in the same class.
+ Note this should also be configured as a compiler warning in the IDE.
+ -->
+ <module name="HiddenField"/>
+
+ <!--
+ Check that proper logging is used and never printing to System.out.
+ This may be suppressed in the class that provides logging functions.
+ -->
+ <module name="RegexpSinglelineJava">
+ <property name="format" value="System\.out\.println"/>
+ <property name="ignoreComments" value="true"/>
+ </module>
+
+ <!--
+ Checks that classes that define a covariant equals() method also override
+ method equals(java.lang.Object).
+ -->
+ <module name="CovariantEquals"/>
+
+ <!--
+ Checks that there are no "magic numbers" (numeric literals)
+ -->
+ <module name="MagicNumber">
+ <property name="ignoreNumbers" value="-1,0,1,2"/>
+ </module>
+
+ <!--
+ Check that loop control variables are not modified inside the for block
+ -->
+ <module name="ModifiedControlVariable">
+ </module>
+
+ <!--
+ Checks that string literals are not used with == or !=.
+ -->
+ <module name="StringLiteralEquality">
+ </module>
+
+ <!--
+ Checks that clone() invokes super.clone()
+ -->
+ <module name="SuperClone"/>
+
+ <!--
+ Checks that finalize() invokes super.finalize()
+ -->
+ <module name="SuperFinalize"/>
+
+ <!--
+ Disallow assignment of parameters.
+ -->
+ <module name="ParameterAssignment"/>
+
+ <!--
+ Checks for multiple occurrences of the same string literal within a single file.
+ NB - does not check for the same string in different files.
+ -->
+ <module name="MultipleStringLiterals">
+ <property name="allowedDuplicates" value="1"/>
+ </module>
+
+ <!--
+ Checks that exceptions are immutable (have only final fields)
+ -->
+ <module name="MutableException"/>
+
+ <!-- ****************************** -->
+ <!-- COMPLEXITY -->
+ <!-- ****************************** -->
+
+ <!--
+ Restrict the number of number of &&, ||, &, | and ^ in an expression.
+ Note that the operators & and | are not only integer bitwise operators, they are also the
+ non-shortcut versions of the boolean operators && and ||.
+ -->
+ <module name="BooleanExpressionComplexity">
+ <property name="max" value="3"/>
+ </module>
+
+ <!--
+ This metric measures the number of instantiations of other classes within the given class.
+ The higher the DAC, the more complex the data structure of the system.
+ -->
+ <module name="ClassDataAbstractionCoupling">
+ <property name="max" value="7"/>
+ </module>
+
+ <!--
+ The number of other classes a class relies on. A high number indicates over-complex
+ class interdependencies that might benefit from refactoring.
+ -->
+ <module name="ClassFanOutComplexity">
+ <property name="max" value="10"/>
+ </module>
+
+ <!--
+ Checks cyclomatic complexity against a specified limit. The complexity is a measure
+ of the minimum number of possible paths through the source and therefore the number of required
+ tests. Consider re-factoring if at or above 10.
+ -->
+ <module name="CyclomaticComplexity">
+ <property name="max" value="15"/>
+ </module>
+
+ <!--
+ The NPATH metric computes the number of possible execution paths through a function. It takes
+ into account the nesting of conditional statements and multi-part boolean expressions
+ (e.g., A && B, C || D, etc.).
+ -->
+ <module name="NPathComplexity">
+ <property name="max" value="200"/>
+ </module>
+
+ <!--
+ Maximum number of throws statements in a method
+ -->
+ <module name="ThrowsCount">
+ <property name="max" value="2"/>
+ </module>
+
+ <!--
+ Maximum if-else depth
+ -->
+ <module name="NestedIfDepth">
+ <property name="max" value="4"/>
+ </module>
+
+ <!--
+ Restricts nested try blocks to a specified depth.
+ -->
+ <module name="NestedTryDepth">
+ <property name="max" value="2"/>
+ </module>
+
+ <!-- ****************************** -->
+ <!-- TODO -->
+ <!-- ****************************** -->
+
+ <!--
+ Checks for uncommented main() methods (debugging leftovers)
+ -->
+ <module name="UncommentedMain"/>
+
+ <!--
+ Check for TODO and similar comments
+ -->
+ <module name="TodoComment">
+ <property name="format" value="(TODO)|(FIXME)|(DOCUMENT ME)"/>
+ </module>
+
+ </module>
+</module>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE import-control PUBLIC
+ "-//Puppy Crawl//DTD Import Control 1.1//EN"
+ "http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
+
+ <!--
+ see http://checkstyle.sourceforge.net/config_imports.html#ImportControl
+ allow/disallow rules propagate to sub-packages
+ unless local-only="true" is specified
+
+ note this can handle only one top-level package, so ImportControl is
+ suppressed for MCview and vamsas in checkstyle-suppress.xml
+ (all rules are suppressed for com/ext/org/uk)
+ -->
+ <import-control pkg="jalview">
+
+ <allow pkg="java"/>
+ <allow pkg="jalview"/>
+ <allow pkg="com.stevesoft.pat"/>
+
+ <subpackage name="appletgui">
+ <disallow pkg="jalview.gui"/>
+ <disallow pkg="jalview.ws"/>
+ <allow pkg="org.jmol"/>
+ <allow pkg="javajs.awt" class="jalview.appletgui.AppletJmolBinding"/>
+ </subpackage>
+
+ <subpackage name="bin">
+ <allow pkg="groovy"/>
+ <allow pkg="org.apache.log4j" class="jalview.bin.Cache"/>
+ <allow pkg="javax.swing" class="jalview.bin.Jalview"/>
+ <allow pkg="netscape.javascript" class="jalview.bin.JalviewLite"/>
+ </subpackage>
+
+ <subpackage name="datamodel">
+ <disallow pkg="jalview.gui"/>
+ <allow pkg="fr.orsay.lri.varna"/>
+ <subpackage name="xdb">
+ <subpackage name="embl">
+ <allow pkg="org.exolab.castor"/>
+ </subpackage>
+ </subpackage>
+ </subpackage>
+
+ <subpackage name="fts">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.ws"/>
+ <allow pkg="org.json"/>
+ <allow pkg="com.sun.jersey"/>
+ </subpackage>
+
+ <subpackage name="gui">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.help"/>
+ <allow pkg="javax.imageio"/>
+ <allow pkg="ext.edu.ucsf"/>
+ <allow pkg="net.miginfocom"/>
+ <allow pkg="org.jibble"/>
+ <allow pkg="org.jmol"/>
+ <allow pkg="org.openscience"/>
+ <allow pkg="org.exolab.castor" class="jalview.gui.Jalview2XML"/>
+ <allow pkg="org.robsite" class="jalview.gui.BlogReader"/>
+ <allow pkg="org.apache.log4j" class="jalview.gui.Console"/>
+ <allow pkg="org.apache.log4j" class="jalview.gui.JalviewAppender"/>
+ <allow pkg="org.biodas" class="jalview.gui.DasSourceBrowser"/>
+ <allow pkg="compbio.metadata" class="jalview.gui.WsJobParameters"/>
+ <allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarna"/>
+ <allow pkg="fr.orsay.lri.varna" class="jalview.gui.AppVarnaBinding"/>
+ <allow pkg="uk.ac.vamsas" class="jalview.gui.VamsasApplication"/>
+ </subpackage>
+
+ <subpackage name="jbgui">
+ <allow pkg="javax.swing"/>
+ <allow pkg="net.miginfocom"/>
+ </subpackage>
+
+ <subpackage name="httpserver">
+ <allow pkg="javax.servlet"/>
+ <allow pkg="org.eclipse.jetty"/>
+ </subpackage>
+
+ <subpackage name="io">
+ <allow pkg="javax.swing"/>
+ <allow pkg="org.jfree"/>
+ <allow pkg="org.json"/>
+ <allow pkg="org.jsoup"/>
+ <allow pkg="uk.ac.ebi"/>
+ <allow pkg="uk.ac.vamsas"/>
+ <allow pkg="fr.orsay.lri.varna"/>
+ <allow pkg="MCview"/>
+ </subpackage>
+
+ <subpackage name="javascript">
+ <allow pkg="netscape.javascript"/>
+ </subpackage>
+
+ <subpackage name="rest">
+ <allow pkg="javax.servlet"/>
+ </subpackage>
+
+ <subpackage name="structure">
+ <allow pkg="MCview"/>
+ </subpackage>
+
+ <subpackage name="util">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.imageio"/>
+ <allow pkg="org.jfree"/>
+ <allow pkg="org.jibble"/>
+ </subpackage>
+
+ <subpackage name="ws">
+ <allow pkg="javax.swing"/>
+ <allow pkg="javax.xml"/>
+ <allow pkg="ext.vamsas"/>
+ <allow pkg="compbio"/>
+ <allow pkg="MCview"/>
+ <allow pkg="org.apache.http"/>
+ <allow pkg="org.apache.james"/>
+ <allow pkg="org.apache.axis"/>
+ <allow pkg="org.biodas.jdas"/>
+ <allow pkg="org.exolab.castor"/>
+ <allow pkg="uk.ac.ebi"/>
+ <allow pkg="vamsas.objects"/>
+ </subpackage>
+
+ </import-control>
\ No newline at end of file
action.create = Create
action.update = Update
action.delete = Delete
-action.snapshot = Snapshot
action.clear = Clear
action.accept = Accept
action.select_ddbb = --- Select Database ---
action.save_as = Save as...
action.save = Save
action.cancel_fetch = Cancel Fetch
-action.save_omit_hidden_columns = Save / Omit Hidden Regions
action.change_font = Change Font
action.change_font_tree_panel = Change Font (Tree Panel)
action.colour = Colour
action.fetch_db_references = Fetch DB References
action.view_flanking_regions = Show flanking regions
label.view_flanking_regions = Show sequence data either side of the subsequences involved in this alignment
-label.str = Str:
-label.seq = Seq:
label.structures_manager = Structures Manager
label.nickname = Nickname:
label.url = URL:
label.input_file_url = Enter URL or Input File
-label.select_feature = Select feature:
+label.select_feature = Select feature
label.name = Name
+label.name\: = Name:
label.name_param = Name: {0}
label.group = Group
+label.group\: = Group:
label.group_name = Group Name
label.group_description = Group Description
label.edit_group_name_description = Edit Group Name/Description
label.colour = Colour:
-label.description = Description:
+label.description = Description
+label.description\: = Description:
label.start = Start:
label.end = End:
label.current_parameter_set_name = Current parameter set name:
label.to_new_alignment = To New Alignment
label.to_this_alignment = Add To This Alignment
label.apply_colour_to_all_groups = Apply Colour To All Groups
-label.modify_identity_thereshold = Modify Identity Threshold...
-label.modify_conservation_thereshold = Modify Conservation Threshold...
+label.modify_identity_threshold = Modify Identity Threshold...
+label.modify_conservation_threshold = Modify Conservation Threshold...
label.input_from_textbox = Input from textbox
label.centre_column_labels = Centre column labels
label.automatic_scrolling = Automatic Scrolling
label.all_but_selected_region = All but Selected Region (Shift+Ctrl+H)
label.selected_region = Selected Region
label.all_sequences_columns = All Sequences and Columns
-label.hide_insertions = Hide columns gapped for selection
label.hide_selected_annotations = Hide selected annotations
label.show_selected_annotations = Show selected annotations
label.group_consensus = Group Consensus
label.font = Font:
label.size = Size:
label.style = Style:
-label.enter_redundancy_threshold = Enter the redundancy threshold
label.calculating = Calculating....
label.modify_conservation_visibility = Modify conservation visibility
label.colour_residues_above_occurence = Colour residues above % occurence
label.example_param = Example: {0}
label.select_file_format_before_saving = You must select a file format before saving!
label.file_format_not_specified = File format not specified
-label.alignment_contains_hidden_columns = The Alignment contains hidden regions (hidden sequences/columns).\nDo you want to save only the visible alignment?
label.couldnt_save_file = Couldn't save file: {0}
label.error_saving_file = Error Saving File
label.remove_from_default_list = Remove from default list?
label.features_can_be_added_from_searches_1 = (Features can be added from searches or
label.features_can_be_added_from_searches_2 = from Jalview / GFF features files)
label.calculating_pca= Calculating PCA
-label.reveal_columns = Reveal Columns
label.jalview_cannot_open_file = Jalview can't open file
label.jalview_applet = Jalview applet
label.loading_data = Loading data
label.calculating_tree = Calculating tree
label.state_queueing = queuing
label.state_running = running
-label.state_complete = complete
label.state_completed = finished
label.state_job_cancelled = job cancelled!!
label.state_job_error = job error!
label.chimera_help = Chimera Help
label.close_viewer = Close Viewer
label.confirm_close_chimera = This will close Jalview''s connection to {0}.<br>Do you want to close the Chimera window as well?
-label.chimera_help = Chimera Help
label.all = All
label.sort_by = Sort alignment by
label.sort_by_score = Sort by Score
label.align_structures_using_linked_alignment_views = Align structures using {0} linked alignment views
label.connect_to_session = Connect to session {0}
label.threshold_feature_display_by_score = Threshold the feature display by score.
-label.threshold_feature_no_thereshold = No Threshold
-label.threshold_feature_above_thereshold = Above Threshold
-label.threshold_feature_below_thereshold = Below Threshold
-label.adjust_thereshold = Adjust threshold
+label.threshold_feature_no_threshold = No Threshold
+label.threshold_feature_above_threshold = Above Threshold
+label.threshold_feature_below_threshold = Below Threshold
+label.adjust_threshold = Adjust threshold
label.toggle_absolute_relative_display_threshold = Toggle between absolute and relative display threshold.
label.display_features_same_type_different_label_using_different_colour = Display features of the same type with a different label using a different colour. (e.g. domain features)
label.select_colour_minimum_value = Select Colour for Minimum Value
label.select_colour_maximum_value = Select Colour for Maximum Value
-label.open_new_jmol_view_with_all_structures_associated_current_selection_superimpose_using_alignment = Open a new structure viewer with all structures associated with the current selection and superimpose them using the alignment.
label.open_url_param = Open URL {0}
label.open_url_seqs_param = Open URL ({0}..) ({1} seqs)
label.load_pdb_file_associate_with_sequence = Load a PDB file and associate it with sequence {0}
label.logo = Logo
label.non_positional_features = List Non-positional Features
label.database_references = List Database References
-label.share_selection_across_views = Share selection across views
-label.scroll_highlighted_regions = Scroll to highlighted regions
+#label.share_selection_across_views = Share selection across views
+#label.scroll_highlighted_regions = Scroll to highlighted regions
label.gap_symbol = Gap Symbol
label.prot_alignment_colour = Protein Alignment Colour
label.nuc_alignment_colour = Nucleotide Alignment Colour
label.adjusting_parameters_for_calculation = Adjusting parameters for existing Calculation
label.2d_rna_structure_line = 2D RNA {0} (alignment)
label.2d_rna_sequence_name = 2D RNA - {0}
-label.edit_name_and_description_current_group = Edit name and description of current group.
-label.view_structure_for = View structure for {0}
-label.view_all_structures = View all {0} structures.
-label.view_all_representative_structures = View all {0} representative structures.
-label.open_new_jmol_view_with_all_representative_structures_associated_current_selection_superimpose_using_alignment = Opens a new structure viewer with all representative structures\nassociated with the current selection\nsuperimposed with the current alignment.
-label.associate_structure_with_sequence = Associate Structure with Sequence
+label.edit_name_and_description_current_group = Edit name and description of current group
label.from_file = From File
label.enter_pdb_id = Enter PDB Id (or pdbid:chaincode)
-label.discover_pdb_ids = Discover PDB IDs
label.text_colour = Text Colour
action.set_text_colour = Text Colour...
label.structure = Structure
-label.view_structure = View Structure
-label.view_protein_structure = View Protein Structure
label.show_pdbstruct_dialog = 3D Structure Data...
label.view_rna_structure = VARNA 2D Structure
label.clustalx_colours = Clustalx colours
label.reverse = Reverse
label.reverse_complement = Reverse Complement
label.linked_view_title = Linked CDS and protein view
-label.align = Align
label.extract_scores = Extract Scores
label.get_cross_refs = Get Cross-References
label.sort_alignment_new_tree = Sort Alignment With New Tree
label.add_local_source = Add Local Source
label.set_as_default = Set as Default
label.show_labels = Show labels
-label.background_colour = Background Colour
action.background_colour = Background Colour...
label.associate_nodes_with = Associate Nodes With
label.jalview_pca_calculation = Jalview PCA Calculation
label.rest_client_submit = {0} using {1}
label.fetch_retrieve_from =Retrieve from {0}</html>
label.fetch_retrieve_from_all_sources = Retrieve from all {0} sources in {1}<br>First is :{2}<html>
-#label.feature_settings_click_drag = <html>Click/drag feature types up or down to change render order.<br/>Double click to select columns containing feature in alignment/current selection<br/>Pressing Alt will select columns outside features rather than inside<br/>Pressing Shift to modify current selection (rather than clear current selection)<br/>Press CTRL or Command/Meta to toggle columns in/outside features<br/></html>
label.feature_settings_click_drag = Drag up or down to change render order.<br/>Double click to select columns containing feature.
label.transparency_tip = Adjust transparency to 'see through' feature colours.
label.opt_and_params_further_details = see further details by right-clicking
label.service_preset = Service Preset
label.run_with_preset = Run {0} with preset
label.view_service_doc_url = <html>View <a href="{0}">{1}</a></html>
-label.submit_sequence = <html>Submit {0} {1} {2} {3} to<br/>{4}</html>
action.by_title_param = By {0}
-label.alignment = Alignment
-label.secondary_structure_prediction = Secondary Structure Prediction
-label.sequence_database_search = Sequence Database Search
-label.analysis = Analysis
-label.protein_disorder = Protein Disorder
label.source_from_db_source = Sources from {0}
label.from_msname = from {0}
label.superpose_with = Superpose with
-action.do = Do
label.scale_label_to_column = Scale Label to Column
label.add_new_row = Add New Row
label.edit_label_description = Edit Label/Description
label.copied_sequences = Copied sequences
label.cut_sequences = Cut Sequences
label.conservation_colour_increment = Conservation Colour Increment ({0})
-label.percentage_identity_thereshold = Percentage Identity Threshold ({0})
+label.percentage_identity_threshold = Percentage Identity Threshold ({0})
label.error_unsupported_owwner_user_colour_scheme = Unsupported owner for User Colour scheme dialog
label.save_alignment_to_file = Save Alignment to file
label.save_features_to_file = Save Features to File
label.saving_vamsas_doc = Saving VAMSAS Document to {0}
label.load_feature_colours = Load Feature Colours
label.save_feature_colours = Save Feature Colour Scheme
-label.dataset_for = {0} Dataset for {1}
label.select_startup_file = Select startup file
label.select_default_browser = Select default web browser
label.save_tree_as_newick = Save tree as newick file
error.implementation_error_sortbyfeature = Implementation Error - sortByFeature method must be one of FEATURE_SCORE, FEATURE_LABEL or FEATURE_DENSITY.
error.not_yet_implemented = Not yet implemented
error.unknown_type_dna_or_pep = Unknown Type {0} - dna or pep are the only allowed values.
-error.implementation_error_dont_know_thereshold_annotationcolourgradient = Implementation error: don't know about threshold setting for current AnnotationColourGradient.
-error.implementation_error_embeddedpopup_not_null = Implementation error - embeddedPopup must be non-null
-error.invalid_colour_for_mycheckbox = Invalid color for MyCheckBox
-error.implementation_error_unrecognised_render_object_for_features_type = Implementation Error: Unrecognised render object {0} for features of type {1}
-error.implementation_error_unsupported_feature_colour_object = Implementation error: Unsupported feature colour object.
+error.implementation_error_dont_know_threshold_annotationcolourgradient = Implementation error: don't know about threshold setting for current AnnotationColourGradient.
error.invalid_separator_parameter = Invalid separator parameter - must be non-zero length
error.alignment_cigararray_not_implemented = Alignment(CigarArray) not yet implemented
-error.weak_sequencei_equivalence_not_yet_implemented = Weak sequenceI equivalence not yet implemented.
-error.implementation_error_can_only_make_alignmnet_from_cigararray = Implementation Error - can only make an alignment view from a CigarArray of sequences.
error.empty_view_cannot_be_updated = empty view cannot be updated.
error.mismatch_between_number_of_sequences_in_block = Mismatch between number of sequences in block {0} ({1}) and the original view ({2})
error.padding_not_yet_implemented = Padding not yet implemented
error.implementation_bug_cigar_operation = Implementation Bug. Cigar Operation {0} {1} not one of {2}, {3}, or {4}.
error.implementation_error_for_new_cigar = Implementation error for new Cigar(SequenceI)
error.implementation_error_cigar_seq_no_operations = Implementation error: {0}th sequence Cigar has no operations.
-error.implementation_error_jmol_getting_data = Implementation error - Jmol seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016
error.implementation_error_no_pdbentry_from_index = Implementation error - no corresponding pdbentry (for index {0}) to add sequences mappings to
error.jmol_version_not_compatible_with_jalview_version = Jmol version {0} is not compatible with this version of Jalview. Report this problem at issues.jalview.org
error.not_implemented_remove = Remove: Not implemented
error.not_implemented_clone = Clone: Not implemented
-error.implementation_error_chimera_getting_data = Implementation error - Chimera seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016
error.call_setprogressbar_before_registering_handler = call setProgressBar before registering the progress bar's handler.
label.cancelled_params = Cancelled {0}
error.implementation_error_cannot_show_view_alignment_frame = Implementation error: cannot show a view from another alignment in an AlignFrame.
-error.implementation_error_dont_know_about_thereshold_setting = Implementation error: don't know about threshold setting for current AnnotationColourGradient.
+error.implementation_error_dont_know_about_threshold_setting = Implementation error: don't know about threshold setting for current AnnotationColourGradient.
error.eps_generation_not_implemented = EPS Generation not yet implemented
error.png_generation_not_implemented = PNG Generation not yet implemented
error.try_join_vamsas_session_another = Trying to join a vamsas session when another is already connected
error.implementation_error_cannot_find_marshaller_for_param_set =Implementation error: Can't find a marshaller for the parameter set
error.implementation_error_old_jalview_object_not_bound =IMPLEMENTATION ERROR: old jalview object is not bound ! ({0})
error.implementation_error_vamsas_doc_class_should_bind_to_type = Implementation Error: Vamsas Document Class {0} should bind to a {1} (found a {2})
-error.implementation_error_jalview_class_should_bind_to_type = Implementation Error: Jalview Class {0} should bind to a {1} (found a {2})
error.invalid_vamsas_rangetype_cannot_resolve_lists = Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!
error.implementation_error_maplist_is_null = Implementation error. MapList is null for initMapType.
error.implementation_error_cannot_have_null_alignment = Implementation error: Cannot have null alignment property key
label.marked = Marked
label.containing = containing
label.not_containing = not containing
-label.not = not
label.no_feature_of_type_found = No features of type {0} found.
label.submission_params = Submission {0}
label.empty_alignment_job = Empty Alignment Job
label.pca_calculating = Calculating PCA
label.select_foreground_colour = Choose foreground colour
label.select_colour_for_text = Select Colour for Text
-label.adjunst_foreground_text_colour_thereshold = Adjust Foreground Text Colour Threshold
+label.adjunst_foreground_text_colour_threshold = Adjust Foreground Text Colour Threshold
label.select_subtree_colour = Select Sub-Tree Colour
label.create_new_sequence_features = Create New Sequence Feature(s)
label.amend_delete_features = Amend/Delete Features for {0}
exception.mismatched_closing_char = Mismatched closing character {0}
exception.mismatched_opening_char = Mismatched opening character {0} at {1}
exception.invalid_datasource_couldnt_obtain_reader = Invalid datasource. Could not obtain Reader
-exception.index_value_not_in_range = {0}: Index value {1} not in range [0..{2}]
exception.unterminated_cigar_string = Unterminated cigar string
exception.unexpected_operation_cigar_string_pos = Unexpected operation {0} in cigar string (position {1} in {2}
exception.couldnt_parse_responde_from_annotated3d_server = Couldn't parse response from Annotate3d server
exception.pfam_no_sequences_found = No sequences found (PFAM input)
exception.stockholm_invalid_format = This file is not in valid STOCKHOLM format: First line does not contain '# STOCKHOLM'
exception.couldnt_parse_sequence_line = Could not parse sequence line: {0}
-exception.error_parsing_line = Error parsing {0}
exception.unknown_annotation_detected = Unknown annotation detected: {0} {1}
exception.couldnt_store_sequence_mappings = Couldn't store sequence mappings for {0}
exception.matrix_too_many_iteration = Too many iterations in {0} (max is {1})
exception.browser_unable_to_locate = Unable to locate browser: {0}
exception.invocation_target_exception_creating_aedesc = InvocationTargetException while creating AEDesc: {0}
exception.illegal_access_building_apple_evt= IllegalAccessException while building AppleEvent: {0}
-exception.instantiation_creating_aedesc = InstantiationException while creating AEDesc: {0}
exception.unable_to_launch_url = Unable to launch URL: {0}
exception.unable_to_create_internet_config = Unable to create an Internet Config instance: {0}
exception.invocation_target_calling_url = InvocationTargetException while calling openURL: {0}
exception.das_source_doesnt_support_sequence_command = Source {0} does not support the sequence command.
exception.invalid_das_source = Invalid das source: {0}
exception.ebiembl_retrieval_failed_on = EBI EMBL XML retrieval failed on {0}:{1}
-label.no_embl_record_found = # No EMBL record retrieved for {0}:{1}
-label.embl_successfully_parsed = # Successfully parsed the {0} queries into an Alignment
exception.no_pdb_records_for_chain = No PDB Records for {0} chain {1}
exception.unexpected_handling_rnaml_translation_for_pdb = Unexpected exception when handling RNAML translation of PDB data
exception.couldnt_recover_sequence_properties_for_alignment = Couldn't recover sequence properties for alignment
label.add_jabaws_url = Add new JABAWS URL
label.news_from_jalview = News from http://www.jalview.org
label.cut_paste_alignmen_file = Cut & Paste Alignment File
-label.enter_redundancy_thereshold = Enter the redundancy threshold
-label.select_dark_light_set_thereshold = <html><i>Select a dark and light text colour, then set the threshold to<br>switch between colours, based on background colour</i></html>
+label.enter_redundancy_threshold = Enter the redundancy threshold
+label.select_dark_light_set_threshold = <html><i>Select a dark and light text colour, then set the threshold to<br>switch between colours, based on background colour</i></html>
label.select_feature_colour = Select Feature Colour
label.delete_all = Delete all sequences
warn.delete_all = <html>Deleting all sequences will close the alignment window.<br>Confirm deletion or Cancel.
label.no_colour_selection_warn = Error saving colour scheme
label.open_split_window? = Would you like to open as a split window, with cDNA and protein linked?
label.open_split_window = Open split window
-label.no_mappings = No mappings found
action.no = No
action.yes = Yes
label.for = for
label.select_by_annotation = Select/Hide Columns by Annotation
action.select_by_annotation = Select/Hide Columns by Annotation...
label.threshold_filter = Threshold Filter
-action.hide = Hide
-action.select = Select
label.alpha_helix = Alpha Helix
label.beta_strand = Beta Strand
label.turn = Turn
label.select_all = Select All
label.structures_filter = Structures Filter
label.search_filter = Search Filter
-label.description = Description
label.include_description= Include Description
action.back = Back
label.hide_insertions = Hide Insertions
label.mark_as_representative = Mark as representative
label.open_jabaws_web_page = Open JABAWS web page
-label.opens_the_jabaws_server_homepage = Opens the JABAWS server's homepage in web browser
label.pdb_sequence_fetcher = PDB Sequence Fetcher
label.result = result
label.results = results
status.obtaining_mapping_with_nw_alignment = Obtaining mapping with NW alignment
status.exporting_alignment_as_x_file = Exporting alignment as {0} file
label.column = Column
-label.sequence = Sequence
label.cant_map_cds = Unable to map CDS to protein\nCDS missing or incomplete
label.operation_failed = Operation failed
action.create = Crear
action.update = Actualizar
action.delete = Borrar
-action.snapshot = Imagen
action.clear = Limpiar
action.accept = Aceptar
action.select_ddbb = --- Seleccionar base de datos ---
action.save_as = Guardar como
action.save = Guardar
action.cancel_fetch = Cancelar búsqueda
-action.save_omit_hidden_columns = Guardar / Omitir las columnas ocultas
action.change_font = Cambiar Fuente
action.change_font_tree_panel = Cambiar fuente (panel del árbol)
action.colour = Color
action.fetch_db_references = Recuperar referencias a base de datos
action.view_flanking_regions = Mostrar flancos
label.view_flanking_regions = Mostrar los datos de la secuencia a ambos lados de las subsecuencias implicadas en este alineamiento
-label.str = Str:
-label.seq = Seq:
label.structures_manager = Administrar estructuras
label.nickname = Sobrenombre:
label.url = URL:
label.input_file_url = Introducir URL en el fichero de entrada
-label.select_feature = Seleccionar función:
-label.name = Nombre:
+label.select_feature = Seleccionar caracterÃstica
+label.name = Nombre
+label.name\: = Nombre:
label.name_param = Nombre: {0}
-label.group = Grupo:
+label.group = Grupo
+label.group\: = Grupo:
label.group_name = Nombre del grupo
label.group_description = Descripción del grupo
label.edit_group_name_description = Editar nombre/descripción del grupo
label.colour = Color:
-label.description = Descripción:
+label.description = Descripción
+label.description\: = Descripción:
label.start = Comenzar:
label.end = Terminar:
label.current_parameter_set_name = Nombre actual del conjunto de parámetros:
label.to_new_alignment = A nuevo alineamiento
label.to_this_alignment = Añadir a este alineamiento
label.apply_colour_to_all_groups = Aplicar color a todos los grupos
-label.modify_identity_thereshold = Modificar el umbral de identidad...
-label.modify_conservation_thereshold = Modificar el umbral de conservación...
+label.modify_identity_threshold = Modificar el umbral de identidad...
+label.modify_conservation_threshold = Modificar el umbral de conservación...
label.input_from_textbox = Introducir desde el cuadro de texto
label.centre_column_labels = Centrar las etiquetas de las columnas
label.automatic_scrolling = Desplazamiento automático
label.about = Acerca de...
label.show_sequence_limits = Mostrar los lÃmites de la secuencia
label.feature_settings = Ajustar funciones...
-label.sequence_features = Funciones de la secuencia
label.all_columns = Todas las columnas
label.all_sequences = Todas las secuencias
label.selected_columns = Columnas seleccionadas
label.font = Fuente:
label.size = Talla:
label.style = Estilo:
-label.enter_redundancy_threshold = Introducir el umbral de redundancia
label.calculating = Calculando....
label.modify_conservation_visibility = Modificar la visibilidad de conservación
label.colour_residues_above_occurence = Residuos de color por encima del % de aparición
label.select_das_service_from_table = Seleccionar servicio DAS de la tabla para leer una descripción completa aquÃ.
label.session_update = Actualizar sesión
label.new_vamsas_session = Nueva sesión Vamsas
-label.load_vamsas_session = Cargar sesión Vamsas
-label.save_vamsas_session = Guardar sesión Vamsas
action.save_vamsas_session = Guardar Sesión Vamsas
label.select_vamsas_session_opened_as_new_vamsas_session= Selecciones una sesión vamsas para abrirla como una nueva sesión.
label.open_saved_vamsas_session = Abrir una sesión VAMSAS guardada
label.example_param = Ejemplo: {0}
label.select_file_format_before_saving = Debe seleccionar un formato de fichero antes de guardar!
label.file_format_not_specified = Formato de fichero no especificado
-label.alignment_contains_hidden_columns = El alineamiento contiene columnas ocultas.\nQuieres guardar s\u00F3lo el alineamiento visible?
label.couldnt_save_file = No se pudo guardar el fichero: {0}
label.error_saving_file = Error guardando el fichero
label.remove_from_default_list = eliminar de la lista de defectuosos?
label.features_can_be_added_from_searches_1 = (Las funciones pueden ser añadidas de búsquedas o
label.features_can_be_added_from_searches_2 = de ficheros de funciones Jalview / GFF)
label.calculating_pca= Calculando PCA
-label.reveal_columns = Mostrar Columnas
label.jalview_cannot_open_file = Jalview no puede abrir el fichero
label.jalview_applet = Aplicación Jalview
label.loading_data = Cargando datos
label.calculating_tree = Calculando árbol
label.state_queueing = En cola
label.state_running = Procesando
-label.state_complete = Completar
label.state_completed = Finalizado
label.state_job_cancelled = ¡Trabajo cancelado!
label.state_job_error = Error del trabajo!
label.load_features_annotations = Cargar caracterÃsticas/anotaciones ...
label.export_features = Exportar caracterÃsticas...
label.export_annotations = Exportar anotaciones ...
-label.jalview_copy = Copiar (sólo Jalview)
-label.jalview_cut = Cortar (sólo Jalview)
label.to_upper_case = Pasar a mayúsculas
label.to_lower_case = Pasar a minúsculas
label.toggle_case = Alternar mayúsculas y minúsculas
label.align_structures_using_linked_alignment_views = Alinear las estructuras utlizando las {0} vistas de alineamiento enlazadas
label.connect_to_session = Conectar a la sesión {0}
label.threshold_feature_display_by_score = Filtrar la caracterÃstica mostrada por puntuación.
-label.threshold_feature_no_thereshold = Sin umbral
-label.threshold_feature_above_thereshold = Por encima del umbral
-label.threshold_feature_below_thereshold = Por debajo del umbral
-label.adjust_thereshold = Ajustar umbral
+label.threshold_feature_no_threshold = Sin umbral
+label.threshold_feature_above_threshold = Por encima del umbral
+label.threshold_feature_below_threshold = Por debajo del umbral
+label.adjust_threshold = Ajustar umbral
label.toggle_absolute_relative_display_threshold = Cambiar entre mostrar el umbral absoluto y el relativo.
label.display_features_same_type_different_label_using_different_colour = Mostrar las caracterÃsticas del mismo tipo con una etiqueta diferente y empleando un color distinto (p.e. caracterÃsticas del dominio)
label.select_colour_minimum_value = Seleccionar el color para el valor mÃnimo
label.select_colour_maximum_value = Seleccionar el color para el valor máximo
-label.open_new_jmol_view_with_all_structures_associated_current_selection_superimpose_using_alignment = Abrir una nueva vista Jmol con todas las estructuras asociadas con la selección acxtual y superponer las utilizando el alineamiento.
label.open_url_param = Abrir URL {0}
label.open_url_seqs_param = Abrir URL ({0}..) ({1} secuencias)
label.load_pdb_file_associate_with_sequence = Cargar un fichero PDB y asociarlo con la secuencia {0}
label.logo = Logo
label.non_positional_features = CaracterÃsticas no posicionales
label.database_references = Referencias a base de datos
-label.share_selection_across_views = Compartir la selección en todas las vistas
-label.scroll_highlighted_regions = Desplazarse hasta las regiones resaltadas
+#label.share_selection_across_views = Compartir la selección en todas las vistas
+#label.scroll_highlighted_regions = Desplazarse hasta las regiones resaltadas
label.gap_symbol = SÃmbolo del hueco
-label.alignment_colour = Color del alineamiento
label.address = Dirección
label.port = Puerto
label.default_browser_unix = Navegador por defecto (Unix)
label.adjusting_parameters_for_calculation = Ajustar los parámetros para el cálculo existente
label.2d_rna_structure_line = 2D RNA {0}
label.2d_rna_sequence_name = 2D RNA - {0}
-label.edit_name_and_description_current_group = Editar el nombre y la descripción del grupo actual.
-label.view_structure_for = Visualizar la estructura para {0}
-label.view_all_structures = Visualizar todas las {0} estructuras.
-label.view_all_representative_structures = Visualizar todas las {0} estructuras representativas.
-label.open_new_jmol_view_with_all_representative_structures_associated_current_selection_superimpose_using_alignment = Abrir una nueva vista de Jmol con todas las estructuras representativas\nasociadas con la selecci\u00F3n actual\nsuperpuesta con el alineamiento actual.
-label.associate_structure_with_sequence = Asociar estructura con la secuencia
+label.edit_name_and_description_current_group = Editar el nombre y la descripción del grupo actual
label.from_file = desde fichero
label.enter_pdb_id = Introducir PDB Id
-label.discover_pdb_ids = Buscar PDB ids
label.text_colour = Color del texto
label.structure = Estructura
-label.view_structure = Visualizar estructura
label.clustalx_colours = Colores de Clustalx
label.above_identity_percentage = Sobre % identidad
label.create_sequence_details_report_annotation_for = Anotación para {0}
label.add_local_source = Añadir fuente local
label.set_as_default = Establecer por defecto
label.show_labels = Mostrar etiquetas
-label.background_colour = Color de fondo
label.associate_nodes_with = Asociar nodos con
label.jalview_pca_calculation = Cálculo del PCA por Jalview
label.link_name = Nombre del enalce
label.service_preset = Preselección del servicio
label.run_with_preset = Ejecutar {0} con preselección
label.view_service_doc_url = Visualizar <a href="{0}">{1}</a></html>
-label.submit_sequence = Enviar {0} {1} {2} {3} a<br/>{4}</html>
action.by_title_param = por {0}
-label.alignment = Alineamiento
-label.secondary_structure_prediction = Predicción de la estructura secundaria
-label.sequence_database_search = Búsqueda en base de datos de secuencias
-label.analysis = Análisis
-label.protein_disorder = Desorden en la proteÃna
label.source_from_db_source = Fuentes de {0}
label.from_msname = de {0}
label.superpose_with = Superponer con...
-action.do = Hacer
label.scale_label_to_column = Ajustar la etiqueta a la columna
label.add_new_row = Añadir nuevo fila
label.edit_label_description = Editar etiqueta/descripción
label.copied_sequences = Secuencias copiadas
label.cut_sequences = Cortar secuencias
label.conservation_colour_increment = Incremento de Conservación del Color ({0})
-label.percentage_identity_thereshold = Umbral del Porcentaje de Identidad ({0})
+label.percentage_identity_threshold = Umbral del Porcentaje de Identidad ({0})
label.error_unsupported_owwner_user_colour_scheme = Propietario no soportado para el diálogo del Esquema Cromático del Usuario
label.save_alignment_to_file = Guardar Alineamiento en fichero
label.save_features_to_file = Guardar CaracterÃsticas en un fichero
label.saving_vamsas_doc = Guardando el documento VAMSAS en {0}
label.load_feature_colours = Cargar colores de caracterÃsticas
label.save_feature_colours = Guardar esquema cromático de caracterÃsticas
-label.dataset_for = {0} conjunto de datos para {1}
label.select_startup_file = Seleccionar fichero de arranque
label.select_default_browser = Seleccionar navegador web por defecto
label.save_tree_as_newick = Guardar árbol como fichero newick
error.implementation_error_sortbyfeature = Error de implementación - sortByFeature debe ser uno de FEATURE_SCORE, FEATURE_LABEL o FEATURE_DENSITY.
error.not_yet_implemented = No se ha implementado todavÃa
error.unknown_type_dna_or_pep = Tipo desconocido {0} - dna o pep son los únicos valores permitidos
-error.implementation_error_dont_know_thereshold_annotationcolourgradient = Error de implementación: no se conoce el valor umbral para el AnnotationColourGradient actual.
-error.implementation_error_embeddedpopup_not_null = Error de implementación - embeddedPopup debe ser no nulo.
-error.invalid_colour_for_mycheckbox = Color no válido para MyCheckBox
-error.implementation_error_unrecognised_render_object_for_features_type = Error de implementación: no se reconoce el objeto de representación {0} para las caracterÃsticas de tipo {1}
-error.implementation_error_unsupported_feature_colour_object = Error de implementación: objeto de color de caracterÃsticas no soportado.
+error.implementation_error_dont_know_threshold_annotationcolourgradient = Error de implementación: no se conoce el valor umbral para el AnnotationColourGradient actual.
error.invalid_separator_parameter = Separador de parámetros no válido - debe tener longitud mayor que cero
error.alignment_cigararray_not_implemented = Alignment(CigarArray) no se ha implementado todavÃa
-error.weak_sequencei_equivalence_not_yet_implemented = Equivalencia débil sequenceI no se ha implementado todavÃa.
-error.implementation_error_can_only_make_alignmnet_from_cigararray = Error de implementación - sólo se puede construir un vista de alineamiento a partir de una CigarArray de secuencias.
error.empty_view_cannot_be_updated = una vista vacÃa no se puede actualizar.
error.mismatch_between_number_of_sequences_in_block = No hay coincidencia entre el número de secuencias en el bloque {0} ({1}) y la vista original ({2})
error.padding_not_yet_implemented = El relleno no se ha implementado todavÃa
error.implementation_bug_cigar_operation = Bug de implementación. La operación Cigar {0} {1} no es ni {2}, ni {3} ni {4}.
error.implementation_error_for_new_cigar = Error de implementación en new Cigar(SequenceI)
error.implementation_error_cigar_seq_no_operations = Error de implementación: la {0}a secuencia Cigar no tiene operaciones.
-error.implementation_error_jmol_getting_data = Error de implementación - Jmol parece estar todavÃa intentando recuperar sus datos - informe de ello en http://issues.jalview.org/browse/JAL-1016
error.implementation_error_no_pdbentry_from_index = Error de implementación - no existe la correspondiente entrada pdb (para el Ãndice {0}) para añadir el mapeo de secuencias a
error.jmol_version_not_compatible_with_jalview_version = La versión {0} de Jmol no es compatible con esta versión de Jalview. Informe de este problema en http://issues.jalview.org
error.not_implemented_remove = Borrar: no implementado
error.not_implemented_clone = Clonar: no implementado
-error.implementation_error_chimera_getting_data = Error de implementación - Chimera parece estar todavÃa intentando recuperar sus datos - informe de ello en http://issues.jalview.org/browse/JAL-1016
error.call_setprogressbar_before_registering_handler = llamada a setProgressBar antes de registrar el manejador de la barra de estado
label.cancelled_params = {0} cancelado
error.implementation_error_cannot_show_view_alignment_frame = Error de implementación: no es posible mostrar una vista de otro alineamiento en un AlignFrame.
-error.implementation_error_dont_know_about_thereshold_setting = Error de implementación: no se conoce la configuración del umbral para el AnnotationColourGradient actual.
+error.implementation_error_dont_know_about_threshold_setting = Error de implementación: no se conoce la configuración del umbral para el AnnotationColourGradient actual.
error.eps_generation_not_implemented = La generación de EPS no se ha implementado todavÃa
error.png_generation_not_implemented = La generación de PNG no se ha implementado todavÃa
error.try_join_vamsas_session_another = Tratando de establecer una sesión VAMSAS cuando ya habÃa otra conectada
error.implementation_error_cannot_find_marshaller_for_param_set =Error de implementación: no puede encontrar un marshaller para el conjunto de parámetros
error.implementation_error_old_jalview_object_not_bound =Error de implementación: ¡el objeto Jalview antiguo no está enlazado! ({0})
error.implementation_error_vamsas_doc_class_should_bind_to_type = Error de implementación: la clase de documento VAMSAS {0} debe enlazar a {1} (pero se ha encontrado que lo está a {2})
-error.implementation_error_jalview_class_should_bind_to_type = Error de implementación: la clase Jalview {0} debe enlazar a {1} (pero se ha encontrado que lo está a {2})
error.invalid_vamsas_rangetype_cannot_resolve_lists = RangeType VAMSAS no válido - ¡no es posible resolver ambas listas de Pos y Seg con los valores elegidos!
error.implementation_error_maplist_is_null = Error de implementación. MapList es nulo en initMapType.
error.implementation_error_cannot_have_null_alignment = Error de implementación: no es posible tener una clave nula en el alineamiento
label.marked = Marcada
label.containing = conteniendo
label.not_containing = no conteniendo
-label.not = no
label.no_feature_of_type_found = No se han encontrado caracterÃsticas del tipo {0}.
label.submission_params = EnvÃo {0}
label.empty_alignment_job = Trabajo de alineamiento vacÃo
label.pca_calculating = Calculando PCA
label.select_foreground_colour = Escoger color del primer plano
label.select_colour_for_text = Seleccione el color del texto
-label.adjunst_foreground_text_colour_thereshold = Ajustar el umbral del color del texto en primer plano
+label.adjunst_foreground_text_colour_threshold = Ajustar el umbral del color del texto en primer plano
label.select_subtree_colour = Seleccioanr el color del sub-árbol
label.create_new_sequence_features = Crear nueva(s) caracterÃstica(s) de secuencia
label.amend_delete_features = Arrelgar/Borrar caracterÃsticas de {0}
exception.mismatched_closing_char = Carácter de cierre discordante {0}
exception.mismatched_opening_char = Carácter de apertura discordante {0} en {1}
exception.invalid_datasource_couldnt_obtain_reader = Fuente de datos no válida. No es posible obtener el Reader
-exception.index_value_not_in_range = {0}: el valor del Ãndice {1} en se encuentra en el rango [0..{2}]
exception.unterminated_cigar_string = Cadena cigar sin terminar
exception.unexpected_operation_cigar_string_pos = Operación no esperada {0} en una cadena cigar (posición {1} en {2})
exception.couldnt_parse_responde_from_annotated3d_server = No es posible parsear la respuesta procedente del servidor Annotate3d
exception.pfam_no_sequences_found = No se han encontrado secuencias (entrada PFAM)
exception.stockholm_invalid_format = Este fichero no es tiene un formato STOCKHOLM válido: la primera lÃnea no contiene '# STOCKHOLM'
exception.couldnt_parse_sequence_line = No es posible parse la lÃnea de secuencia: {0}
-exception.error_parsing_line = Error parseando {0}
exception.unknown_annotation_detected = Anotación desconocida detectada: {0} {1}
exception.couldnt_store_sequence_mappings = No es posible almacenar los mapeos de secuencia para {0}
exception.matrix_too_many_iteration = Demasiadas iteraciones en {0} (el máximo es {1})
exception.browser_unable_to_locate = Imposible encontrar el navegador: {0}
exception.invocation_target_exception_creating_aedesc = InvocationTargetException mientras se creaba AEDesc: {0}
exception.illegal_access_building_apple_evt= IllegalAccessException mientras se construÃa AppleEvent: {0}
-exception.instantiation_creating_aedesc = InstantiationException mientras se creaba AEDesc: {0}
exception.unable_to_launch_url = Imposible lanzar la URL: {0}
exception.unable_to_create_internet_config = Imposible crear una instancia de configuración de Internet: {0}
exception.invocation_target_calling_url = InvocationTargetException mientras se invocaba openURL: {0}
exception.das_source_doesnt_support_sequence_command = La fuente {0} no soporta el comando sequence.
exception.invalid_das_source = Fuente DAS no válida: {0}
exception.ebiembl_retrieval_failed_on = La recuperación de datos EBI EMBL XML ha fallado en {0}:{1}
-label.no_embl_record_found = # No se ha recuperado ningún registro EMBL de {0}:{1}
-label.embl_successfully_parsed = # Se han parseado con éxito las consultas {0} en un alineamiento
exception.no_pdb_records_for_chain = No se han encontrado registros {0} para la cadena {1}
exception.unexpected_handling_rnaml_translation_for_pdb = Excepcion inesperada cuando se traducÃan a RNAML los datos PDB
exception.couldnt_recover_sequence_properties_for_alignment = No es posible recuperar las propiedades de la secuencia para el alineamiento
label.add_jabaws_url = Añadir nueva JABAWS URL
label.news_from_jalview = Noticias de http://www.jalview.org
label.cut_paste_alignmen_file = Cortar & Pegar fichero de alineamiento
-label.enter_redundancy_thereshold = Introducir el umbral de redundancia
-label.select_dark_light_set_thereshold = <i>Seleccionar un color oscuro y un color claro para el texto y establecer el umbral en que<br>cambiar entre colores, basándose en el color de fondo</i>
+label.enter_redundancy_threshold = Introducir el umbral de redundancia
+label.select_dark_light_set_threshold = <i>Seleccionar un color oscuro y un color claro para el texto y establecer el umbral en que<br>cambiar entre colores, basándose en el color de fondo</i>
label.select_feature_colour = Seleccionar color de las caracterÃsticas
label.ignore_gaps_consensus = Ignorar huecos en el consenso
label.show_group_histogram = Mostrar histograma de grupo
info.invalid_msa_notenough=No suficientes datos de sequencia para alinear
label.result=resultado
label.results=resultados
-label.no_mappings=No hay mapeados encontrados
label.struct_from_pdb=Procesar la estructura secundaria PDB
label.hide_selected_annotations=Ocultar anotaciones seleccionados
info.select_annotation_row=Seleccionar Fila de Anotaciones
action.yes=SÃ
label.export_settings=Exportar Ajustes
label.linked_view_title=Vista vinculada de cDNA y proteÃna
-label.view_protein_structure=Ver Estructura Proteica
label.couldnt_read_data=No se pudo leer los datos
status.opening_file=abriendo fichero
label.except_selected_sequences=Todo excepto secuencias seleccionadas
action.export_features=Exportar CaracterÃsticas
error.invalid_regex=Expresión regular inválida
label.autoadd_temp=Añadir anotación factor de temperatura al alineamiento
-tooltip.rnalifold_settings=Modificar la configuración de la predicción RNAAlifold. Úselo para ocultar o mostrar resultados del cálculo de RNA, o cambiar parámetros de el plegado de RNA.
label.chimera_path_tip=Jalview intentará primero las rutas introducidas aquÃ, Y si no las rutas usuales de instalación
label.structure_chooser=Selector de Estructuras
label.structure_chooser_manual_association=Selector de Estructuras - asociación manual
label.show_pdbstruct_dialog=Datos de Estructura 3D...
label.hide_all=Ocultar todos
label.invert=Invertir
-label.pdb_sequence_getcher=Buscador de Secuencias PDB
tooltip.aacon_settings=Cambiar ajustes para cálculos AACon
-label.align=Alinear
label.mark_as_representative=Marcar como representativa
label.include_description=Incluir Descripción
label.for=para
label.protein=ProteÃna
warn.oneseq_msainput_selection=La selección actual sólo contiene una única secuencia. ¿Quieres enviar todas las secuencias para la alineación en su lugar?
label.use_rnaview=Usar RNAView para estructura secondaria
-label.opens_the_jabaws_server_homepage=Abre la página de inicio del servidor JABAWS en navegador
label.search_all=Introducir uno o más valores de búsqueda separados por punto y coma ";" (Nota: buscará en toda la base de datos PDB)
label.confirm_close_chimera=Cerrará la conexión de Jalview a {0}.<br>¿Quieres cerrar la ventana Chimera también?
tooltip.rnalifold_calculations=Se calcularán predicciones de estructura secondaria de RNA para el alineaminento, y se actualizarán si se efectuan cambios
-Calcular predicciónes de estructura secondaria para el alineamiento
+tooltip.rnalifold_settings=Modificar la configuración de la predicción RNAAlifold. Úselo para ocultar o mostrar resultados del cálculo de RNA, o cambiar parámetros de el plegado de RNA.
label.show_selected_annotations=Mostrar anotaciones seleccionadas
status.colouring_chimera=Coloreando Chimera
label.configure_displayed_columns=Configurar Columnas Mostradas
-exception.pdb_server_error=Error desde el servidor PDB
exception.resource_not_be_found=El recurso solicitado no se ha encontrado
label.aacon_calculations=cálculos AACon
label.pdb_web-service_error=Error de servicio web PDB
warn.delete_all=<html>Borrar todas las secuencias cerrará la ventana del alineamiento.<br>Confirmar o Cancelar.
label.select_all=Seleccionar Todos
label.alpha_helix=Hélice Alfa
-label.sequence_details_for=Detalles de secuencia para {0}
label.chimera_help=Ayuda para Chimera
label.find_tip=Buscar alineamiento, selección o IDs de secuencia para una subsecuencia (sin huecos)
-exception.pdb_server_unreachable=Jalview no puede conectar con el servidor PDBE Solr.\nPor favor, asegúrese de que está conectado a Internet y vuelva a intentarlo.
label.structure_viewer=Visualizador de estructura for defecto
label.embbed_biojson=Incrustar BioJSON al exportar HTML
label.transparency_tip=Ajustar la transparencia a "ver a través" los colores de las caracterÃsticas.
info.invalid_msa_input_mininfo=Necesita por lo menos dos secuencias con al menos 3 residuos cada una, sin regiones ocultas entre ellas.
label.chimera_missing=Visualizador de estructura Chimera no encontrado.<br/>Por favor, introduzca la ruta de Chimera,<br/>o descargar e instalar la UCSF Chimera.
label.save_as_biojs_html=Guardar como HTML BioJs
-exception.pdb_rest_service_no_longer_available=Servicios Rest PDB ya no están disponibles!
exception.fts_server_unreachable=Jalview no puede conectar con el servidor {0}. \nPor favor asegúrese de que está conectado a Internet y vuelva a intentarlo.
exception.outofmemory_loading_mmcif_file=Sin memoria al cargar el fichero mmCIF
label.hide_columns_not_containing=Ocultar las columnas que no contengan
status.obtaining_mapping_with_nw_alignment=Obteniendo mapeo por alineamiento Needleman y Wunsch
status.exporting_alignment_as_x_file = Exportando alineamiento como fichero tipo {0}
label.column = Columna
-label.sequence = Secuencia
label.cant_map_cds = No se pudo mapear CDS a proteÃna\nDatos CDS faltantes o incompletos
label.operation_failed = Operación fallada
public class AlignmentUtils
{
+ private static final int CODON_LENGTH = 3;
private static final String SEQUENCE_VARIANT = "sequence_variant:";
private static final String ID = "ID";
* A data model to hold the 'normal' base value at a position, and an optional
* sequence variant feature
*/
- static class DnaVariant
+ static final class DnaVariant
{
- String base;
+ final String base;
SequenceFeature variant;
DnaVariant(String nuc)
{
base = nuc;
+ variant = null;
}
DnaVariant(String nuc, SequenceFeature var)
base = nuc;
variant = var;
}
+
+ public String getSource()
+ {
+ return variant == null ? null : variant.getFeatureGroup();
+ }
}
/**
/*
* cdnaStart/End, proteinStartEnd are base 1 (for dataset sequence mapping)
*/
- final int mappedLength = 3 * aaSeqChars.length;
+ final int mappedLength = CODON_LENGTH * aaSeqChars.length;
int cdnaLength = cdnaSeqChars.length;
int cdnaStart = cdnaSeq.getStart();
int cdnaEnd = cdnaSeq.getEnd();
*/
if (cdnaLength != mappedLength && cdnaLength > 2)
{
- String lastCodon = String.valueOf(cdnaSeqChars, cdnaLength - 3, 3)
+ String lastCodon = String.valueOf(cdnaSeqChars, cdnaLength - CODON_LENGTH, CODON_LENGTH)
.toUpperCase();
for (String stop : ResidueProperties.STOP)
{
if (lastCodon.equals(stop))
{
- cdnaEnd -= 3;
- cdnaLength -= 3;
+ cdnaEnd -= CODON_LENGTH;
+ cdnaLength -= CODON_LENGTH;
break;
}
}
int startOffset = 0;
if (cdnaLength != mappedLength
&& cdnaLength > 2
- && String.valueOf(cdnaSeqChars, 0, 3).toUpperCase()
+ && String.valueOf(cdnaSeqChars, 0, CODON_LENGTH).toUpperCase()
.equals(ResidueProperties.START))
{
- startOffset += 3;
- cdnaStart += 3;
- cdnaLength -= 3;
+ startOffset += CODON_LENGTH;
+ cdnaStart += CODON_LENGTH;
+ cdnaLength -= CODON_LENGTH;
}
if (translatesAs(cdnaSeqChars, startOffset, aaSeqChars))
* protein is translation of dna (+/- start/stop codons)
*/
MapList map = new MapList(new int[] { cdnaStart, cdnaEnd }, new int[]
- { proteinStart, proteinEnd }, 3, 1);
+ { proteinStart, proteinEnd }, CODON_LENGTH, 1);
return map;
}
int aaPos = 0;
int dnaPos = cdnaStart;
for (; dnaPos < cdnaSeqChars.length - 2
- && aaPos < aaSeqChars.length; dnaPos += 3, aaPos++)
+ && aaPos < aaSeqChars.length; dnaPos += CODON_LENGTH, aaPos++)
{
- String codon = String.valueOf(cdnaSeqChars, dnaPos, 3);
+ String codon = String.valueOf(cdnaSeqChars, dnaPos, CODON_LENGTH);
final String translated = ResidueProperties.codonTranslate(codon);
/*
{
return true;
}
- if (dnaPos == cdnaSeqChars.length - 3)
+ if (dnaPos == cdnaSeqChars.length - CODON_LENGTH)
{
- String codon = String.valueOf(cdnaSeqChars, dnaPos, 3);
+ String codon = String.valueOf(cdnaSeqChars, dnaPos, CODON_LENGTH);
if ("STOP".equals(ResidueProperties.codonTranslate(codon)))
{
return true;
}
width = Math.max(dnaSeq.getLength(), width);
}
- int oldwidth, diff;
+ int oldwidth;
+ int diff;
for (SequenceI dnaSeq : dna.getSequences())
{
oldwidth = dnaSeq.getLength();
for (AlignedCodonFrame mapping : dnaMappings)
{
SequenceI peptide = mapping.findAlignedSequence(cdsSeq, protein);
- int peptideLength = peptide.getLength();
if (peptide != null)
{
+ int peptideLength = peptide.getLength();
Mapping map = mapping.getMappingBetween(cdsSeq, peptide);
if (map != null)
{
.getFromRanges());
int mappedToLength = MappingUtils
.getLength(mapList.getToRanges());
- boolean addStopCodon = (cdsLength == mappedFromLength * 3 + 3)
+ boolean addStopCodon = (cdsLength == mappedFromLength * CODON_LENGTH + CODON_LENGTH)
|| (peptide.getDatasetSequence().getLength() == mappedFromLength - 1);
if (cdsLength != mappedToLength && !addStopCodon)
{
/*
* pre-fill the aligned cds sequence with gaps
*/
- char[] alignedCds = new char[peptideLength * 3
- + (addStopCodon ? 3 : 0)];
+ char[] alignedCds = new char[peptideLength * CODON_LENGTH
+ + (addStopCodon ? CODON_LENGTH : 0)];
Arrays.fill(alignedCds, gapChar);
/*
{
if (Comparison.isGap(residue))
{
- cdsCol += 3;
+ cdsCol += CODON_LENGTH;
}
else
{
if (codon == null)
{
// e.g. incomplete start codon, X in peptide
- cdsCol += 3;
+ cdsCol += CODON_LENGTH;
}
else
{
* append stop codon if not mapped from protein,
* closing it up to the end of the mapped sequence
*/
- if (copiedBases == nucleotides.length - 3)
+ if (copiedBases == nucleotides.length - CODON_LENGTH)
{
for (int i = alignedCds.length - 1; i >= 0; i--)
{
break;
}
}
- for (int i = nucleotides.length - 3; i < nucleotides.length; i++)
+ for (int i = nucleotides.length - CODON_LENGTH; i < nucleotides.length; i++)
{
alignedCds[cdsCol++] = nucleotides[i];
}
int mappedFromLength = MappingUtils.getLength(aMapping.getMap()
.getFromRanges());
int dnaLength = seqDss.getLength();
- if (mappedFromLength == dnaLength || mappedFromLength == dnaLength - 3)
+ if (mappedFromLength == dnaLength || mappedFromLength == dnaLength - CODON_LENGTH)
{
return seqDss;
}
for (SequenceToSequenceMapping map : acf.getMappings())
{
Mapping mapping = map.getMapping();
- if (mapping != aMapping && mapping.getMap().getFromRatio() == 3
+ if (mapping != aMapping && mapping.getMap().getFromRatio() == CODON_LENGTH
&& proteinProduct == mapping.getTo()
&& seqDss != map.getFromSeq())
{
/*
* dna length should map to protein (or protein plus stop codon)
*/
- int codesForResidues = mappedDnaLength / 3;
+ int codesForResidues = mappedDnaLength / CODON_LENGTH;
if (codesForResidues == (proteinLength + 1))
{
// assuming extra codon is for STOP and not in peptide
if (codesForResidues == proteinLength)
{
proteinRange.add(new int[] { proteinStart, proteinEnd });
- return new MapList(ranges, proteinRange, 3, 1);
+ return new MapList(ranges, proteinRange, CODON_LENGTH, 1);
}
return null;
}
* are currently ignored here
*/
String trans = codon.contains("-") ? "-"
- : (codon.length() > 3 ? null : ResidueProperties
+ : (codon.length() > CODON_LENGTH ? null : ResidueProperties
.codonTranslate(codon));
if (trans != null && !trans.equals(residue))
{
// set score to 0f so 'graduated colour' option is offered! JAL-2060
SequenceFeature sf = new SequenceFeature(
SequenceOntologyI.SEQUENCE_VARIANT, desc, peptidePos,
- peptidePos, 0f, "Jalview");
+ peptidePos, 0f, var.getSource());
StringBuilder attributes = new StringBuilder(32);
String id = (String) var.variant.getValue(ID);
if (id != null)
}
sf.setValue(ID, id);
attributes.append(ID).append("=").append(id);
- // TODO handle other species variants
+ // TODO handle other species variants JAL-2064
StringBuilder link = new StringBuilder(32);
try
{
* @param dnaToProtein
* @return
*/
+ @SuppressWarnings("unchecked")
static LinkedHashMap<Integer, List<DnaVariant>[]> buildDnaVariantsMap(
SequenceI dnaSeq, MapList dnaToProtein)
{
List<DnaVariant>[] codonVariants = variants.get(peptidePosition);
if (codonVariants == null)
{
- codonVariants = new ArrayList[3];
+ codonVariants = new ArrayList[CODON_LENGTH];
codonVariants[0] = new ArrayList<DnaVariant>();
codonVariants[1] = new ArrayList<DnaVariant>();
codonVariants[2] = new ArrayList<DnaVariant>();
/*
* save nucleotide (and any variant) for each codon position
*/
- for (int codonPos = 0; codonPos < 3; codonPos++)
+ for (int codonPos = 0; codonPos < CODON_LENGTH; codonPos++)
{
String nucleotide = String.valueOf(
dnaSeq.getCharAt(codon[codonPos] - dnaStart))
return false; // should only pass alignments with datasets here
}
- // map from dataset sequence to alignment sequence
- Map<SequenceI, SequenceI> alignedDatasets = new HashMap<SequenceI, SequenceI>();
+ // map from dataset sequence to alignment sequence(s)
+ Map<SequenceI, List<SequenceI>> alignedDatasets = new HashMap<SequenceI, List<SequenceI>>();
for (SequenceI seq : aligned.getSequences())
{
- // JAL-2110: fail if two or more alignment sequences have a common dataset
- // sequence.
- alignedDatasets.put(seq.getDatasetSequence(), seq);
+ SequenceI ds = seq.getDatasetSequence();
+ if (alignedDatasets.get(ds) == null)
+ {
+ alignedDatasets.put(ds, new ArrayList<SequenceI>());
+ }
+ alignedDatasets.get(ds).add(seq);
}
/*
}
/*
- * second pass - copy aligned sequences
+ * second pass - copy aligned sequences;
+ * heuristic rule: pair off sequences in order for the case where
+ * more than one shares the same dataset sequence
*/
for (SequenceI seq : unaligned.getSequences())
{
- SequenceI alignedSequence = alignedDatasets.get(seq
+ List<SequenceI> alignedSequences = alignedDatasets.get(seq
.getDatasetSequence());
- // JAL-2110: fail if two or more alignment sequences have common dataset
- // sequence.
// TODO: getSequenceAsString() will be deprecated in the future
// TODO: need to leave to SequenceI implementor to update gaps
- seq.setSequence(alignedSequence.getSequenceAsString());
+ seq.setSequence(alignedSequences.get(0).getSequenceAsString());
+ if (alignedSequences.size() > 0)
+ {
+ // pop off aligned sequences (except the last one)
+ alignedSequences.remove(0);
+ }
}
return true;
"label.represent_group_with", new Object[] { "" }));
revealAll.setLabel(MessageManager.getString("action.reveal_all"));
revealSeq.setLabel(MessageManager.getString("action.reveal_sequences"));
- menu1.setLabel(MessageManager.getString("label.group") + ":");
+ menu1.setLabel(MessageManager.getString("label.group:"));
add(groupMenu);
this.add(seqMenu);
this.add(hideSeqs);
nucleotideColour.setLabel(MessageManager.getString("label.nucleotide"));
nucleotideColour.addActionListener(this);
modifyPID.setLabel(MessageManager
- .getString("label.modify_identity_thereshold"));
+ .getString("label.modify_identity_threshold"));
modifyPID.addActionListener(this);
modifyConservation.setLabel(MessageManager
- .getString("label.modify_conservation_thereshold"));
+ .getString("label.modify_conservation_threshold"));
modifyConservation.addActionListener(this);
annotationColour.setLabel(MessageManager
.getString("action.by_annotation"));
}
threshold.addItem(MessageManager
- .getString("label.threshold_feature_no_thereshold"));
+ .getString("label.threshold_feature_no_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_above_thereshold"));
+ .getString("label.threshold_feature_above_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_below_thereshold"));
+ .getString("label.threshold_feature_below_threshold"));
if (oldcs instanceof AnnotationColourGradient)
{
default:
throw new Error(
MessageManager
- .getString("error.implementation_error_dont_know_thereshold_annotationcolourgradient"));
+ .getString("error.implementation_error_dont_know_threshold_annotationcolourgradient"));
}
thresholdIsMin.setState(acg.thresholdIsMinMax);
thresholdValue.setText("" + acg.getAnnotationThreshold());
protected void populateThresholdComboBox(Choice threshold)
{
threshold.addItem(MessageManager
- .getString("label.threshold_feature_no_thereshold"));
+ .getString("label.threshold_feature_no_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_above_thereshold"));
+ .getString("label.threshold_feature_above_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_below_thereshold"));
+ .getString("label.threshold_feature_below_threshold"));
}
public jalview.datamodel.AlignmentAnnotation getCurrentAnnotation()
jPanel4.setBackground(Color.white);
threshold.addItemListener(this);
threshold.addItem(MessageManager
- .getString("label.threshold_feature_no_thereshold"));
+ .getString("label.threshold_feature_no_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_above_thereshold"));
+ .getString("label.threshold_feature_above_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_below_thereshold"));
+ .getString("label.threshold_feature_below_threshold"));
thresholdValue.addActionListener(this);
slider.setBackground(Color.white);
slider.setEnabled(false);
tmp = new Panel();
panel.add(tmp);
- tmp.add(new Label("Name: ", Label.RIGHT));
+ tmp.add(new Label(MessageManager.getString("label.name:"), Label.RIGHT));
tmp.add(name);
tmp = new Panel();
panel.add(tmp);
- tmp.add(new Label("Group: ", Label.RIGHT));
+ tmp.add(new Label(MessageManager.getString("label.group:"), Label.RIGHT));
tmp.add(source);
tmp = new Panel();
panel.add(tmp);
- tmp.add(new Label("Colour: ", Label.RIGHT));
+ tmp.add(new Label(MessageManager.getString("label.colour"), Label.RIGHT));
tmp.add(colourPanel);
bigPanel.add(panel, BorderLayout.NORTH);
panel = new Panel();
- panel.add(new Label("Description: ", Label.RIGHT));
+ panel.add(new Label(MessageManager.getString("label.description:"),
+ Label.RIGHT));
panel.add(new ScrollPane().add(description));
if (!newFeatures)
bigPanel.add(panel, BorderLayout.SOUTH);
panel = new Panel();
- panel.add(new Label(" Start:", Label.RIGHT));
+ panel.add(new Label(MessageManager.getString("label.start"),
+ Label.RIGHT));
panel.add(start);
- panel.add(new Label(" End:", Label.RIGHT));
+ panel.add(new Label(MessageManager.getString("label.end"),
+ Label.RIGHT));
panel.add(end);
bigPanel.add(panel, BorderLayout.CENTER);
}
// Fill the selected columns
ColumnSelection cs = av.getColumnSelection();
- gg.setColor(new Color(220, 0, 0));
int avCharWidth = av.getCharWidth();
int avcharHeight = av.getCharHeight();
- for (int sel : cs.getSelected())
+ if (cs != null)
{
- // TODO: JAL-2001 - provide a fast method to list visible selected in a
- // given range
- if (av.hasHiddenColumns())
+ gg.setColor(new Color(220, 0, 0));
+ boolean hasHiddenColumns = cs.hasHiddenColumns();
+ for (int sel : cs.getSelected())
{
- sel = av.getColumnSelection().findColumnPosition(sel);
- }
+ // TODO: JAL-2001 - provide a fast method to list visible selected in a
+ // given range
+ if (hasHiddenColumns)
+ {
+ if (cs.isVisible(sel))
+ {
+ sel = cs.findColumnPosition(sel);
+ }
+ else
+ {
+ continue;
+ }
+ }
- if ((sel >= startx) && (sel <= endx))
- {
- gg.fillRect((sel - startx) * avCharWidth, 0, avCharWidth,
- getSize().height);
+ if ((sel >= startx) && (sel <= endx))
+ {
+ gg.fillRect((sel - startx) * avCharWidth, 0, avCharWidth,
+ getSize().height);
+ }
}
}
if (av.getShowHiddenMarkers())
{
int widthx = 1 + endx - startx;
- for (int i = 0; i < av.getColumnSelection().getHiddenColumns()
- .size(); i++)
+ for (int i = 0; i < cs.getHiddenColumns().size(); i++)
{
- res = av.getColumnSelection().findHiddenRegionPosition(i)
- - startx;
+ res = cs.findHiddenRegionPosition(i) - startx;
if (res < 0 || res > widthx)
{
pid.cs = cs;
}
PIDSlider.setTitle(MessageManager
- .formatMessage("label.percentage_identity_thereshold",
+ .formatMessage("label.percentage_identity_threshold",
new String[] { source }));
if (ap.av.getAlignment().getGroups() != null)
* even if the user changes their locale setting
*/
private static final DateFormat date_format = SimpleDateFormat
- .getDateTimeInstance(SimpleDateFormat.LONG,
- SimpleDateFormat.LONG, Locale.UK);
+ .getDateTimeInstance(SimpleDateFormat.MEDIUM,
+ SimpleDateFormat.MEDIUM, Locale.UK);
/**
* Initialises the Jalview Application Log
// JBPNote this routine could also mark rows, not just columns.
// need a decent query structure to allow all types of feature searches
BitSet bs = new BitSet();
- int alw, alStart;
- SequenceCollectionI sqcol = (viewport.getSelectionGroup() == null ? viewport
- .getAlignment() : viewport.getSelectionGroup());
- alStart = sqcol.getStartRes();
- alw = sqcol.getEndRes() + 1;
+ SequenceCollectionI sqcol = (viewport.getSelectionGroup() == null || extendCurrent) ? viewport
+ .getAlignment() : viewport.getSelectionGroup();
+
+ int nseq = findColumnsWithFeature(featureType, sqcol, bs);
+
+ ColumnSelection cs = viewport.getColumnSelection();
+ if (cs == null)
+ {
+ cs = new ColumnSelection();
+ }
+
+ if (bs.cardinality() > 0 || invert)
+ {
+ boolean changed = cs.markColumns(bs, sqcol.getStartRes(),
+ sqcol.getEndRes(), invert, extendCurrent, toggle);
+ if (changed)
+ {
+ viewport.setColumnSelection(cs);
+ alignPanel.paintAlignment(true);
+ int columnCount = invert ? (sqcol.getEndRes() - sqcol.getStartRes() + 1)
+ - bs.cardinality()
+ : bs.cardinality();
+ avcg.setStatus(MessageManager.formatMessage(
+ "label.view_controller_toggled_marked",
+ new String[] {
+ toggle ? MessageManager.getString("label.toggled")
+ : MessageManager.getString("label.marked"),
+ String.valueOf(columnCount),
+ invert ? MessageManager
+ .getString("label.not_containing")
+ : MessageManager.getString("label.containing"),
+ featureType, Integer.valueOf(nseq).toString() }));
+ return true;
+ }
+ }
+ else
+ {
+ avcg.setStatus(MessageManager.formatMessage(
+ "label.no_feature_of_type_found",
+ new String[] { featureType }));
+ if (!extendCurrent)
+ {
+ cs.clear();
+ alignPanel.paintAlignment(true);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Sets a bit in the BitSet for each column (base 0) in the sequence
+ * collection which includes the specified feature type. Returns the number of
+ * sequences which have the feature in the selected range.
+ *
+ * @param featureType
+ * @param sqcol
+ * @param bs
+ * @return
+ */
+ static int findColumnsWithFeature(String featureType,
+ SequenceCollectionI sqcol, BitSet bs)
+ {
+ final int startPosition = sqcol.getStartRes() + 1; // converted to base 1
+ final int endPosition = sqcol.getEndRes() + 1;
List<SequenceI> seqs = sqcol.getSequences();
int nseq = 0;
for (SequenceI sq : seqs)
{
- int tfeat = 0;
+ boolean sequenceHasFeature = false;
if (sq != null)
{
- SequenceFeature[] sf = sq.getSequenceFeatures();
- if (sf != null)
+ SequenceFeature[] sfs = sq.getSequenceFeatures();
+ if (sfs != null)
{
+ /*
+ * check whether the feature start/end (base 1)
+ * overlaps the selection start/end
+ */
int ist = sq.findIndex(sq.getStart());
int iend = sq.findIndex(sq.getEnd());
- if (iend < alStart || ist > alw)
+ if (iend < startPosition || ist > endPosition)
{
// sequence not in region
continue;
}
- for (SequenceFeature sfpos : sf)
+ for (SequenceFeature sf : sfs)
{
- // future functionalty - featureType == null means mark columns
+ // future functionality - featureType == null means mark columns
// containing all displayed features
- if (sfpos != null && (featureType.equals(sfpos.getType())))
+ if (sf != null && (featureType.equals(sf.getType())))
{
- tfeat++;
// optimisation - could consider 'spos,apos' like cursor argument
// - findIndex wastes time by starting from first character and
// counting
- int i = sq.findIndex(sfpos.getBegin());
- int j = sq.findIndex(sfpos.getEnd());
- if (j < alStart || i > alw)
+ int i = sq.findIndex(sf.getBegin());
+ int j = sq.findIndex(sf.getEnd());
+ if (j < startPosition || i > endPosition)
{
// feature is outside selected region
continue;
}
- if (i < alStart)
+ sequenceHasFeature = true;
+ if (i < startPosition)
{
- i = alStart;
+ i = startPosition;
}
if (i < ist)
{
i = ist;
}
- if (j > alw)
+ if (j > endPosition)
{
- j = alw;
+ j = endPosition;
}
for (; i <= j; i++)
{
- bs.set(i - 1);
+ bs.set(i - 1); // convert to base 0
}
}
}
}
- if (tfeat > 0)
+ if (sequenceHasFeature)
{
nseq++;
}
}
}
- ColumnSelection cs = viewport.getColumnSelection();
- if (bs.cardinality() > 0 || invert)
- {
- boolean changed = false;
- if (cs == null)
- {
- cs = new ColumnSelection();
- }
- else
- {
- if (!extendCurrent)
- {
- changed = !cs.isEmpty();
- cs.clear();
- }
- }
- if (invert)
- {
- // invert only in the currently selected sequence region
- for (int i = bs.nextClearBit(alStart), ibs = bs.nextSetBit(alStart); i >= alStart
- && i < (alw);)
- {
- if (ibs < 0 || i < ibs)
- {
- changed = true;
- if (toggle && cs.contains(i))
- {
- cs.removeElement(i++);
- }
- else
- {
- cs.addElement(i++);
- }
- }
- else
- {
- i = bs.nextClearBit(ibs);
- ibs = bs.nextSetBit(i);
- }
- }
- }
- else
- {
- for (int i = bs.nextSetBit(alStart); i >= alStart; i = bs
- .nextSetBit(i + 1))
- {
- changed = true;
- if (toggle && cs.contains(i))
- {
- cs.removeElement(i);
- }
- else
- {
- cs.addElement(i);
- }
- }
- }
- if (changed)
- {
- viewport.setColumnSelection(cs);
- alignPanel.paintAlignment(true);
- avcg.setStatus(MessageManager.formatMessage(
- "label.view_controller_toggled_marked",
- new String[] {
- MessageManager.getString(toggle ? "label.toggled"
- : "label.marked"),
- String.valueOf(invert ? alw - alStart
- - bs.cardinality() : bs.cardinality()),
- MessageManager
- .getString(invert ? "label.not_containing"
- : "label.containing"),
- featureType, Integer.valueOf(nseq).toString() }));
- return true;
- }
- }
- else
- {
- avcg.setStatus(MessageManager.formatMessage(
- "label.no_feature_of_type_found",
- new String[] { featureType }));
- if (!extendCurrent && cs != null)
- {
- cs.clear();
- alignPanel.paintAlignment(true);
- }
- }
- return false;
+ return nseq;
}
@Override
if (!seqcigararray.isSeqCigarArray())
{
throw new Error(
- MessageManager
- .getString("error.implementation_error_can_only_make_alignmnet_from_cigararray"));
+ "Implementation Error - can only make an alignment view from a CigarArray of sequences.");
}
// contigs = seqcigararray.applyDeletions();
contigs = seqcigararray.getDeletedRegions();
{
case M:
cursor += range[i];
+ break;
case I:
vcursor += range[i];
break;
SequenceI[] seqs)
{
int i, iSize = seqs.length;
- String selection[] = new String[iSize];
+ String selections[] = new String[iSize];
if (hiddenColumns != null && hiddenColumns.size() > 0)
{
for (i = 0; i < iSize; i++)
visibleSeq.append(seqs[i].getSequence(blockStart, end));
}
- selection[i] = visibleSeq.toString();
+ selections[i] = visibleSeq.toString();
}
}
else
{
for (i = 0; i < iSize; i++)
{
- selection[i] = seqs[i].getSequenceAsString(start, end);
+ selections[i] = seqs[i].getSequenceAsString(start, end);
}
}
- return selection;
+ return selections;
}
/**
return true;
}
+ /**
+ * Updates the column selection depending on the parameters, and returns true
+ * if any change was made to the selection
+ *
+ * @param markedColumns
+ * a set identifying marked columns (base 0)
+ * @param startCol
+ * the first column of the range to operate over (base 0)
+ * @param endCol
+ * the last column of the range to operate over (base 0)
+ * @param invert
+ * if true, deselect marked columns and select unmarked
+ * @param extendCurrent
+ * if true, extend rather than replacing the current column selection
+ * @param toggle
+ * if true, toggle the selection state of marked columns
+ *
+ * @return
+ */
+ public boolean markColumns(BitSet markedColumns, int startCol,
+ int endCol, boolean invert, boolean extendCurrent, boolean toggle)
+ {
+ boolean changed = false;
+ if (!extendCurrent && !toggle)
+ {
+ changed = !this.isEmpty();
+ clear();
+ }
+ if (invert)
+ {
+ // invert only in the currently selected sequence region
+ int i = markedColumns.nextClearBit(startCol);
+ int ibs = markedColumns.nextSetBit(startCol);
+ while (i >= startCol && i <= endCol)
+ {
+ if (ibs < 0 || i < ibs)
+ {
+ changed = true;
+ if (toggle && contains(i))
+ {
+ removeElement(i++);
+ }
+ else
+ {
+ addElement(i++);
+ }
+ }
+ else
+ {
+ i = markedColumns.nextClearBit(ibs);
+ ibs = markedColumns.nextSetBit(i);
+ }
+ }
+ }
+ else
+ {
+ int i = markedColumns.nextSetBit(startCol);
+ while (i >= startCol && i <= endCol)
+ {
+ changed = true;
+ if (toggle && contains(i))
+ {
+ removeElement(i);
+ }
+ else
+ {
+ addElement(i);
+ }
+ i = markedColumns.nextSetBit(i + 1);
+ }
+ }
+ return changed;
+ }
+
}
SequenceFeature copy = new SequenceFeature(sf);
copy.setBegin(Math.min(mappedRange[0], mappedRange[1]));
copy.setEnd(Math.max(mappedRange[0], mappedRange[1]));
+ if (".".equals(copy.getFeatureGroup()))
+ {
+ copy.setFeatureGroup(getDbSource());
+ }
targetSequence.addSequenceFeature(copy);
/*
showGroupConservation.setEnabled(!nucleotide);
rnahelicesColour.setEnabled(nucleotide);
purinePyrimidineColour.setEnabled(nucleotide);
- showComplementMenuItem.setText(MessageManager
- .getString(nucleotide ? "label.protein" : "label.nucleotide"));
+ showComplementMenuItem.setText(nucleotide ? MessageManager
+ .getString("label.protein") : MessageManager
+ .getString("label.nucleotide"));
setColourSelected(jalview.bin.Cache.getDefault(
nucleotide ? Preferences.DEFAULT_COLOUR_NUC
: Preferences.DEFAULT_COLOUR_PROT, "None"));
}
/**
- * Set or clear 'Show Sequence Features'
- *
- * @param evt
- * DOCUMENT ME!
- */
- @Override
- public void showSeqFeaturesHeight_actionPerformed(ActionEvent evt)
- {
- viewport.setShowSequenceFeaturesHeight(showSeqFeaturesHeight
- .isSelected());
- if (viewport.isShowSequenceFeaturesHeight())
- {
- // ensure we're actually displaying features
- viewport.setShowSequenceFeatures(true);
- showSeqFeatures.setSelected(true);
- }
- alignPanel.paintAlignment(true);
- if (alignPanel.getOverviewPanel() != null)
- {
- alignPanel.getOverviewPanel().updateOverviewImage();
- }
- }
-
- /**
* Action on toggle of the 'Show annotations' menu item. This shows or hides
* the annotations panel as a whole.
*
// object broker mechanism.
final Vector<JMenu> wsmenu = new Vector<JMenu>();
final IProgressIndicator af = me;
+
+ /*
+ * do not i18n these strings - they are hard-coded in class
+ * compbio.data.msa.Category, Jws2Discoverer.isRecalculable() and
+ * SequenceAnnotationWSClient.initSequenceAnnotationWSClient()
+ */
final JMenu msawsmenu = new JMenu("Alignment");
final JMenu secstrmenu = new JMenu(
"Secondary Structure Prediction");
final JMenu seqsrchmenu = new JMenu("Sequence Database Search");
final JMenu analymenu = new JMenu("Analysis");
final JMenu dismenu = new JMenu("Protein Disorder");
- // final JMenu msawsmenu = new
- // JMenu(MessageManager.getString("label.alignment"));
- // final JMenu secstrmenu = new
- // JMenu(MessageManager.getString("label.secondary_structure_prediction"));
- // final JMenu seqsrchmenu = new
- // JMenu(MessageManager.getString("label.sequence_database_search"));
- // final JMenu analymenu = new
- // JMenu(MessageManager.getString("label.analysis"));
- // final JMenu dismenu = new
- // JMenu(MessageManager.getString("label.protein_disorder"));
// JAL-940 - only show secondary structure prediction services from
// the legacy server
if (// Cache.getDefault("SHOW_JWS1_SERVICES", true)
{
newFrame.hideFeatureColumns(SequenceOntologyI.EXON, false);
}
- String newtitle = String.format("%s %s %s", MessageManager
- .getString(dna ? "label.proteins" : "label.nucleotides"),
+ String newtitle = String.format("%s %s %s",
+ dna ? MessageManager.getString("label.proteins")
+ : MessageManager.getString("label.nucleotides"),
MessageManager.getString("label.for"), getTitle());
newFrame.setTitle(newtitle);
/**
* DOCUMENT ME!
*
- * @return DOCUMENT ME!
- */
- @Override
- public ColumnSelection getColumnSelection()
- {
- return colSel;
- }
-
- /**
- * DOCUMENT ME!
- *
* @param tree
* DOCUMENT ME!
*/
default:
throw new Error(
MessageManager
- .getString("error.implementation_error_dont_know_about_thereshold_setting"));
+ .getString("error.implementation_error_dont_know_about_threshold_setting"));
}
thresholdIsMin.setSelected(acg.thresholdIsMinMax);
thresholdValue.setText("" + acg.getAnnotationThreshold());
protected void populateThresholdComboBox(JComboBox<String> threshold)
{
threshold.addItem(MessageManager
- .getString("label.threshold_feature_no_thereshold"));
+ .getString("label.threshold_feature_no_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_above_thereshold"));
+ .getString("label.threshold_feature_above_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_below_thereshold"));
+ .getString("label.threshold_feature_below_threshold"));
}
protected void seqAssociated_actionPerformed(ActionEvent arg0,
seqs.setSelected(seqsrc);
JPanel panel = new JPanel(new BorderLayout());
JPanel pane12 = new JPanel(new BorderLayout());
- pane12.add(new JLabel(MessageManager.getString("label.name")),
+ pane12.add(new JLabel(MessageManager.getString("label.name:")),
BorderLayout.CENTER);
pane12.add(nametf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.NORTH);
threshold.setToolTipText(MessageManager
.getString("label.threshold_feature_display_by_score"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_no_thereshold")); // index 0
+ .getString("label.threshold_feature_no_threshold")); // index 0
threshold.addItem(MessageManager
- .getString("label.threshold_feature_above_thereshold")); // index 1
+ .getString("label.threshold_feature_above_threshold")); // index 1
threshold.addItem(MessageManager
- .getString("label.threshold_feature_below_thereshold")); // index 2
+ .getString("label.threshold_feature_below_threshold")); // index 2
jPanel3.setLayout(flowLayout2);
thresholdValue.addActionListener(new ActionListener()
{
slider.setOpaque(false);
slider.setPreferredSize(new Dimension(100, 32));
slider.setToolTipText(MessageManager
- .getString("label.adjust_thereshold"));
+ .getString("label.adjust_threshold"));
thresholdValue.setEnabled(false);
thresholdValue.setColumns(7);
jPanel3.setBackground(Color.white);
{
panel = new JPanel(new GridLayout(4, 1));
tmp = new JPanel();
- tmp.add(new JLabel(MessageManager.getString("label.select_feature")));
+ tmp.add(new JLabel(MessageManager.getString("label.select_feature")
+ + ":"));
overlaps = new JComboBox();
for (int i = 0; i < features.length; i++)
{
tmp = new JPanel();
panel.add(tmp);
- tmp.add(new JLabel(MessageManager.getString("label.name"), JLabel.RIGHT));
+ tmp.add(new JLabel(MessageManager.getString("label.name:"),
+ JLabel.RIGHT));
tmp.add(name);
tmp = new JPanel();
panel.add(tmp);
- tmp.add(new JLabel(MessageManager.getString("label.group") + ":",
+ tmp.add(new JLabel(MessageManager.getString("label.group:"),
JLabel.RIGHT));
tmp.add(source);
bigPanel.add(panel, BorderLayout.NORTH);
panel = new JPanel();
- panel.add(new JLabel(MessageManager.getString("label.description"),
+ panel.add(new JLabel(MessageManager.getString("label.description:"),
JLabel.RIGHT));
description.setFont(JvSwingUtils.getTextAreaFont());
description.setLineWrap(true);
public void mousePressed(MouseEvent evt)
{
selectedRow = table.rowAtPoint(evt.getPoint());
- if (SwingUtilities.isRightMouseButton(evt))
+ boolean ctrlDown = Platform.isControlDown(evt);
+ if (SwingUtilities.isRightMouseButton(evt) && !ctrlDown)
{
popupSort(selectedRow, (String) table.getValueAt(selectedRow, 0),
table.getValueAt(selectedRow, 1), fr.getMinMax(),
else if (evt.getClickCount() == 2)
{
boolean invertSelection = evt.isAltDown();
- boolean ctrlDown = Platform.isControlDown(evt);
boolean toggleSelection = ctrlDown;
- boolean extendSelection = evt.isShiftDown() || ctrlDown;
+ boolean extendSelection = evt.isShiftDown();
fr.ap.alignFrame.avc.markColumnsContainingFeatures(
invertSelection, extendSelection, toggleSelection,
(String) table.getValueAt(selectedRow, 0));
init = false;
}
+ @Override
public void smoothFont_actionPerformed(ActionEvent e)
{
ap.av.antiAlias = smoothFont.isSelected();
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void ok_actionPerformed(ActionEvent e)
{
try
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void cancel_actionPerformed(ActionEvent e)
{
if (ap != null)
double iw = iBounds.getWidth();
if (mw < 1 || iw < 1)
{
- final String messageKey = iBounds.getHeight() < 1 ? "label.font_doesnt_have_letters_defined"
- : "label.font_too_small";
- JOptionPane.showInternalMessageDialog(this,
- MessageManager.getString(messageKey),
+ String message = iBounds.getHeight() < 1 ? MessageManager
+ .getString("label.font_doesnt_have_letters_defined")
+ : MessageManager.getString("label.font_too_small");
+ JOptionPane.showInternalMessageDialog(this, message,
MessageManager.getString("label.invalid_font"),
JOptionPane.WARNING_MESSAGE);
/*
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void fontName_actionPerformed(ActionEvent e)
{
if (init)
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void fontSize_actionPerformed(ActionEvent e)
{
if (init)
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void fontStyle_actionPerformed(ActionEvent e)
{
if (init)
*
* @param e
*/
+ @Override
public void defaultButton_actionPerformed(ActionEvent e)
{
Cache.setProperty("FONT_NAME", fontName.getSelectedItem().toString());
{
// create an entry for this score matrix for use in PCA
JCheckBoxMenuItem jm = new JCheckBoxMenuItem();
- jm.setText(MessageManager
- .getStringOrReturn("label.score_model", sm));
+ jm.setText(MessageManager.getStringOrReturn("label.score_model_",
+ sm));
jm.setSelected(pcaModel.getScore_matrix().equals(sm));
if ((ResidueProperties.scoreMatrices.get(sm).isDNA() && ResidueProperties.scoreMatrices
.get(sm).isProtein())
if (sg != null && sg.getSize() > 0)
{
- groupName.setText(MessageManager.formatMessage("label.name_param",
- new Object[] { sg.getName() }));
groupName.setText(MessageManager
.getString("label.edit_name_and_description_current_group"));
*/
private void jbInit() throws Exception
{
- groupMenu.setText(MessageManager.getString("label.group"));
groupMenu.setText(MessageManager.getString("label.selection"));
groupName.setText(MessageManager.getString("label.name"));
groupName.addActionListener(new java.awt.event.ActionListener()
progress = null;
label.setText(MessageManager
- .getString("label.enter_redundancy_thereshold"));
+ .getString("label.enter_redundancy_threshold"));
slider.setVisible(true);
applyButton.setEnabled(true);
valueField.setVisible(true);
}
PIDSlider.setTitle(MessageManager
- .formatMessage("label.percentage_identity_thereshold",
+ .formatMessage("label.percentage_identity_threshold",
new String[] { source }));
if (ap.av.getAlignment().getGroups() != null)
actioned = true;
e.consume();
}
+ break;
default:
}
return actioned;
new JLabel(
"<html>"
+ MessageManager
- .getString("label.select_dark_light_set_thereshold")
+ .getString("label.select_dark_light_set_threshold")
+ "</html>"), BorderLayout.NORTH);
panel.add(col1);
panel.add(slider);
ap,
bigpanel,
MessageManager
- .getString("label.adjunst_foreground_text_colour_thereshold"),
+ .getString("label.adjunst_foreground_text_colour_threshold"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE, null, null, null);
return this.formatSequences(format, alignment, suffix);
}
- public AlignmentI readFile(String inFile, String type, String format)
- throws java.io.IOException
- {
- AlignmentI al = super.readFile(inFile, type, format);
- return al;
- }
-
- public AlignmentI readFromFile(FileParse source, String format)
- throws java.io.IOException
- {
- AlignmentI al = super.readFromFile(source, format);
- return al;
- }
-
/**
* validate format is valid for IO in Application. This is basically the
* AppletFormatAdapter.isValidFormat call with additional checks for
@Override
public void configureForView(AlignmentViewPanel avpanel)
{
+ if (avpanel == null)
+ {
+ return;
+ }
super.configureForView(avpanel);
AlignViewportI viewport = avpanel.getAlignViewport();
AlignmentI alignment = viewport.getAlignment();
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
+import jalview.util.Comparison;
import jalview.util.Format;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Hashtable;
+import java.util.List;
import java.util.StringTokenizer;
-import java.util.Vector;
/**
* DOCUMENT ME!
}
/**
- * DOCUMENT ME!
+ * Read and parse MSF sequence data
*/
@Override
public void parse() throws IOException
{
- int i = 0;
boolean seqFlag = false;
- String key = new String();
- Vector headers = new Vector();
- Hashtable seqhash = new Hashtable();
- String line;
+ List<String> headers = new ArrayList<String>();
+ Hashtable<String, StringBuilder> seqhash = new Hashtable<String, StringBuilder>();
try
{
+ String line;
while ((line = nextLine()) != null)
{
StringTokenizer str = new StringTokenizer(line);
+ String key = null;
while (str.hasMoreTokens())
{
String inStr = str.nextToken();
if (inStr.indexOf("Name:") != -1)
{
key = str.nextToken();
- headers.addElement(key);
+ headers.add(key);
}
- // if line has // set SeqFlag to 1 so we know sequences are coming
+ // if line has // set SeqFlag so we know sequences are coming
if (inStr.indexOf("//") != -1)
{
seqFlag = true;
}
// Process lines as sequence lines if seqFlag is set
- if ((inStr.indexOf("//") == -1) && (seqFlag == true))
+ if ((inStr.indexOf("//") == -1) && seqFlag)
{
- // seqeunce id is the first field
+ // sequence id is the first field
key = inStr;
- StringBuffer tempseq;
+ StringBuilder tempseq;
// Get sequence from hash if it exists
if (seqhash.containsKey(key))
{
- tempseq = (StringBuffer) seqhash.get(key);
+ tempseq = seqhash.get(key);
}
else
{
- tempseq = new StringBuffer();
+ tempseq = new StringBuilder(64);
seqhash.put(key, tempseq);
}
while (str.hasMoreTokens())
{
// append the word to the sequence
- tempseq.append(str.nextToken());
+ String sequenceBlock = str.nextToken();
+ tempseq.append(sequenceBlock);
}
}
}
this.noSeqs = headers.size();
// Add sequences to the hash
- for (i = 0; i < headers.size(); i++)
+ for (int i = 0; i < headers.size(); i++)
{
- if (seqhash.get(headers.elementAt(i)) != null)
+ if (seqhash.get(headers.get(i)) != null)
{
- String head = headers.elementAt(i).toString();
+ String head = headers.get(i);
String seq = seqhash.get(head).toString();
if (maxLength < head.length())
maxLength = head.length();
}
- // Replace ~ with a sensible gap character
- seq = seq.replace('~', '-');
+ /*
+ * replace ~ (leading/trailing positions) with the gap character;
+ * use '.' as this is the internal gap character required by MSF
+ */
+ seq = seq.replace('~', '.');
Sequence newSeq = parseId(head);
else
{
System.err.println("MSFFile Parser: Can't find sequence for "
- + headers.elementAt(i));
+ + headers.get(i));
}
}
}
*
* @return DOCUMENT ME!
*/
- public String print(SequenceI[] seqs)
+ public String print(SequenceI[] sqs)
{
- boolean is_NA = jalview.util.Comparison.isNucleotide(seqs);
+ boolean is_NA = Comparison.isNucleotide(sqs);
- SequenceI[] s = new SequenceI[seqs.length];
+ SequenceI[] s = new SequenceI[sqs.length];
- StringBuffer out = new StringBuffer("!!" + (is_NA ? "NA" : "AA")
- + "_MULTIPLE_ALIGNMENT 1.0");
+ StringBuilder out = new StringBuilder(256);
+ out.append("!!").append(is_NA ? "NA" : "AA")
+ .append("_MULTIPLE_ALIGNMENT 1.0");
// TODO: JBPNote : Jalview doesn't remember NA or AA yet.
out.append(newline);
out.append(newline);
int maxid = 0;
int i = 0;
- while ((i < seqs.length) && (seqs[i] != null))
+ while ((i < sqs.length) && (sqs[i] != null))
{
- // Replace all internal gaps with . and external spaces with ~
- s[i] = new Sequence(seqs[i].getName(), seqs[i].getSequenceAsString()
- .replace('-', '.'), seqs[i].getStart(), seqs[i].getEnd());
+ /*
+ * modify to MSF format: uses '.' for internal gaps,
+ * and '~' for leading or trailing gaps
+ */
+ String seqString = sqs[i].getSequenceAsString()
+ .replace('-', '.');
- StringBuffer sb = new StringBuffer();
- sb.append(s[i].getSequence());
+ StringBuilder sb = new StringBuilder(seqString);
for (int ii = 0; ii < sb.length(); ii++)
{
break;
}
}
+ s[i] = new Sequence(sqs[i].getName(), sb.toString(),
+ sqs[i].getStart(), sqs[i].getEnd());
- s[i].setSequence(sb.toString());
-
- if (s[i].getSequence().length > max)
+ if (sb.length() > max)
{
- max = s[i].getSequence().length;
+ max = sb.length();
}
i++;
}
if (spces + 1 < line.length())
{
- tempseq.append(line.substring(spces + 1));
+ tempseq.append(line.substring(spces + 1).trim());
}
}
}
else
{
- // throw new IOException(MessageManager.formatMessage(
- // "exception.error_parsing_line", new String[] { line }));
+ // throw new IOException("Error parsing " + line);
System.err.println(">> missing annotation: " + line);
}
}
public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem();
- public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
-
JMenuItem copy = new JMenuItem();
JMenuItem cut = new JMenuItem();
});
JMenuItem modifyPID = new JMenuItem(
- MessageManager.getString("label.modify_identity_thereshold"));
+ MessageManager.getString("label.modify_identity_threshold"));
modifyPID.addActionListener(new ActionListener()
{
@Override
}
});
modifyConservation.setText(MessageManager
- .getString("label.modify_conservation_thereshold"));
+ .getString("label.modify_conservation_threshold"));
modifyConservation.addActionListener(new ActionListener()
{
@Override
}
- protected void showSeqFeaturesHeight_actionPerformed(
- ActionEvent actionEvent)
- {
- // TODO Auto-generated method stub
-
- }
-
protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
}
}
evt.consume();
+ break;
default:
return;
}
validEnd);
break;
}
-
+ // no break if isRNA - falls through to drawNotCanonicalAnnot!
case 'E':
if (!isRNA)
{
validEnd);
break;
}
+ // no break if isRNA - fall through to drawNotCanonicalAnnot!
case '{':
case '}':
{
validRes = true;
}
-
// x ++;
if (row.hasIcons)
startRes, column, validRes, validEnd);
break;
}
+ // no break if isRNA - fall through to drawNotCanonicalAnnot!
case 'E':
if (!isRNA)
startRes, column, validRes, validEnd);
break;
}
+ // no break if isRNA - fall through to drawNotCanonicalAnnot!
case '(':
case ')': // Stem case for RNA secondary structure
*/
public class ScaleRenderer
{
- public class ScaleMark
+ public final class ScaleMark
{
public final boolean major;
import jalview.ws.dbsources.Pdb;
import jalview.ws.dbsources.PfamFull;
import jalview.ws.dbsources.PfamSeed;
-import jalview.ws.dbsources.RfamFull;
import jalview.ws.dbsources.RfamSeed;
import jalview.ws.dbsources.Uniprot;
-import jalview.ws.dbsources.UniprotName;
import jalview.ws.dbsources.das.api.jalviewSourceI;
import jalview.ws.seqfetcher.ASequenceFetcher;
import jalview.ws.seqfetcher.DbSourceProxy;
addDBRefSourceImpl(EmblSource.class);
addDBRefSourceImpl(EmblCdsSource.class);
addDBRefSourceImpl(Uniprot.class);
- addDBRefSourceImpl(UniprotName.class);
addDBRefSourceImpl(Pdb.class);
addDBRefSourceImpl(PfamFull.class);
addDBRefSourceImpl(PfamSeed.class);
addDBRefSourceImpl(RfamSeed.class);
+
if (addDas)
{
registerDasSequenceSources();
public void testComputePeptideVariants()
{
/*
- * scenario: AAATTTCCC codes for KFP, with variants
- * GAA -> E
- * CAA -> Q
- * AAG synonymous
- * AAT -> N
- * TTC synonymous
- * CAC,CGC -> H,R (as one variant)
+ * scenario: AAATTTCCC codes for KFP
+ * variants:
+ * GAA -> E source: Ensembl
+ * CAA -> Q source: dbSNP
+ * AAG synonymous source: COSMIC
+ * AAT -> N source: Ensembl
+ * ...TTC synonymous source: dbSNP
+ * ......CAC,CGC -> H,R source: COSMIC
+ * (one variant with two alleles)
*/
SequenceI peptide = new Sequence("pep/10-12", "KFP");
* two distinct variants for codon 1 position 1
* second one has clinical significance
*/
+ String ensembl = "Ensembl";
+ String dbSnp = "dbSNP";
+ String cosmic = "COSMIC";
SequenceFeature sf1 = new SequenceFeature("sequence_variant", "", 1, 1,
- 0f, null);
+ 0f, ensembl);
sf1.setValue("alleles", "A,G"); // GAA -> E
sf1.setValue("ID", "var1.125A>G");
SequenceFeature sf2 = new SequenceFeature("sequence_variant", "", 1, 1,
- 0f, null);
+ 0f, dbSnp);
sf2.setValue("alleles", "A,C"); // CAA -> Q
sf2.setValue("ID", "var2");
sf2.setValue("clinical_significance", "Dodgy");
SequenceFeature sf3 = new SequenceFeature("sequence_variant", "", 3, 3,
- 0f, null);
+ 0f, cosmic);
sf3.setValue("alleles", "A,G"); // synonymous
sf3.setValue("ID", "var3");
sf3.setValue("clinical_significance", "None");
SequenceFeature sf4 = new SequenceFeature("sequence_variant", "", 3, 3,
- 0f, null);
+ 0f, ensembl);
sf4.setValue("alleles", "A,T"); // AAT -> N
sf4.setValue("ID", "sequence_variant:var4"); // prefix gets stripped off
sf4.setValue("clinical_significance", "Benign");
SequenceFeature sf5 = new SequenceFeature("sequence_variant", "", 6, 6,
- 0f, null);
+ 0f, dbSnp);
sf5.setValue("alleles", "T,C"); // synonymous
sf5.setValue("ID", "var5");
sf5.setValue("clinical_significance", "Bad");
SequenceFeature sf6 = new SequenceFeature("sequence_variant", "", 8, 8,
- 0f, null);
+ 0f, cosmic);
sf6.setValue("alleles", "C,A,G"); // CAC,CGC -> H,R
sf6.setValue("ID", "var6");
sf6.setValue("clinical_significance", "Good");
/*
* verify added sequence features for
- * var1 K -> E
- * var2 K -> Q
- * var4 K -> N
- * var6 P -> H
- * var6 P -> R
+ * var1 K -> E Ensembl
+ * var2 K -> Q dbSNP
+ * var4 K -> N Ensembl
+ * var6 P -> H COSMIC
+ * var6 P -> R COSMIC
*/
SequenceFeature[] sfs = peptide.getSequenceFeatures();
assertEquals(5, sfs.length);
+
SequenceFeature sf = sfs[0];
assertEquals(1, sf.getBegin());
assertEquals(1, sf.getEnd());
assertEquals(
"p.Lys1Glu var1.125A>G|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var1.125A%3EG",
sf.links.get(0));
- assertEquals("Jalview", sf.getFeatureGroup());
+ assertEquals(ensembl, sf.getFeatureGroup());
+
sf = sfs[1];
assertEquals(1, sf.getBegin());
assertEquals(1, sf.getEnd());
assertEquals(
"p.Lys1Gln var2|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var2",
sf.links.get(0));
- assertEquals("Jalview", sf.getFeatureGroup());
+ assertEquals(dbSnp, sf.getFeatureGroup());
+
sf = sfs[2];
assertEquals(1, sf.getBegin());
assertEquals(1, sf.getEnd());
assertEquals(
"p.Lys1Asn var4|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var4",
sf.links.get(0));
- assertEquals("Jalview", sf.getFeatureGroup());
+ assertEquals(ensembl, sf.getFeatureGroup());
+
+ // var5 generates two distinct protein variant features
sf = sfs[3];
assertEquals(3, sf.getBegin());
assertEquals(3, sf.getEnd());
assertEquals(
"p.Pro3His var6|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var6",
sf.links.get(0));
- // var5 generates two distinct protein variant features
- assertEquals("Jalview", sf.getFeatureGroup());
+ assertEquals(cosmic, sf.getFeatureGroup());
+
sf = sfs[4];
assertEquals(3, sf.getBegin());
assertEquals(3, sf.getEnd());
assertEquals(
"p.Pro3Arg var6|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=var6",
sf.links.get(0));
- assertEquals("Jalview", sf.getFeatureGroup());
+ assertEquals(cosmic, sf.getFeatureGroup());
}
/**
{
SequenceI dna1 = new Sequence("dna1", "cccGGGTTTaaa");
SequenceI dna2 = new Sequence("dna2", "CCCgggtttAAA");
- SequenceI as1 = dna1.deriveSequence(), as2 = dna1.deriveSequence()
- .getSubSequence(3, 7), as3 = dna2.deriveSequence();
+ SequenceI as1 = dna1.deriveSequence();
+ SequenceI as2 = dna1.deriveSequence().getSubSequence(3, 7);
+ SequenceI as3 = dna2.deriveSequence();
as1.insertCharAt(6, 5, '-');
String s_as1 = as1.getSequenceAsString();
as2.insertCharAt(6, 5, '-');
// why do we need to cast this still ?
((Alignment) aligned).createDatasetAlignment();
- SequenceI uas1 = dna1.deriveSequence(), uas2 = dna1.deriveSequence()
- .getSubSequence(3, 7), uas3 = dna2.deriveSequence();
+ SequenceI uas1 = dna1.deriveSequence();
+ SequenceI uas2 = dna1.deriveSequence().getSubSequence(3, 7);
+ SequenceI uas3 = dna2.deriveSequence();
AlignmentI tobealigned = new Alignment(new SequenceI[] { uas1, uas2,
uas3 });
((Alignment) tobealigned).createDatasetAlignment();
--- /dev/null
+package jalview.controller;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertTrue;
+
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+
+import java.util.BitSet;
+
+import org.testng.annotations.Test;
+
+public class AlignViewControllerTest
+{
+ @Test(groups = "Functional")
+ public void testFindColumnsWithFeature()
+ {
+ SequenceI seq1 = new Sequence("seq1", "aMMMaaaaaaaaaaaaaaaa");
+ SequenceI seq2 = new Sequence("seq2", "aaaMMMMMMMaaaaaaaaaa");
+ SequenceI seq3 = new Sequence("seq3", "aaaaaaaaaaMMMMMaaaaa");
+ SequenceI seq4 = new Sequence("seq3", "aaaaaaaaaaaaaaaaaaaa");
+
+ /*
+ * features start/end are base 1
+ */
+ seq1.addSequenceFeature(new SequenceFeature("Metal", "desc", 2, 4, 0f,
+ null));
+ seq1.addSequenceFeature(new SequenceFeature("Helix", "desc", 1, 15, 0f,
+ null));
+ seq2.addSequenceFeature(new SequenceFeature("Metal", "desc", 4, 10, 0f,
+ null));
+ seq3.addSequenceFeature(new SequenceFeature("Metal", "desc", 11, 15,
+ 0f, null));
+
+ /*
+ * select the first three columns --> Metal in seq1 2-3
+ */
+ SequenceGroup sg = new SequenceGroup();
+ sg.setStartRes(0); // base 0
+ sg.setEndRes(2);
+ sg.addSequence(seq1, false);
+ sg.addSequence(seq2, false);
+ sg.addSequence(seq3, false);
+ sg.addSequence(seq4, false);
+
+ BitSet bs = new BitSet();
+ int seqCount = AlignViewController.findColumnsWithFeature("Metal", sg,
+ bs);
+ assertEquals(1, seqCount);
+ assertEquals(2, bs.cardinality());
+ assertTrue(bs.get(1));
+ assertTrue(bs.get(2));
+
+ /*
+ * select the first four columns: Metal in seq1 2:4, seq2 4:4
+ */
+ sg.setEndRes(3);
+ bs.clear();
+ seqCount = AlignViewController.findColumnsWithFeature("Metal", sg,
+ bs);
+ assertEquals(2, seqCount);
+ assertEquals(3, bs.cardinality());
+ assertTrue(bs.get(1));
+ assertTrue(bs.get(2));
+ assertTrue(bs.get(3));
+
+ /*
+ * select column 11: Metal in seq3 only
+ */
+ sg.setStartRes(10);
+ sg.setEndRes(10);
+ bs.clear();
+ seqCount = AlignViewController.findColumnsWithFeature("Metal", sg, bs);
+ assertEquals(1, seqCount);
+ assertEquals(1, bs.cardinality());
+ assertTrue(bs.get(10));
+
+ /*
+ * select columns 16-20: no Metal feature
+ */
+ sg.setStartRes(15);
+ sg.setEndRes(19);
+ bs.clear();
+ seqCount = AlignViewController.findColumnsWithFeature("Metal", sg, bs);
+ assertEquals(0, seqCount);
+ assertEquals(0, bs.cardinality());
+
+ /*
+ * look for a feature that isn't there
+ */
+ sg.setStartRes(0);
+ sg.setEndRes(19);
+ bs.clear();
+ seqCount = AlignViewController.findColumnsWithFeature("Pfam", sg, bs);
+ assertEquals(0, seqCount);
+ assertEquals(0, bs.cardinality());
+ }
+}
import static org.testng.AssertJUnit.assertTrue;
import java.util.Arrays;
+import java.util.BitSet;
import java.util.List;
import org.testng.annotations.Test;
assertEquals(21, selected3.get(1).intValue());
assertEquals(1, selected3.get(2).intValue());
}
+
+ @Test(groups = "Functional")
+ public void testMarkColumns()
+ {
+ ColumnSelection cs = new ColumnSelection();
+ cs.addElement(5); // this will be cleared
+ BitSet toMark = new BitSet();
+ toMark.set(1);
+ toMark.set(3);
+ toMark.set(6);
+ toMark.set(9);
+
+ assertTrue(cs.markColumns(toMark, 3, 8, false, false, false));
+ List<Integer> selected = cs.getSelected();
+ assertEquals(2, selected.size());
+ assertTrue(selected.contains(3));
+ assertTrue(selected.contains(6));
+ }
+
+ @Test(groups = "Functional")
+ public void testMarkColumns_extend()
+ {
+ ColumnSelection cs = new ColumnSelection();
+ cs.addElement(1);
+ cs.addElement(5);
+ BitSet toMark = new BitSet();
+ toMark.set(1);
+ toMark.set(3);
+ toMark.set(6);
+ toMark.set(9);
+
+ /*
+ * extending selection of {3, 6} should leave {1, 3, 5, 6} selected
+ */
+ assertTrue(cs.markColumns(toMark, 3, 8, false, true, false));
+ List<Integer> selected = cs.getSelected();
+ assertEquals(4, selected.size());
+ assertTrue(selected.contains(1));
+ assertTrue(selected.contains(3));
+ assertTrue(selected.contains(5));
+ assertTrue(selected.contains(6));
+ }
+
+ @Test(groups = "Functional")
+ public void testMarkColumns_invert()
+ {
+ ColumnSelection cs = new ColumnSelection();
+ cs.addElement(5); // this will be cleared
+ BitSet toMark = new BitSet();
+ toMark.set(1);
+ toMark.set(3);
+ toMark.set(6);
+ toMark.set(9);
+
+ /*
+ * inverted selection of {3, 6} should select {4, 5, 7, 8}
+ */
+ assertTrue(cs.markColumns(toMark, 3, 8, true, false, false));
+ List<Integer> selected = cs.getSelected();
+ assertEquals(4, selected.size());
+ assertTrue(selected.contains(4));
+ assertTrue(selected.contains(5));
+ assertTrue(selected.contains(7));
+ assertTrue(selected.contains(8));
+ }
+
+ @Test(groups = "Functional")
+ public void testMarkColumns_toggle()
+ {
+ ColumnSelection cs = new ColumnSelection();
+ cs.addElement(1); // outside change range
+ cs.addElement(3);
+ cs.addElement(4);
+ cs.addElement(10); // outside change range
+ BitSet toMark = new BitSet();
+ toMark.set(1);
+ toMark.set(3);
+ toMark.set(6);
+ toMark.set(9);
+
+ /*
+ * toggling state of {3, 6} should leave {1, 4, 6, 10} selected
+ */
+ assertTrue(cs.markColumns(toMark, 3, 8, false, false, true));
+ List<Integer> selected = cs.getSelected();
+ assertEquals(4, selected.size());
+ assertTrue(selected.contains(1));
+ assertTrue(selected.contains(4));
+ assertTrue(selected.contains(6));
+ assertTrue(selected.contains(10));
+ }
}
{
AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1",
1f);
- AlignmentAnnotation ann2 = addAnnotation("label2", "desc2", "calcId2",
- 1f);
+ addAnnotation("label2", "desc2", "calcId2", 1f);
AlignmentAnnotation ann3 = addAnnotation("label1", "desc3", "calcId3",
1f);
AlignmentAnnotation[] anns = seq.getAnnotation("label1");
@Test(groups = { "Functional" })
public void testGetAlignmentAnnotations_forCalcIdAndLabel()
{
- AlignmentAnnotation ann1 = addAnnotation("label1", "desc1", "calcId1",
- 1f);
+ addAnnotation("label1", "desc1", "calcId1", 1f);
AlignmentAnnotation ann2 = addAnnotation("label2", "desc2", "calcId2",
1f);
- AlignmentAnnotation ann3 = addAnnotation("label2", "desc3", "calcId3",
- 1f);
+ addAnnotation("label2", "desc3", "calcId3", 1f);
AlignmentAnnotation ann4 = addAnnotation("label2", "desc3", "calcId2",
1f);
- AlignmentAnnotation ann5 = addAnnotation("label5", "desc3", null, 1f);
- AlignmentAnnotation ann6 = addAnnotation(null, "desc3", "calcId3", 1f);
+ addAnnotation("label5", "desc3", null, 1f);
+ addAnnotation(null, "desc3", "calcId3", 1f);
+
List<AlignmentAnnotation> anns = seq.getAlignmentAnnotations("calcId2",
"label2");
assertEquals(2, anns.size());
--- /dev/null
+package jalview.io;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.fail;
+
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceI;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+public class FormatAdapterTest
+{
+
+ /**
+ * Test saving and re-reading in a specified format
+ *
+ * @throws IOException
+ */
+ @Test(groups = { "Functional" }, dataProvider = "formats")
+ public void testRoundTrip(String format) throws IOException
+ {
+ try
+ {
+ AlignmentI al = new FormatAdapter().readFile("examples/uniref50.fa",
+ FormatAdapter.FILE, "FASTA");
+
+ /*
+ * 'gap' is the gap character used in the alignment data file here,
+ * not the user preferred gap character
+ */
+ char gap = al.getGapCharacter();
+ assertNotNull(al);
+
+ SequenceI[] seqs = al.getSequencesArray();
+ String formatted = new FormatAdapter().formatSequences(format, al,
+ false);
+
+ AlignmentI reloaded = new FormatAdapter().readFile(formatted,
+ FormatAdapter.PASTE, format);
+ List<SequenceI> reread = reloaded.getSequences();
+ assertEquals("Wrong number of reloaded sequences", seqs.length,
+ reread.size());
+
+ int i = 0;
+ for (SequenceI seq : reread)
+ {
+ String sequenceString = seq.getSequenceAsString();
+
+ /*
+ * special case: MSF always uses '.' as gap character
+ */
+ sequenceString = adjustForGapTreatment(sequenceString, gap, format);
+ assertEquals(
+ String.format("Sequence %d: %s", i,
+ seqs[i].getName()), seqs[i].getSequenceAsString(),
+ sequenceString);
+ i++;
+ }
+ } catch (IOException e)
+ {
+ fail(String
+ .format("Format %s failed with %s", format, e.getMessage()));
+ }
+ }
+
+ /**
+ * Optionally change the gap character in the string to the given character,
+ * depending on the sequence file format
+ *
+ * @param sequenceString
+ * a sequence (as written in 'format' format)
+ * @param gap
+ * the sequence's original gap character
+ * @param format
+ * @return
+ */
+ String adjustForGapTreatment(String sequenceString, char gap,
+ String format)
+ {
+ if ("MSF".equals(format))
+ {
+ /*
+ * MSF forces gap character to '.', so change it back
+ * for comparison purposes
+ */
+ sequenceString = sequenceString.replace('.', gap);
+ }
+ return sequenceString;
+ }
+
+ /**
+ * Data provider that serves alignment formats that are both readable and
+ * writable
+ *
+ * @return
+ */
+ @DataProvider(name = "formats")
+ static Object[][] getFormats()
+ {
+ List<String> both = new ArrayList<String>();
+ String[] readable = FormatAdapter.READABLE_FORMATS;
+ List<String> writeable = Arrays.asList(FormatAdapter.WRITEABLE_FORMATS);
+ for (String r : readable)
+ {
+ if (writeable.contains(r))
+ {
+ both.add(r);
+ }
+ }
+
+ Object[][] formats = new Object[both.size()][];
+ int i = 0;
+ for (String format : both)
+ {
+ formats[i] = new Object[] { format };
+ i++;
+ }
+ return formats;
+ }
+
+ /**
+ * Enable this to isolate testing to a single file format
+ *
+ * @throws IOException
+ */
+ @Test(groups = { "Functional" }, enabled = false)
+ public void testOneFormatRoundTrip() throws IOException
+ {
+ testRoundTrip("JSON");
+ }
+}
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.HiddenSequences;
+import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
+import jalview.gui.AlignmentPanel;
import jalview.gui.Desktop;
import jalview.gui.Jalview2XML;
import jalview.schemes.AnnotationColourGradient;
hidden.size(), hs.getSize());
}
}
+
+ /**
+ * Test save and reload of PDBEntry in Jalview project
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" })
+ public void testStoreAndRecoverPDBEntry() throws Exception
+ {
+ Desktop.instance.closeAll_actionPerformed(null);
+ String exampleFile = "examples/3W5V.pdb";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(exampleFile,
+ FormatAdapter.FILE);
+ assertTrue("Didn't read in the example file correctly.", af != null);
+ String afid = af.getViewport().getSequenceSetId();
+
+ AlignmentPanel[] alignPanels = Desktop.getAlignmentPanels(afid);
+ System.out.println();
+ AlignmentViewPanel ap = alignPanels[0];
+ String tfileBase = new File(".").getAbsolutePath().replace(".", "");
+ String testFile = tfileBase + exampleFile;
+ AlignmentI alignment = ap.getAlignment();
+ System.out.println("blah");
+ SequenceI[] seqs = alignment.getSequencesArray();
+ Assert.assertNotNull(seqs[0]);
+ Assert.assertNotNull(seqs[1]);
+ Assert.assertNotNull(seqs[2]);
+ Assert.assertNotNull(seqs[3]);
+ Assert.assertNotNull(seqs[0].getDatasetSequence());
+ Assert.assertNotNull(seqs[1].getDatasetSequence());
+ Assert.assertNotNull(seqs[2].getDatasetSequence());
+ Assert.assertNotNull(seqs[3].getDatasetSequence());
+ PDBEntry[] pdbEntries = new PDBEntry[4];
+ pdbEntries[0] = new PDBEntry("3W5V", "A", null, testFile);
+ pdbEntries[1] = new PDBEntry("3W5V", "B", null, testFile);
+ pdbEntries[2] = new PDBEntry("3W5V", "C", null, testFile);
+ pdbEntries[3] = new PDBEntry("3W5V", "D", null, testFile);
+ Assert.assertTrue(seqs[0].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[0]));
+ Assert.assertTrue(seqs[1].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[1]));
+ Assert.assertTrue(seqs[2].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[2]));
+ Assert.assertTrue(seqs[3].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[3]));
+
+ File tfile = File.createTempFile("testStoreAndRecoverPDBEntry", ".jvp");
+ try
+ {
+ new Jalview2XML(false).saveState(tfile);
+ } catch (Throwable e)
+ {
+ Assert.fail("Didn't save the state", e);
+ }
+ Desktop.instance.closeAll_actionPerformed(null);
+ if (Desktop.getAlignFrames() != null)
+ {
+ Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+ }
+
+ AlignFrame restoredFrame = new FileLoader().LoadFileWaitTillLoaded(
+ tfile.getAbsolutePath(), FormatAdapter.FILE);
+ String rfid = restoredFrame.getViewport().getSequenceSetId();
+ AlignmentPanel[] rAlignPanels = Desktop.getAlignmentPanels(rfid);
+ AlignmentViewPanel rap = rAlignPanels[0];
+ AlignmentI rAlignment = rap.getAlignment();
+ System.out.println("blah");
+ SequenceI[] rseqs = rAlignment.getSequencesArray();
+ Assert.assertNotNull(rseqs[0]);
+ Assert.assertNotNull(rseqs[1]);
+ Assert.assertNotNull(rseqs[2]);
+ Assert.assertNotNull(rseqs[3]);
+ Assert.assertNotNull(rseqs[0].getDatasetSequence());
+ Assert.assertNotNull(rseqs[1].getDatasetSequence());
+ Assert.assertNotNull(rseqs[2].getDatasetSequence());
+ Assert.assertNotNull(rseqs[3].getDatasetSequence());
+
+ // The Asserts below are expected to fail until the PDB chainCode is
+ // recoverable from a Jalview projects
+ Assert.assertTrue(rseqs[0].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[0]));
+ Assert.assertTrue(rseqs[1].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[1]));
+ Assert.assertTrue(rseqs[2].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[2]));
+ Assert.assertTrue(rseqs[3].getDatasetSequence().getAllPDBEntries()
+ .get(0).equals(pdbEntries[3]));
+ }
}
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
* 'secondary' or generated alignment from some datapreserving
* transformation
* @param ignoreFeatures
- * when true, differences in seuqence feature annotation are ignored.
+ * when true, differences in sequence feature annotation are ignored
*/
public static void testAlignmentEquivalence(AlignmentI al,
AlignmentI al_input, boolean ignoreFeatures)
assertNotNull("Original alignment was null", al);
assertNotNull("Generated alignment was null", al_input);
- assertTrue(
- "Alignment dimension mismatch: originl contains "
- + al.getHeight() + " and generated has "
- + al_input.getHeight() + " sequences; original has "
- + al.getWidth() + " and generated has "
- + al_input.getWidth() + " columns.",
+ assertTrue("Alignment dimension mismatch: original: " + al.getHeight()
+ + "x" + al.getWidth() + ", generated: " + al_input.getHeight()
+ + "x" + al_input.getWidth(),
al.getHeight() == al_input.getHeight()
&& al.getWidth() == al_input.getWidth());
// note - at moment we do not distinguish between alignment without any
// annotation rows and alignment with no annotation row vector
// we might want to revise this in future
- int aa_new_size = (aa_new == null ? 0 : aa_new.length), aa_original_size = (aa_original == null ? 0
- : aa_original.length);
- Map<Integer, java.util.BitSet> orig_groups = new HashMap<Integer, java.util.BitSet>(), new_groups = new HashMap<Integer, java.util.BitSet>();
+ int aa_new_size = (aa_new == null ? 0 : aa_new.length);
+ int aa_original_size = (aa_original == null ? 0 : aa_original.length);
+ Map<Integer, BitSet> orig_groups = new HashMap<Integer, BitSet>();
+ Map<Integer, BitSet> new_groups = new HashMap<Integer, BitSet>();
if (aa_new != null && aa_original != null)
{
assertTrue("Different alignment annotation at position " + i,
equalss(aa_original[i], aa_new[i]));
// compare graphGroup or graph properties - needed to verify JAL-1299
- assertTrue("Graph type not identical.",
- aa_original[i].graph == aa_new[i].graph);
- assertTrue("Visibility not identical.",
- aa_original[i].visible == aa_new[i].visible);
- assertTrue(
- "Threshold line not identical.",
- aa_original[i].threshold == null ? aa_new[i].threshold == null
- : aa_original[i].threshold
- .equals(aa_new[i].threshold));
+ assertEquals("Graph type not identical.", aa_original[i].graph,
+ aa_new[i].graph);
+ assertEquals("Visibility not identical.", aa_original[i].visible,
+ aa_new[i].visible);
+ assertEquals("Threshold line not identical.",
+ aa_original[i].threshold, aa_new[i].threshold);
// graphGroup may differ, but pattern should be the same
- Integer o_ggrp = new Integer(aa_original[i].graphGroup + 2), n_ggrp = new Integer(
- aa_new[i].graphGroup + 2);
- BitSet orig_g = orig_groups.get(o_ggrp), new_g = new_groups
- .get(n_ggrp);
+ Integer o_ggrp = new Integer(aa_original[i].graphGroup + 2);
+ Integer n_ggrp = new Integer(aa_new[i].graphGroup + 2);
+ BitSet orig_g = orig_groups.get(o_ggrp);
+ BitSet new_g = new_groups.get(n_ggrp);
if (orig_g == null)
{
orig_groups.put(o_ggrp, orig_g = new BitSet());
{
new_groups.put(n_ggrp, new_g = new BitSet());
}
- assertTrue("Graph Group pattern differs at annotation " + i,
- orig_g.equals(new_g));
+ assertEquals("Graph Group pattern differs at annotation " + i,
+ orig_g, new_g);
orig_g.set(i);
new_g.set(i);
}
}
}
}
- assertTrue(
- "Generated and imported alignment have different annotation sets ("
- + aa_new_size + " != " + aa_original_size + ")",
- aa_new_size == aa_original_size);
+ assertEquals(
+ "Generated and imported alignment have different annotation sets",
+ aa_new_size, aa_original_size);
// check sequences, annotation and features
SequenceI[] seq_original = new SequenceI[al.getSequencesArray().length];
{
String ss_original = seq_original[i].getSequenceAsString();
String ss_new = seq_new[in].getSequenceAsString();
- assertTrue("The sequences " + name + "/" + start + "-" + end
- + " are not equal", ss_original.equals(ss_new));
+ assertEquals("The sequences " + name + "/" + start + "-" + end
+ + " are not equal", ss_original, ss_new);
assertTrue(
"Sequence Features were not equivalent"
.getSequenceFeatures().length];
sequenceFeatures_new = seq_new[in].getSequenceFeatures();
- assertTrue("different number of features", seq_original[i]
- .getSequenceFeatures().length == seq_new[in]
+ assertEquals("different number of features",
+ seq_original[i].getSequenceFeatures().length,
+ seq_new[in]
.getSequenceFeatures().length);
for (int feat = 0; feat < seq_original[i].getSequenceFeatures().length; feat++)
{
- assertTrue("Different features",
- sequenceFeatures_original[feat]
- .equals(sequenceFeatures_new[feat]));
+ assertEquals("Different features",
+ sequenceFeatures_original[feat],
+ sequenceFeatures_new[feat]);
}
}
// compare alignment annotation
else if (al.getSequenceAt(i).getAnnotation() != null
&& al_input.getSequenceAt(in).getAnnotation() == null)
{
- assertTrue("Annotations differed between sequences ("
+ fail("Annotations differed between sequences ("
+ al.getSequenceAt(i).getName() + ") and ("
- + al_input.getSequenceAt(i).getName() + ")", false);
+ + al_input.getSequenceAt(i).getName() + ")");
}
break;
}
import jalview.datamodel.AlignmentI;
import jalview.gui.Jalview2XML;
import jalview.io.AnnotationFile;
+import jalview.io.FileLoader;
import jalview.io.FormatAdapter;
import jalview.io.StockholmFileTest;
import jalview.ws.jws2.Jws2Discoverer;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import compbio.metadata.Argument;
import compbio.metadata.WrongParameterException;
public class RNAStructExportImport
Assert.fail("no web service");
}
- jalview.io.FileLoader fl = new jalview.io.FileLoader(false);
+ FileLoader fl = new FileLoader(false);
- af = fl.LoadFileWaitTillLoaded(testseqs, jalview.io.FormatAdapter.FILE);
+ af = fl.LoadFileWaitTillLoaded(testseqs, FormatAdapter.FILE);
assertNotNull("Couldn't load test data ('" + testseqs + "')", af);
} catch (InterruptedException x)
{
}
- ;
} while (af.getViewport().getCalcManager().isWorking());
AlignmentI orig_alig = af.getViewport().getAlignment();
} catch (InterruptedException x)
{
}
- ;
} while (af.getViewport().getCalcManager().isWorking());
AlignmentI orig_alig = af.getViewport().getAlignment();
String anfileout = new AnnotationFile()
.printAnnotationsForAlignment(al);
- assertTrue(
+ assertNotNull(
"Test "
+ testname
+ "\nAlignment annotation file was not regenerated. Null string",
- anfileout != null);
+ anfileout);
assertTrue(
"Test "
+ testname
@Test(groups = { "Functional" })
public void testRnaalifoldSettingsRecovery()
{
- List<compbio.metadata.Argument> opts = new ArrayList<compbio.metadata.Argument>();
- for (compbio.metadata.Argument rg : (List<compbio.metadata.Argument>) rnaalifoldws
+ List<Argument> opts = new ArrayList<Argument>();
+ for (Argument rg : (List<Argument>) rnaalifoldws
.getRunnerConfig().getArguments())
{
if (rg.getDescription().contains("emperature"))
import java.util.HashSet;
import java.util.Properties;
import java.util.TreeSet;
+import java.util.regex.Pattern;
/**
* This class scans Java source files for calls to MessageManager and reports
public class MessageBundleChecker
{
/*
+ * regex ^"[^"]*"$
+ * opening quote, closing quote, no quotes in between
+ */
+ static Pattern STRING_PATTERN = Pattern.compile("^\"[^\"]*\"$");
+
+ /*
* number of text lines to read at a time in order to parse
* code that is split over several lines
*/
static int bufferSize = 3;
+ /*
+ * resource bundle key is arg0 for these methods
+ */
static final String METHOD1 = "MessageManager.getString(";
- static final String METHOD2 = "MessageManager.getStringOrReturn(";
+ static final String METHOD2 = "MessageManager.formatMessage(";
- static final String METHOD3 = "MessageManager.formatMessage(";
+ static final String METHOD3 = "MessageManager.getStringOrReturn(";
- static final String[] METHODS = { METHOD1, METHOD2, METHOD3 };
+ /*
+ * resource bundle key is arg1 for this method
+ */
+ static final String JVINIT = "JvSwingUtils.jvInitComponent(";
+
+ static final String[] METHODS = { METHOD1, METHOD2, METHOD3, JVINIT };
/*
* root of the Java source folders we want to scan
+ " possibly invalid parameter calls");
System.out.println(messageKeys.size()
- + " keys not found, possibly unused");
+ + " keys not found, either unused or constructed dynamically");
for (String key : messageKeys)
{
System.out.println(" " + key);
}
javaCount++;
+ /*
+ * skip class with designed dynamic lookup call
+ */
+ if (path.endsWith("gui/JvSwingUtils.java"))
+ {
+ return;
+ }
+
String[] lines = new String[bufferSize];
BufferedReader br = new BufferedReader(new FileReader(f));
for (int i = 0; i < bufferSize; i++)
{
continue;
}
- String methodArgs = combined.substring(pos + method.length());
+
+ /*
+ * extract what follows the opening bracket of the method call
+ */
+ String methodArgs = combined.substring(pos + method.length()).trim();
if ("".equals(methodArgs))
{
/*
- * continues on next line - catch in the next read loop iteration
+ * arguments are on next line - catch in the next read loop iteration
*/
continue;
}
- if (!methodArgs.startsWith("\""))
+ if (methodArgs.indexOf(",") == -1 && methodArgs.indexOf(")") == -1)
{
- System.out.println(String.format(
- "Possible dynamic key at %s line %s %s",
+ /*
+ * arguments continue on next line - catch in the next read loop iteration
+ */
+ continue;
+ }
+
+ if (JVINIT == method && methodArgs.indexOf(",") == -1)
+ {
+ /*
+ * not interested in 1-arg calls to jvInitComponent
+ */
+ continue;
+ }
+
+ if (METHOD3 == method)
+ {
+ System.out.println(String.format("Dynamic key at %s line %s %s",
path.substring(sourcePath.length()), lineNos, combined));
continue;
}
- methodArgs = methodArgs.substring(1);
- int quotePos = methodArgs.indexOf("\"");
- if (quotePos == -1)
+
+ String messageKey = getMessageKey(method, methodArgs);
+ if (messageKey == null)
{
System.out.println(String.format("Trouble parsing %s line %s %s",
path.substring(sourcePath.length()), lineNos, combined));
continue;
}
- String messageKey = methodArgs.substring(0, quotePos);
+
+ if (!(STRING_PATTERN.matcher(messageKey).matches()))
+ {
+ System.out.println(String.format("Dynamic key at %s line %s %s",
+ path.substring(sourcePath.length()), lineNos, combined));
+ continue;
+ }
+
+ /*
+ * strip leading and trailing quote
+ */
+ messageKey = messageKey.substring(1, messageKey.length() - 1);
+
if (!this.messages.containsKey(messageKey))
{
System.out.println(String.format(
}
}
+ /**
+ * Helper method to parse out the resource bundle key parameter of a method
+ * call
+ *
+ * @param method
+ * @param methodArgs
+ * the rest of the source line starting with arguments to method
+ * @return
+ */
+ private String getMessageKey(String method, String methodArgs)
+ {
+ String key = methodArgs;
+
+ /*
+ * locate second argument if calling jvInitComponent()
+ */
+ if (method == JVINIT)
+ {
+ int commaLoc = methodArgs.indexOf(",");
+ if (commaLoc == -1)
+ {
+ return null;
+ }
+ key = key.substring(commaLoc + 1).trim();
+ }
+
+ /*
+ * take up to next comma or ) or end of line
+ */
+ int commaPos = key.indexOf(",");
+ int bracePos = key.indexOf(")");
+ int endPos = commaPos == -1 ? bracePos : (bracePos == -1 ? commaPos
+ : Math.min(commaPos, bracePos));
+ if (endPos == -1 && key.length() > 1 && key.endsWith("\""))
+ {
+ endPos = key.length();
+ }
+
+ return endPos == -1 ? null : key.substring(0, endPos);
+ }
+
private String combineLines(String[] lines)
{
String combined = "";
var logger = project.getBuildListeners( ).firstElement( );
logger.setMessageOutputLevel( 1 );
</script>
- <echo message="Missing message labels compared to Messages.properties"/>
- <foreach target="compareProperties" param="file2">
+ <foreach target="compareBundles" param="file2">
<path>
<fileset dir="${basedir}/resources/lang">
<exclude name="Messages.properties" />
</foreach>
</target>
+<target name="compareBundles" description="compare a properties file with Messages.properties and vice versa">
+ <echo message=" "/>
+ <echo message="Missing message labels in ${file2} compared to Messages.properties"/>
+ <antcall target="compareProperties">
+ <param name="file1" value="resources/lang/Messages.properties"/>
+ <param name="file2" value="${file2}" />
+ </antcall>
+ <echo message=" "/>
+ <echo message="Missing message labels in Messages.properties compare to ${file2}"/>
+ <antcall target="compareProperties">
+ <param name="file2" value="resources/lang/Messages.properties"/>
+ <param name="file1" value="${file2}" />
+ </antcall>
+</target>
+
<target name="compareProperties" description="reports missing entries in one message bundle">
- <loadproperties srcFile="resources/lang/Messages.properties" prefix="prefixfile1"/>
+ <loadproperties srcFile="${file1}" prefix="prefixfile1"/>
<loadproperties srcFile="${file2}" prefix="prefixfile2"/>
<propertyselector property="file1.list" delimiter="," match="prefixfile1\.(.+)" select="\1"/>
<propertyselector property="file2.list" delimiter="," match="prefixfile2\.(.+)" select="\1"/>
- <echo message=" "/>
- <echo message="*** ${file2}:" />
<for list="${file1.list}" param="file1.property">
<sequential>
<if>