| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.bdgp.util.DNAUtils
a collection of constants and static methods useful in manipulating ascii representations of DNA sequences.
| Field Summary | |
| protected static java.lang.String[][][] | aa1Genetic Code in 1-character amino acid codes | 
| protected static java.lang.String[][][] | aa3Genetic Code in 3-character amino acid codes | 
| static int | COMPLEMENT | 
| static int | FORWARD_SPLICED_TRANSLATION | 
| static int[] | FRAME_MAPPING | 
| static int | FRAME_NEG_ONE | 
| static int | FRAME_NEG_THREE | 
| static int | FRAME_NEG_TWO | 
| static int | FRAME_ONE | 
| static int | FRAME_THREE | 
| static int | FRAME_TWO | 
| protected static char[] | id_to_letterascii character codes for each nucleotide (or set of nucleotides). | 
| protected static int[] | letter_to_idordinal numbers of nucleotides associated with each possible ascii character code. | 
| static int | LETTERSnumber of "letters" that are valid in a string of nucleotide codes. | 
| static int | NUCLEOTIDES | 
| static int | ONE_LETTER_CODE | 
| static int | REVERSE_SPLICED_TRANSLATION | 
| static int | THREE_LETTER_CODE | 
| Constructor Summary | |
| DNAUtils() | |
| Method Summary | |
| static java.lang.String | chunkReverse(java.lang.String s,
             int offset,
             int chunk_size)determines the reverse of a part of a sequence of nucleotides. | 
| static java.lang.String | complement(java.lang.String s)determines the complement of a sequence of nucleotides. | 
| protected static void | complementBuffer(java.lang.StringBuffer buf)determines the complement of a sequence of nucleotides. | 
| static double | GCcontent(java.lang.String dna) | 
| static double | GCcontent(java.lang.StringBuffer dna) | 
| static char[] | getAllowedDNACharacters()return an array of all allowed characters used to represent nucleotides This _should_ follow IUPAC spec, but doesn't yet | 
| static java.lang.String[][][] | getGeneticCodeOne()gets a representation of the genetic code. | 
| static java.lang.String[][][] | getGeneticCodeThree()gets a representation of the genetic code. | 
| static int[] | getNACharToIdMap()gets a map from letters to numbers each representing nucleotides. | 
| static char[] | getNAIdToCharMap()gets a map from numbers to letters each representing nucleotides. | 
| static char | getResidueChar(int residue_id)gets a nucleotide code. | 
| static int | getResidueID(char residue_letter)gets an index into an array of codes for nucleotides. | 
| static java.lang.String | reverse(java.lang.String s)determines the reverse of a sequence of nucleotides. | 
| static java.lang.String | reverseComplement(java.lang.String s)determines the reverse complement of a sequence of nucleotides. | 
| static java.lang.String | translate(java.lang.String s,
          int frametype,
          int codetype)gets a translation into amino acids of a string of nucleotides. | 
| static java.lang.String | translate(java.lang.String s,
          int frametype,
          int codetype,
          java.lang.String initial_string,
          java.lang.String pre_string,
          java.lang.String post_string)gets a translation into amino acids of a string of nucleotides. | 
| static java.lang.String | translate(java.lang.String s,
          int frametype,
          java.lang.String[][][] genetic_code,
          java.lang.String initial_string,
          java.lang.String pre_string,
          java.lang.String post_string)gets a translation into amino acids of a string of nucleotides. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final int NUCLEOTIDES
public static final int COMPLEMENT
public static final int FRAME_ONE
public static final int FRAME_TWO
public static final int FRAME_THREE
public static final int FRAME_NEG_ONE
public static final int FRAME_NEG_TWO
public static final int FRAME_NEG_THREE
public static final int FORWARD_SPLICED_TRANSLATION
public static final int REVERSE_SPLICED_TRANSLATION
public static final int[] FRAME_MAPPING
public static final int ONE_LETTER_CODE
public static final int THREE_LETTER_CODE
protected static java.lang.String[][][] aa1
protected static java.lang.String[][][] aa3
public static final int LETTERS
protected static int[] letter_to_id
protected static char[] id_to_letter
| Constructor Detail | 
public DNAUtils()
| Method Detail | 
public static java.lang.String complement(java.lang.String s)
s - a string of nucleotide codes.public static java.lang.String reverseComplement(java.lang.String s)
s - a string of nucleotide codes.public static java.lang.String reverse(java.lang.String s)
s - a string of nucleotide codes.
public static java.lang.String chunkReverse(java.lang.String s,
                                            int offset,
                                            int chunk_size)
s - a string of nucleotide codes.offset - the number of characters to skip
               at the beginning of s.chunk_size - the number of characters in the portion
                   to be reversedprotected static void complementBuffer(java.lang.StringBuffer buf)
buf - a string of nucleotide codes
            each of which is replaced
            with it's complementary code.complement(java.lang.String)public static java.lang.String[][][] getGeneticCodeThree()
public static java.lang.String[][][] getGeneticCodeOne()
public static java.lang.String translate(java.lang.String s,
                                         int frametype,
                                         int codetype)
s - represents the string of nucleotides.frametype - FRAME_ONE, FRAME_TWO, or FRAME_THREE.
                  For reverse strand frames, 
                  translate the reverse complement.
                  Then reverse that result.codetype - ONE_LETTER_CODE, or THREE_LETTER_CODE
                 indicating how many letters should encode each amino acid.
public static java.lang.String translate(java.lang.String s,
                                         int frametype,
                                         int codetype,
                                         java.lang.String initial_string,
                                         java.lang.String pre_string,
                                         java.lang.String post_string)
s - represents the string of nucleotides.frametype - FRAME_ONE, FRAME_TWO, or FRAME_THREE.
                  For reverse strand frames, 
                  translate the reverse complement.
                  Then reverse that result.codetype - ONE_LETTER_CODE, or THREE_LETTER_CODE
                 indicating how many letters should encode each amino acid.initial_string - what goes at front of entire translationpre_string - what goes before every amino acidpost_string - what goes after every amino acid
public static java.lang.String translate(java.lang.String s,
                                         int frametype,
                                         java.lang.String[][][] genetic_code,
                                         java.lang.String initial_string,
                                         java.lang.String pre_string,
                                         java.lang.String post_string)
s - represents the string of nucleotides.frametype - FRAME_ONE, FRAME_TWO, or FRAME_THREE.
                  For reverse strand frames, 
                  translate the reverse complement.
                  Then reverse that result.genetic_code - the result of one of the getGeneticCode methods
                     of this class.initial_string - what goes at front of entire translationpre_string - what goes before every amino acidpost_string - what goes after every amino acidgetGeneticCodeOne(), 
getGeneticCodeThree()public static int getResidueID(char residue_letter)
residue_letter - letter representation of a nucleotide.getResidueChar(int)public static char getResidueChar(int residue_id)
residue_id - ordinal of nucleotide letter code.getResidueChar(int)public static int[] getNACharToIdMap()
public static char[] getNAIdToCharMap()
public static char[] getAllowedDNACharacters()
public static double GCcontent(java.lang.String dna)
public static double GCcontent(java.lang.StringBuffer dna)
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||