edu.mssm.crover.imports
Class SeqUtils

java.lang.Object
  |
  +--edu.mssm.crover.imports.SeqUtils

public class SeqUtils
extends java.lang.Object

Provides methods of common interest to this package, related to sequence operations. Converts lines of text with three-residue codes to one letter code.


Field Summary
static java.lang.String[] conversions
          An array of String that described the conversion applied by this class.
 
Constructor Summary
SeqUtils()
           
 
Method Summary
static void appendSeq3Residues(BiologicalSequence seq, java.lang.String line, java.lang.String separator)
          Appends the a set of residues to the sequence residues.
static char convertRes3(java.lang.String res3)
          Converts a three letter code residue string to a one letter code character.
static java.lang.String convertToSeq1(java.lang.String seq3, java.lang.String separator)
          Converts a string of residues (3 characters codes) to string of one-letter code residues.
static void main(java.lang.String[] args)
          Tests this class behaviour and provides an example of its use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conversions

public static java.lang.String[] conversions
An array of String that described the conversion applied by this class. Subclass this class and otheride the array to provide for a different translation table. The array is organized as follows. Implicit rows are defined to contain two elements. The first element of each row is the 3 letter code of a residue (the String that is compared to each residue token the parser encounters). The second element is a String the first character of which is returned when the residue was determined to match the first element. In case where the residue named by the first element must be ignored (protection group for instance), it is allowed to provide a string containing a space as second element. In this case, the space is appended and should be ignored when appended to a sequence object. The search ignores the case of the strings.

Constructor Detail

SeqUtils

public SeqUtils()
Method Detail

appendSeq3Residues

public static void appendSeq3Residues(BiologicalSequence seq,
                                      java.lang.String line,
                                      java.lang.String separator)
                               throws UnsupportedResidueType
Appends the a set of residues to the sequence residues. The line describes the residues as a string of three character encoding residue names.

Parameters:
seq - The sequence to which the residues are to be appended
line - The line of text that encodes the residues to append.
separator - The residue delimiter, usually a single character string (" ", "-", etc.)
Throws:
UnsupportedResidueType - Thrown when the token delimited by the limits of the string and/or the separator(s) is not recognized as a residue code.
See Also:
convertToSeq1(java.lang.String, java.lang.String)

convertToSeq1

public static java.lang.String convertToSeq1(java.lang.String seq3,
                                             java.lang.String separator)
                                      throws UnsupportedResidueType
Converts a string of residues (3 characters codes) to string of one-letter code residues. The separator character is used to tokenize the string. For instance, to parse the SER-Tyr-PRO use convertToSeq1("SER-Tyr-PRO",'-');

Parameters:
separator - The residue delimiter, usually a single character string (" ", "-", etc.)
Throws:
UnsupportedResidueType - Thrown when the token delimited by the limits of the string and/or the separator(s) is not recognized as a residue code.

convertRes3

public static final char convertRes3(java.lang.String res3)
                              throws UnsupportedResidueType
Converts a three letter code residue string to a one letter code character. It's final to allow for optimization.

Throws:
UnsupportedResidueType - Thrown when res3 is not contained in the conversions array.
See Also:
conversions

main

public static void main(java.lang.String[] args)
Tests this class behaviour and provides an example of its use.



Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.