|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdata.complexes.Complex
public class Complex
Represents a complex of proteins. This class provides various manipulation, retrieval and and analysis methods.
Proteins are represented as internal integer IDs (see also:
ProteinManager
)
ComplexSet
Constructor Summary | |
---|---|
Complex()
Creates an empty complex. |
|
Complex(Collection<Integer> complex)
Intializes the complex with a given list of proteins. |
|
Complex(Integer... elements)
Intializes the complex with a given integer array provided as a c onvenient parameter list. |
Method Summary | |
---|---|
void |
addProtein(int protein)
Adds a protein to the complex. |
void |
addProteins(Collection<Integer> proteins)
Adds a list of proteins to the complex. |
boolean |
contains(int protein)
Checks whether a given protein is contained in this complex. |
Complex |
copy()
Creates a copy of this complex |
boolean |
equals(Object obj)
Returns true if and only if the specified object is also a
Complex and both complexes have identical members. |
List<Integer> |
getComplex()
Returns the list backing this complex. |
ArrayList<ProteinLabel> |
getComplexAsLabels()
Convenience and debugging method which translates this complex into a list of protein labels |
int |
getMember(int index)
Returns the protein at a given index of in the complex. |
ProteinNetwork |
getMinimalSpanningTree(ProteinNetwork scores)
Returns the minimal spanning tree of this complex as a network object. |
Set<Integer> |
getProteins()
Returns the set of internal IDs which are involved in this complex. |
int |
indexOf(int protein)
Returns the index of a given protein in the complex. |
Complex |
intersection(Complex other)
Returns the intersection of both complexes. |
Iterator<Integer> |
iterator()
Returns an iterator over the interal protein IDs in this complex. |
boolean |
removeProtein(Integer protein)
Removes a given protein from the complex. |
void |
removeProteinIndex(int index)
Removes the protein at a given index from the complex. |
int |
size()
Returns the size of the complex. |
String |
toString()
Returns the string representation of this complex as the string representation of the backing list of internal IDs |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Complex(Collection<Integer> complex)
complex
- Collection with proteins IDs for initializationpublic Complex(Integer... elements)
elements
- Array with proteins IDs for initializationpublic Complex()
Method Detail |
---|
public void addProtein(int protein)
protein
- internal ID of the protein to be addedpublic void addProteins(Collection<Integer> proteins)
proteins
- Collection of internal IDs of proteins to be added to the complexpublic void removeProteinIndex(int index) throws IndexOutOfBoundsException
index
- index of protein to be removed (zero-based)
IndexOutOfBoundsException
- if the index is out of range for this complexpublic boolean removeProtein(Integer protein)
removeProteinIndex(int)
.
protein
- internal protein ID of member to be removed
true
if the protein was contained in the complex and
could be removed, false otherwisepublic Iterator<Integer> iterator()
iterator
in interface Iterable<Integer>
public Set<Integer> getProteins()
getProteins
in interface ProteinSet
public int size()
public int getMember(int index) throws IndexOutOfBoundsException
index
- index of protein to retrieve
IndexOutOfBoundsException
- if the index is out of range for this complexpublic List<Integer> getComplex()
public String toString()
toString
in class Object
public boolean equals(Object obj)
true
if and only if the specified object is also a
Complex and both complexes have identical members.
equals
in class Object
public boolean contains(int protein)
protein
- internal ID of protein to be checked for
true
if the protein is contained in this complex,
false
otherwisepublic int indexOf(int protein)
protein
- internal ID of protein to be checked for
public Complex copy()
public ProteinNetwork getMinimalSpanningTree(ProteinNetwork scores)
scores
- Scores network to be used for weighting the complex edges
null
if no
spanning tree exists due to missing edges.public ArrayList<ProteinLabel> getComplexAsLabels()
ProteinManager
public Complex intersection(Complex other)
other
- Complex to calculate intersection with
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |