com.compomics.util.experiment.identification.protein_inference.proteintree
Class ProteinTree

java.lang.Object
  extended by com.compomics.util.experiment.identification.protein_inference.proteintree.ProteinTree

public class ProteinTree
extends Object

This class sorts the proteins into groups.

Author:
Marc Vaudel

Constructor Summary
ProteinTree(File indexFolder, int memoryAllocation)
          Creates a tree based on the proteins present in the sequence factory.
 
Method Summary
 void close()
          Closes all connections to files.
 HashMap<String,ArrayList<Integer>> getProteinMapping(String peptideSequence)
          Returns the protein mapping in the sequence factory for the given peptide sequence.
 void initiateTree(int initialTagSize, int maxNodeSize, Enzyme enzyme, WaitingHandler waitingHandler)
          Initiates the tree.
 void initiateTree(int initialTagSize, int maxNodeSize, WaitingHandler waitingHandler)
          Initiates the tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProteinTree

public ProteinTree(File indexFolder,
                   int memoryAllocation)
Creates a tree based on the proteins present in the sequence factory.

Parameters:
indexFolder - the folder where to store the database tree. If null the tree will be kept in memory
memoryAllocation - the number of GB available for the tree in memory.
Method Detail

initiateTree

public void initiateTree(int initialTagSize,
                         int maxNodeSize,
                         WaitingHandler waitingHandler)
                  throws IOException,
                         IllegalArgumentException,
                         InterruptedException,
                         ClassNotFoundException
Initiates the tree.

Parameters:
maxNodeSize - the maximal size of a node. large nodes will be fast to initiate but slow to query. I typically use 5000.
waitingHandler - the waiting handler used to display progress to the user. Can be null but strongly recommended :)
Throws:
IOException
IllegalArgumentException
InterruptedException
ClassNotFoundException

initiateTree

public void initiateTree(int initialTagSize,
                         int maxNodeSize,
                         Enzyme enzyme,
                         WaitingHandler waitingHandler)
                  throws IOException,
                         IllegalArgumentException,
                         InterruptedException,
                         IOException,
                         IllegalArgumentException,
                         InterruptedException,
                         ClassNotFoundException
Initiates the tree. Note: the memory consumption is for now only calibrated for the no enzyme case.

Parameters:
initialTagSize - the initial size of peptide tag. Large initial size are slow to query, low initial size are slow to initiate. I typically use 3 for databases containing less than 100 000 proteins.
maxNodeSize - the maximal size of a node. large nodes will be fast to initiate but slow to query. I typically use 5000.
enzyme - the enzyme used to select peptides. If null all possible peptides will be indexed (takes more memory)
waitingHandler - the waiting handler used to display progress to the user. Can be null.
Throws:
IOException
IllegalArgumentException
InterruptedException
ClassNotFoundException

getProteinMapping

public HashMap<String,ArrayList<Integer>> getProteinMapping(String peptideSequence)
                                                     throws IOException,
                                                            InterruptedException,
                                                            ClassNotFoundException
Returns the protein mapping in the sequence factory for the given peptide sequence.

Parameters:
peptideSequence - the peptide sequence
Returns:
the peptide to protein mapping: Accession -> list of indexes where the peptide can be found on the sequence
Throws:
IOException
InterruptedException
ClassNotFoundException

close

public void close()
Closes all connections to files.



Copyright © 2013. All Rights Reserved.