Class SimpleAlignmentStyler
SHOW_ALL - returns the default style for all given residues.
SHOW_SAME - only returns a markup style if the styles for both
characters are the same.
SHOW_DIFF - only returns a markup style if the styles for both
are different.
Styles can be easily defined in two ways.
1. Add each style by calling addStyle( poChar, poColour )
For example,
String oRed = "FFA2A2";
oStyler.addStyle( "-", oRed );
oStyler.addStyle( "N", oRed );
oStyler.addStyle( "A", oRed );
oStyler.addStyle( "T", oRed );
oStyler.addStyle( "C", oRed );
oStyler.addStyle( "G", oRed );
2. Alternatively the styles could be specified in a java properties file
and loaded by calling readColourMapFromProperties( poFilename )
,
or readColourMap()
and setting the system property 'colourMap'
to the correct filename.
This file should be in java properties format, mapping
characters to colours, specified in HEX RGB.
For example:
# set everything red - = FFA2A2 N = FFA2A2 A = FFA2A2 T = FFA2A2 C = FFA2A2 G = FFA2A2Note this is simply character based, so if you want to colour gaps then you need to specify a colour for the gap character.
If no colour is specified for a character then it is uncoloured. Primary author - Colin Hardman (CAT) Other authors - Tim Dilks (CAT) Simon Brocklehurst (CAT) Stuart Johnston (CAT) Lawerence Bower (CAT) Derek Crockford (CAT) Neil Benn (CAT) Copyright 2001 Cambridge Antibody Technology Group plc. This code released to the biojava project, May 2001 under the LGPL license.
- Version:
- 1.0
- Author:
- Cambridge Antibody Technology Group plc
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
Return default stylesstatic int
As NORMAL except only return if the two colour classes for query and subject are the differentstatic int
Only return if the two colour classes for query and subject are the sameFields inherited from class org.biojava.bio.program.blast2html.AbstractAlignmentStyler
iNumberOfColours, oColourClassMap, oColourMap, oColourSet
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleAlignmentStyler
(int piStyle) Creates a newSimpleAlignmentStyler
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the styles for the two aligned characters in the form of predefined font classes.protected void
Read the the properties file that specifies the character/colour mapping.protected void
readColourMapFromProperties
(String poFileName) Setup styles from java property file.Methods inherited from class org.biojava.bio.program.blast2html.AbstractAlignmentStyler
addStyle, getAlignmentStyles, getColourClass
-
Field Details
-
SHOW_ALL
Return default styles -
SHOW_SAME
Only return if the two colour classes for query and subject are the same -
SHOW_DIFF
As NORMAL except only return if the two colour classes for query and subject are the different
-
-
Constructor Details
-
SimpleAlignmentStyler
Creates a newSimpleAlignmentStyler
instance.The int flag should be one of SimpleAlignmentStyler.SHOW_ALL, SimpleAlignmentStyler.SHOW_SAME or SimpleAlignmentStyler.SHOW_DIFF.
- Parameters:
piStyle
- (one of SimpleAlignmentStyler.SHOW_SAME or SimpleAlignmentStyler.SHOW_DIFF).- Throws:
IllegalArgumentException
- - if style not one of allowed values
-
-
Method Details
-
readColourMapFromProperties
Setup styles from java property file.- Parameters:
poFileName
- - the file name of the property file.
-
readColourMap
Read the the properties file that specifies the character/colour mapping. The location of the property file is specified by the system property 'colourMap'. -
getStyle
Returns the styles for the two aligned characters in the form of predefined font classes.Null is acceptable value for no style.
- Specified by:
getStyle
in classAbstractAlignmentStyler
- Parameters:
poFirst
- - the first char in the alignmentpoSecond
- - the second char in the alignmentpoStyleHolder
- - an array to hold the styles, [0] = first etc
-