data.purifications
Class PurificationExperiment

java.lang.Object
  extended by data.purifications.PurificationExperiment
All Implemented Interfaces:
ProteinSet

public class PurificationExperiment
extends Object
implements ProteinSet

Represents a single purification experiment having a bait protein and a list of prey proteins which were purified by that bait.

Author:
Jan Krumsiek
See Also:
PurificationData

Constructor Summary
PurificationExperiment(int bait)
          Creates a new purification experiment having a given bait.
PurificationExperiment(int bait, boolean multiplePreys)
          Creates a new purification experiment having a given bait.
 
Method Summary
 void addPrey(int prey)
          Add a prey to the list of preys for this experiment
 void addPreys(Collection<Integer> list)
          Add a list of preys to this experiment.
 boolean equals(Object obj)
          Checks if two purification experiments are equal.
 int getBait()
          Returns the bait of this purification experiment
 Collection<Integer> getPreys()
          Returns the list of prey proteins for this experiment.
 Set<Integer> getProteins()
          Returns the set of proteins involved in this purification experiment (the bait and all preys)
 boolean multiplePreys()
          Returns if multiple occurences of the same prey are allowed in the preys list.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurificationExperiment

public PurificationExperiment(int bait)
Creates a new purification experiment having a given bait. Multiple occurrences of the same prey will not be counted. (see also: PurificationExperiment(int, boolean)

Parameters:
bait - bait protein for this experiment

PurificationExperiment

public PurificationExperiment(int bait,
                              boolean multiplePreys)
Creates a new purification experiment having a given bait. The multiplePreys parameter defines whether multiple occurrences of a prey are counted or not

Parameters:
bait - bait protein for this experiment
multiplePreys - if false each prey protein can only occur in the preys list once
Method Detail

multiplePreys

public boolean multiplePreys()
Returns if multiple occurences of the same prey are allowed in the preys list.

Returns:
true if multiple prey occurences are allowed, false if each prey will only occur once.

getBait

public int getBait()
Returns the bait of this purification experiment

Returns:
protein protein

addPrey

public void addPrey(int prey)
Add a prey to the list of preys for this experiment

Parameters:
prey - new prey protein

addPreys

public void addPreys(Collection<Integer> list)
Add a list of preys to this experiment.

Parameters:
list - list of prey proteins to add to the experiment

getPreys

public Collection<Integer> getPreys()
Returns the list of prey proteins for this experiment. For multiplePreys == true this Collection will be a Vector, for multiplePreys == false it will be a HashSet

Returns:
collection of prey proteins in this experiment

getProteins

public Set<Integer> getProteins()
Returns the set of proteins involved in this purification experiment (the bait and all preys)

Specified by:
getProteins in interface ProteinSet
Returns:
a set of internal IDs

equals

public boolean equals(Object obj)
Checks if two purification experiments are equal. This is true if and only if the other object is also a PurificationExperiment, both experiments have the same bait and the prey lists are equal.

Overrides:
equals in class Object