- /**
- * Helper method for calcColor methods.
- *
- * @param smallercolor_component_x
- * color component the smaller color
- * @param largercolor_component_x
- * color component the larger color
- * @param x
- * factor
- * @return an int representing a color component
- */
- final private static int calculateColorComponent( final double smallercolor_component_x,
- final double largercolor_component_x,
- final double x ) {
- return ( int ) ( smallercolor_component_x + ( ( x * ( largercolor_component_x - smallercolor_component_x ) ) / 255.0 ) );
- }
-
- final public static MolecularSequence.TYPE guessMolecularSequenceType( final String mol_seq ) {
- if ( mol_seq.contains( "L" ) || mol_seq.contains( "I" ) || mol_seq.contains( "E" ) || mol_seq.contains( "H" )
- || mol_seq.contains( "D" ) || mol_seq.contains( "Q" ) ) {
- return TYPE.AA;
- }
- else {
- if ( mol_seq.contains( "T" ) ) {
- return TYPE.DNA;
- }
- else if ( mol_seq.contains( "U" ) ) {
- return TYPE.RNA;
- }
- }
- return null;
- }
-
- /**
- * Helper method for calcColor methods.
- *
- *
- * @param value
- * the value
- * @param larger
- * the largest value
- * @param smaller
- * the smallest value
- * @return a normalized value between larger and smaller
- */
- final private static double calculateColorFactor( final double value, final double larger, final double smaller ) {
- return ( 255.0 * ( value - smaller ) ) / ( larger - smaller );
- }
-
- final private static String[] splitString( final String str ) {
- final String regex = "[\\s;,]+";
- return str.split( regex );