Documentation of 'edu.rit.compbio.seq.ProteinSequence' Java class
ProteinSequence
edu.rit.compbio.seq

Class ProteinSequence



  • public class ProteinSequence
    extends Sequence
    Class ProteinSequence encapsulates a protein sequence. A protein sequence object may be constructed from a string or read from a file. Protein sequence objects may also be read from a protein sequence database using class ProteinDatabase.

    In a file, a protein sequence is stored in FASTA format. A FASTA format protein sequence consists of one description line and one or more sequence lines. The description line consists of an initial '>' character followed by zero or more characters (the protein's description). A sequence line consists of one or more characters 'A' through 'Z', 'a' through 'z', '*', or '-'.

    In a program, a protein sequence is represented as a byte array (type byte[]). For a protein sequence of length L, the byte array contains L+1 bytes. The byte at index 0 is unused and contains a value of -1. The bytes at indexes 1 through L contain the amino acids. Amino acids 'A' through 'Z' (case insensitive) are represented by the values 0 through 25; '*' is represented as 26; '-' is represented as 27.

    The amino acid letters and values are:

    Letter  Value  Amino Acid
    A0Alanine
    B1Aspartate or asparagine
    C2Cysteine
    D3Aspartate
    E4Glutamate
    F5Phenylalanine
    G6Glycine
    H7Histidine
    I8Isoleucine
    J9unused
    K10Lysine
    L11Leucine
    M12Methionine
    N13Asparagine
    O14unused
    P15Proline
    Q16Glutamine
    R17Arginine
    S18Serine
    T19Threonine
    U20Selenocysteine
    V21Valine
    W22Tryptophan
    X23Any, unknown
    Y24Tyrosine
    Z25Glutamate or glutamine
    *26Translation stop
    -27Gap of indeterminate length
    • Constructor Summary

      Constructors 
      Constructor and Description
      ProteinSequence(java.io.File file)
      Construct a new protein sequence read from the given file.
      ProteinSequence(java.lang.String description, java.lang.String sequence)
      Construct a new protein sequence from the given string.
    • Constructor Detail

      • ProteinSequence

        public ProteinSequence(java.lang.String description,
                               java.lang.String sequence)
        Construct a new protein sequence from the given string.
        Parameters:
        description - Description string. Must start with a '>' character.
        sequence - Sequence string. Must consist of the characters 'A' through 'Z', 'a' through 'z', '*', and '-'.
      • ProteinSequence

        public ProteinSequence(java.io.File file)
                        throws java.io.IOException
        Construct a new protein sequence read from the given file.
        Parameters:
        file - File.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
    • Method Detail

      • charAt

        public char charAt(int i)
        Returns a character version of this protein sequence's element at the given index.
        Specified by:
        charAt in class Sequence
        Parameters:
        i - Index in the range 1 .. L.
        Returns:
        Character corresponding to element i.
      • toString

        public java.lang.String toString()
        Returns a string version of this protein sequence. The string is "ProteinSequence(description)".
        Overrides:
        toString in class java.lang.Object
        Returns:
        String version.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.