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

java.lang.Object
  extended by com.compomics.util.experiment.identification.protein_inference.proteintree.Node
All Implemented Interfaces:
Serializable

public class Node
extends Object
implements Serializable

A node of the protein tree.

Author:
Marc Vaudel
See Also:
Serialized Form

Constructor Summary
Node(int depth)
          Constructor.
Node(int depth, HashMap<String,ArrayList<Integer>> accessions)
          Constructor.
 
Method Summary
 void addAccession(String accession, ArrayList<Integer> indexes)
          Adds an accession to the node.
 void clearAccessions()
          Clears the accessions of this node.
 HashMap<String,ArrayList<Integer>> getAccessions()
          Returns the accessions attribute.
 HashMap<String,ArrayList<Integer>> getAllMappings()
          Returns all the protein mapping of the node.
 int getDepth()
          Returns the depth of the node in the tree.
 HashMap<String,HashMap<String,ArrayList<Integer>>> getProteinMapping(String peptideSequence, ProteinMatch.MatchingType matchingType, Double massTolerance)
          Returns the protein mappings for the given peptide sequence.
 long getSize()
          Returns the size of the node in accession*tag.
 Node getSubNode(String sequence)
          Returns the subnode associated to an amino acid sequence.
 HashMap<Character,Node> getSubtree()
          Returns the subtree.
 HashMap<String,ArrayList<Integer>> getTermini()
          Returns the terminal mappings (they are not in the subtree).
 boolean isEmpty()
          Indicates whether the node is empty.
 boolean splitNode(int maxNodeSize, int maxDepth)
          Splits the node into subnode if its size is larger than the maxNodeSize and does the same for every sub node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node(int depth)
Constructor.

Parameters:
depth - the depth of the node

Node

public Node(int depth,
            HashMap<String,ArrayList<Integer>> accessions)
Constructor.

Parameters:
depth - the depth of the node
accessions - the accessions of the node
Method Detail

getProteinMapping

public HashMap<String,HashMap<String,ArrayList<Integer>>> getProteinMapping(String peptideSequence,
                                                                            ProteinMatch.MatchingType matchingType,
                                                                            Double massTolerance)
                                                                     throws IOException,
                                                                            InterruptedException,
                                                                            ClassNotFoundException
Returns the protein mappings for the given peptide sequence. peptide sequence -> protein accession -> index in the protein. An empty map if not found.

Parameters:
peptideSequence - the given peptide sequence
matchingType - the matching type
massTolerance - the mass tolerance for matching type 'indistiguishibleAminoAcids'. Can be null otherwise
Returns:
the protein mapping for the given peptide sequence
Throws:
IOException
InterruptedException
ClassNotFoundException

splitNode

public boolean splitNode(int maxNodeSize,
                         int maxDepth)
                  throws IOException,
                         IllegalArgumentException,
                         InterruptedException,
                         ClassNotFoundException
Splits the node into subnode if its size is larger than the maxNodeSize and does the same for every sub node.

Parameters:
maxNodeSize - the maximal node size allowed when splitting
maxDepth - the maximum depth
Returns:
returns true if the node was actually splitted and thus needs to be saved in indexed mode
Throws:
IOException
IllegalArgumentException
InterruptedException
ClassNotFoundException

addAccession

public void addAccession(String accession,
                         ArrayList<Integer> indexes)
Adds an accession to the node.

Parameters:
accession - the accession to add
indexes - the indexes in this accession where the key can be found. Any prior entry will be silently overwritten

getSize

public long getSize()
Returns the size of the node in accession*tag.

Returns:
the size of the node

getAccessions

public HashMap<String,ArrayList<Integer>> getAccessions()
Returns the accessions attribute.

Returns:
the accessions attribute

getTermini

public HashMap<String,ArrayList<Integer>> getTermini()
Returns the terminal mappings (they are not in the subtree).

Returns:
the terminal mappings

getSubtree

public HashMap<Character,Node> getSubtree()
Returns the subtree. Null if end of the tree.

Returns:
the subtree

clearAccessions

public void clearAccessions()
Clears the accessions of this node.


isEmpty

public boolean isEmpty()
Indicates whether the node is empty.

Returns:
whether the node is empty

getDepth

public int getDepth()
Returns the depth of the node in the tree.

Returns:
the depth of the node in the tree

getAllMappings

public HashMap<String,ArrayList<Integer>> getAllMappings()
                                                  throws IOException
Returns all the protein mapping of the node.

Returns:
all the protein mappings of the node
Throws:
IOException

getSubNode

public Node getSubNode(String sequence)
Returns the subnode associated to an amino acid sequence.

Parameters:
sequence - the amino acid sequence
Returns:
the corresponding subnode


Copyright © 2013. All Rights Reserved.