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

Class ProteinDatabase



  • public class ProteinDatabase
    extends java.lang.Object
    Class ProteinDatabase encapsulates a protein sequence database stored in a file. Class ProteinDatabase is used to read ProteinSequence objects from the database.

    A protein sequence database file consists of one or more protein sequences 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 '-'. For further information, see class ProteinSequence.

    Along with the protein sequence database file, there is a protein sequence index file. The index file tells where each protein is located in the database file. Class ProteinDatabase's constructor requires both the database file and the index file to be supplied as arguments.

    Class ProteinDatabase includes a main program that reads a protein sequence database file and creates the requisite protein sequence index file. If the n argument is specified, the program creates an index file for just the first n sequences in the database. If the n argument is omitted, the program creates an index file for all the sequences in the database.

    Usage: java edu.rit.compbio.seq.ProteinDatabase databasefile indexfile [ n ]
    databasefile = Input protein sequence database file
    indexfile = Output protein sequence index file
    n = Number of sequences in the index (default: all)

    • Constructor Summary

      Constructors 
      Constructor and Description
      ProteinDatabase(java.io.File theDatabaseFile, java.io.File theIndexFile)
      Construct a new protein sequence database.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      Close this protein sequence database.
      long getDatabaseLength()
      Get the sum of the lengths of the protein sequences in this protein sequence database.
      long getProteinCount()
      Get the number of protein sequences in this protein sequence database.
      ProteinSequence getProteinSequence(long i)
      Get the protein sequence at the given index in this protein sequence database.
      static void main(java.lang.String[] args)
      Main program that reads a protein sequence database file and creates the requisite protein sequence index file.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProteinDatabase

        public ProteinDatabase(java.io.File theDatabaseFile,
                               java.io.File theIndexFile)
                        throws java.io.IOException
        Construct a new protein sequence database.
        Parameters:
        theDatabaseFile - Protein sequence database file.
        theIndexFile - Protein sequence index file.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theDatabaseFile is null. Thrown if theIndexFile is null.
        java.io.IOException - Thrown if an I/O error occurred.
    • Method Detail

      • getDatabaseLength

        public long getDatabaseLength()
        Get the sum of the lengths of the protein sequences in this protein sequence database.
        Returns:
        Total protein sequence length.
      • getProteinCount

        public long getProteinCount()
        Get the number of protein sequences in this protein sequence database.
        Returns:
        Number of protein sequences, N.
      • getProteinSequence

        public ProteinSequence getProteinSequence(long i)
                                           throws java.io.IOException
        Get the protein sequence at the given index in this protein sequence database.
        Parameters:
        i - Index in the range 0 ≤ iN−1.
        Returns:
        Protein sequence.
        Throws:
        java.lang.IndexOutOfBoundsException - (unchecked exception) Thrown if i is out of bounds.
        java.io.IOException - Thrown if an I/O error occurred.
      • close

        public void close()
                   throws java.io.IOException
        Close this protein sequence database.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Main program that reads a protein sequence database file and creates the requisite protein sequence index file. If the n argument is specified, the program creates an index file for just the first n sequences in the database. If the n argument is omitted, the program creates an index file for all the sequences in the database.

        Usage: java edu.rit.compbio.seq.ProteinDatabase databasefile indexfile [ n ]
        databasefile = Input protein sequence database file
        indexfile = Output protein sequence index file
        n = Number of sequences in the index (default: all)

        Throws:
        java.lang.Exception

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.