public class ExactMotifFinder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ExactMotifFinder.IsoHolder
Class to hold a FastGraph key and the number of instances of that FastGraph for a particular key.
Graphs are loaded from disk. |
class |
ExactMotifFinder.MotifResultHolder
Inner class to hold details of motifs ready for output
|
Constructor and Description |
---|
ExactMotifFinder(FastGraph g,
boolean saveAll)
Trivial contructor
|
ExactMotifFinder(FastGraph g,
uk.ac.kent.dover.fastGraph.Gui.MotifTask mt,
boolean saveAll)
Trivial constructor
|
Modifier and Type | Method and Description |
---|---|
void |
buildRewires(int numOfRewires)
Builds a list of rewired graphs, each one built from the previous and saved to disk
|
java.util.ArrayList<ExactMotifFinder.MotifResultHolder> |
compareAndExportResults(int size,
int minSize,
int maxSize)
Compares the results from the reference set to the real set.
Exports these in a user friendly manner |
void |
compareMotifDatas(int minSize,
int maxSize)
Runs the comparison of motif data for each size given
|
java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> |
extractGraphLists(java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> hashBuckets)
This extracts the lists of isomorphic graphs.
|
void |
findMotifs(int k,
double q,
java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> hashBuckets)
Run the motif finder.
|
void |
findMotifsRealSet(int minSize,
int maxSize)
Finds all motifs from the real set.
|
void |
findMotifsReferenceSet(int rewires,
int minSize,
int maxSize)
Finds all motifs from the reference set.
|
java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> |
getHashBuckets()
Returns the hashbuckets from this instance
|
int |
getNumOfResults() |
FastGraph |
getReferenceGraph() |
boolean |
isSaveAll()
If the saveAll option is specified
|
java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> |
mergeIsoLists(java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> oldList,
java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> newList)
Merges two isoLists together, and returns the enlarged list
|
void |
outputHashBuckets(java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> hashBuckets)
Outputs a given map hashBuckets to the screen.
|
void |
setReferenceGraph(FastGraph referenceGraph) |
void |
setSaveAll(boolean saveAll)
Sets if the saveAll option is specified
|
public ExactMotifFinder(FastGraph g, boolean saveAll)
g
- the FastGraph to find motifs insaveAll
- If every example is to be savedpublic ExactMotifFinder(FastGraph g, uk.ac.kent.dover.fastGraph.Gui.MotifTask mt, boolean saveAll)
g
- the FastGraph to find motifs inmt
- The MotifTask to report progress tosaveAll
- If every example is to be savedpublic void findMotifsReferenceSet(int rewires, int minSize, int maxSize) throws java.io.IOException, FastGraphException
rewires
- The number of rewires needed. If 0, then main set.minSize
- The minimum size of motifs to be foundmaxSize
- The maximum size of motifs to be foundjava.io.IOException
- If the output data cannot be writtenFastGraphException
public void findMotifsRealSet(int minSize, int maxSize) throws java.io.IOException, FastGraphException
minSize
- The minimum size of motifs to be foundmaxSize
- The maximum size of motifs to be foundjava.io.IOException
- If the output data cannot be writtenFastGraphException
public boolean isSaveAll()
public void setSaveAll(boolean saveAll)
saveAll
- to save all motifs?public void compareMotifDatas(int minSize, int maxSize) throws java.io.FileNotFoundException, java.io.IOException
minSize
- The minimum size of motifs foundmaxSize
- The maximum size of motifs foundjava.io.FileNotFoundException
- If the files cannot be loadedjava.io.IOException
- Any other IO problemspublic void buildRewires(int numOfRewires) throws java.io.IOException
numOfRewires
- The number of rewires to performjava.io.IOException
- If the rewired graph cannot be savedpublic void outputHashBuckets(java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> hashBuckets)
hashBuckets
- The hashbuckets to outputpublic java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> mergeIsoLists(java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> oldList, java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> newList)
oldList
- The first listnewList
- The second listpublic java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> getHashBuckets()
public java.util.HashMap<java.lang.String,ExactMotifFinder.IsoHolder> extractGraphLists(java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> hashBuckets)
hashBuckets
- The buckets to store the results inpublic void findMotifs(int k, double q, java.util.HashMap<java.lang.String,java.util.LinkedList<ExactMotifFinder.IsoHolder>> hashBuckets) throws java.io.IOException, FastGraphException
k
- the size of motifs in terms of number of nodes.q
- the fraction of nodes to sample.hashBuckets
- The buckets to store the results injava.io.IOException
- If the output files cannot be writtenFastGraphException
public java.util.ArrayList<ExactMotifFinder.MotifResultHolder> compareAndExportResults(int size, int minSize, int maxSize) throws java.io.FileNotFoundException, java.io.IOException
size
- The size of motif being comparedminSize
- The minimum size of motifsmaxSize
- The maximum size of motifsjava.io.IOException
- If the File cannot be readjava.io.FileNotFoundException
- If the file cannot be foundpublic int getNumOfResults()
public FastGraph getReferenceGraph()
public void setReferenceGraph(FastGraph referenceGraph)
referenceGraph
- the referenceGraph to set