|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdata.complexes.ComplexSet
public class ComplexSet
A complex set is a list of complexes. This class contains various methods which work on this complex list, e.g. methods for manipulating, selecting and randomizing complexes.
ComplexSet is one of the major classes of this software library and is used in many different classes and methods.
Complex
,
ComplexSetReader
,
ComplexSetWriter
Constructor Summary | |
---|---|
ComplexSet()
Creates an empty complex set |
|
ComplexSet(Collection<? extends Collection<Integer>> newComplexes)
Creates a complex set from a given list of lists of internal IDs. |
Method Summary | |
---|---|
void |
addComplex(Complex toAdd)
Adds a complex to the complex set. |
void |
addComplexes(Collection<Complex> toadd)
Adds a list of complexes to the set |
boolean |
contains(Complex complex)
Checks if a specified complex is contained in this set. |
ComplexSet |
copy()
Creates a copy of this complex set |
ComplexSet |
decompose(ProteinNetwork scores,
float cutoff)
Decomposes a complex set with respect to a given scores network. |
boolean |
equals(Object obj)
Checks if two complex sets are equal. |
Complex |
getComplex(int index)
Returns the complex at a given index in the complex set list. |
int |
getComplexCount()
Returns the number of complexes in this set |
List<Complex> |
getComplexes()
Returns the list of complexes backing this complex set. |
ProteinNetwork |
getComplexInducedNetwork()
Creates a network which contains a fully connected subgraph for each complex. |
int |
getProteinCount()
Returns the number of proteins in this set as the sum of the single complex sizes. |
Set<Integer> |
getProteins()
Returns the set of proteins involved in this complex set. |
Iterator<Complex> |
iterator()
Returns an iterator over the Complex objects in this set |
ComplexSet |
randomizeByExchanging()
Returns a randomized copy of the complex set. |
ComplexSet |
randomizeByRemapping()
Returns a randomized copy of the complex set. |
boolean |
removeComplex(Complex toRemove)
Removes a given complex from the complex set. |
void |
removeComplex(int toRemove)
Removes the complex at the specified index from the complex set. |
ComplexSet |
removeComplexesByScore(ProteinNetwork scores,
float cutoff)
Removes all complexes from the complex set whose average edge score between all proteins of the complex regarding a given scores network is below the cutoff. |
ComplexSet |
removeComplexesByScore(ProteinNetwork scores,
float cutoff,
boolean ignoreMissing)
Removes all complexes from the complex set whose average edge score between all proteins of the complex regarding a given scores network is below the cutoff. |
ComplexSet |
removeComplexesBySize(int cutoffSize,
boolean below)
Removes all complexes smaller or larger than a given threshold from the complex set. |
ComplexSet |
removeSingletons()
Removes singletons from the complex set. |
ComplexSet |
restrictToProteins(Set<Integer> proteins,
boolean fullCoverage)
Returns a new complex set containing only those complexes whose proteins are completely or partially contained in a given set of proteins. |
ComplexSet |
restrictToProteinSpace(ProteinSet proteins,
boolean fullCoverage)
Returns a new complex set containing only those complexes whose proteins are completely or partially contained in a given set of proteins. |
String |
toString()
Returns a string representation of this complex set constructed by a list of string representations of the contained Complex
objects |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ComplexSet()
public ComplexSet(Collection<? extends Collection<Integer>> newComplexes)
The constructor will create copies of the collections, the original objects will not be altered.
newComplexes
- List of lists of internal IDsMethod Detail |
---|
public List<Complex> getComplexes()
public int getComplexCount()
public int getProteinCount()
getProteins().size()
.
public ComplexSet randomizeByRemapping()
public ComplexSet randomizeByExchanging()
public ComplexSet copy()
public Iterator<Complex> iterator()
iterator
in interface Iterable<Complex>
public Complex getComplex(int index) throws IndexOutOfBoundsException
index
- index of the complex which will be retrieved
IndexOutOfBoundsException
- if the complex index is invalid for this complex setpublic Set<Integer> getProteins()
getProteins
in interface ProteinSet
public void addComplex(Complex toAdd) throws ProCopeException
toAdd
- Complex to be added
ProCopeException
- if toAdd
is an empty complexpublic void removeComplex(int toRemove) throws IndexOutOfBoundsException
toRemove
- index of complex to be removed from the set
IndexOutOfBoundsException
- if the complex index is invalid for this complex setpublic boolean removeComplex(Complex toRemove)
o
from the set will
be removed if and only if toRemove.equals(o)
, i.e. if the complexes are equal.
toRemove
- Complex to be removed
true
if a complex was removed from the set, false
otherwisepublic ComplexSet removeSingletons()
public ComplexSet removeComplexesBySize(int cutoffSize, boolean below)
cutoffSize
- size thresholdbelow
- If this is true
, all complexes with size <
cutoffSize
will be removed. If below
is false
,
all complexes having > cutoffSize
proteins will be removed.
public void addComplexes(Collection<Complex> toadd)
toadd
- list of complexes to addpublic String toString()
Complex
objects
toString
in class Object
public boolean equals(Object obj)
true
if and only if (1) the specified object is also a
complex set, (2) both sets have the same number of complexes and (3)
each complex c1
in this set has a complex c2
in the
other set such that c1.equals(c2) == true
.
equals
in class Object
public boolean contains(Complex complex)
c1
in this set such that
c1.equals(complex) == true
complex
- Complex object which will be searched in the set
true
if the complex is contained in the set,
false
otherwisepublic ProteinNetwork getComplexInducedNetwork()
public ComplexSet decompose(ProteinNetwork scores, float cutoff)
The result will contain at least the number of complexes as the original complex set.
scores
- scores network to be used for decompositioncutoff
- value below which edges will be deleted from the complex graphs
public ComplexSet restrictToProteinSpace(ProteinSet proteins, boolean fullCoverage)
proteins
- set of proteins for restrictionfullCoverage
- if this value is true
: all proteins of a
complex have to be contained in the reference set in order to be
returned. if fullCoverage==false
only one protein of a
complex has to be contained in the protein set.
public ComplexSet restrictToProteins(Set<Integer> proteins, boolean fullCoverage)
proteins
- set of proteins for restrictionfullCoverage
- if this value is true
: all proteins of a
complex have to be contained in the reference set in order to be
returned. if fullCoverage==false
only one protein of a
complex has to be contained in the protein set.
public ComplexSet removeComplexesByScore(ProteinNetwork scores, float cutoff)
scores
- scores networkcutoff
- cutoff
public ComplexSet removeComplexesByScore(ProteinNetwork scores, float cutoff, boolean ignoreMissing)
scores
- scores networkcutoff
- cutoffignoreMissing
- true
: scores of edges which do not exist
in the score network are not considered for average
calculation; false
: missing scores ar
treated as 0
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |