public abstract class MinerAdapter extends Object implements Miner
Modifier and Type | Field and Description |
---|---|
protected Blacklist |
blacklist
Blacklist for identifying ubiquitous small molecules.
|
protected String |
description
Description of the miner.
|
protected IDFetcher |
idFetcher
ID fetcher is used for skipping objects that cannot generate a valid ID during the search.
|
protected Map<BioPAXElement,Set<String>> |
idMap
Memory for object IDs.
|
protected String |
name
Name of the miner.
|
protected Pattern |
pattern
Pattern to use for mining.
|
Modifier | Constructor and Description |
---|---|
protected |
MinerAdapter(String name,
String description)
Constructor with name and description.
|
Modifier and Type | Method and Description |
---|---|
protected String |
concat(Set<String> set,
String sep)
Converts the set of string to a single string.
|
abstract Pattern |
constructPattern()
Constructs the pattern to use for mining.
|
Set<SIFInteraction> |
createSIFInteraction(Match m,
IDFetcher fetcher)
Creates a SIF interaction for the given match.
|
protected Set<String> |
fetchIDs(BioPAXElement ele,
IDFetcher fetcher) |
protected Set<String> |
getCellularLocations(Match m,
String memLabel,
String comLabel)
Gets cellular locations of the given elements in a string set.
|
protected PhysicalEntityChain |
getChain(Match m,
String memLabel,
String comLabel) |
String |
getCompoundName(SmallMoleculeReference smr)
Gets the name of the small molecule to use in SIF.
|
protected Set<String>[] |
getDeltaCompartments(Match m,
String memLabel1,
String comLabel1,
String memLabel2,
String comLabel2)
Gets delta compartments of the given two PE chains.
|
protected Set<String>[] |
getDeltaModifications(Match m,
String memLabel1,
String comLabel1,
String memLabel2,
String comLabel2)
Gets delta modifications of the given elements in string sets.
|
String |
getDescription()
Gets the description of the miner.
|
protected String |
getGeneSymbol(Match m,
String label)
Searches for the gene symbol of the given EntityReference.
|
protected String |
getGeneSymbol(ProteinReference pr)
Searches for the gene symbol of the given EntityReference.
|
String |
getHeader()
Gets the first line of the result file.
|
Set<String> |
getIdentifiers(Match m,
String label)
Uses uniprot name or gene symbol as identifier.
|
Map<BioPAXElement,Set<String>> |
getIdMap() |
String[] |
getMediatorLabels()
If a SIF miner wants to tell which essential BioPAX elements mediated this relation, then
they need to override this method and pass the labels of elements.
|
protected Set<String> |
getModifications(Match m,
String label)
Gets modifications of the given element in a string.
|
protected Set<String> |
getModifications(Match m,
String memLabel,
String comLabel)
Gets modifications of the given elements in a string set.
|
String |
getModificationTerm(ModificationFeature mf)
Gets the String term of the modification feature.
|
String |
getName()
Gets the name of the miner.
|
Pattern |
getPattern()
Gets the pattern, constructs if null.
|
String |
getPositionInString(ModificationFeature mf)
Gets the position of the modification feature as a String.
|
int |
getPositionStart(ModificationFeature mf)
Gets the first position of the modification feature.
|
String |
getRelationType()
Checks if the relation captured by match has a type.
|
String[] |
getSourcePELabels()
If a SIF miner wants to tell which PhysicalEntity objects acted as source of the relation,
they need to override this method and pass the labels of elements.
|
String[] |
getTargetPELabels()
If a SIF miner wants to tell which PhysicalEntity objects acted as source of the relation,
they need to override this method and pass the labels of elements.
|
protected String |
getUniprotNameForHuman(Match m,
String label)
Searches for the uniprot name of the given human EntityReference.
|
protected String |
getUniprotNameForHuman(ProteinReference pr)
Searches for the uniprot name of the given human EntityReference.
|
String |
getValue(Match m,
int col)
This method has to be overridden if
writeResultDetailed method is used. |
boolean |
isInhibition(Control ctrl)
Checks if the type of a Control is inhibition.
|
protected boolean |
labeledInactive(Match m,
String simpleLabel,
String complexLabel)
Checks if a PE chain is labeled as inactive.
|
protected void |
removeCommon(Set<String> set1,
Set<String> set2) |
void |
setBlacklist(Blacklist blacklist)
Sets the blacklist to use during SIF search.
|
void |
setDescription(String description) |
void |
setIDFetcher(IDFetcher idFetcher)
Sets the ID fetcher to use during SIF search.
|
void |
setIdMap(Map<BioPAXElement,Set<String>> idMap) |
void |
setName(String name) |
protected int |
sign(Control ctrl)
Identifies negative and positive controls.
|
protected int |
sign(Match m,
String... ctrlLabel)
Checks the cumulative sign of the chained controls.
|
String |
toString()
Uses the name as sting representation of the miner.
|
Set<String> |
toStringSet(Set<ModificationFeature> set)
Sorts the modifications and gets them in a String.
|
void |
writeResultAsSIF(Map<BioPAXElement,List<Match>> matches,
OutputStream out,
boolean directed,
String label1,
String label2)
This method writes the output as pairs of gene symbols of the given two ProteinReference.
|
void |
writeResultDetailed(Map<BioPAXElement,List<Match>> matches,
OutputStream out,
int columns)
Writes the result as a tab delimited format, where the column values are customized.
|
void |
writeSIFsUsingSIFFramework(Map<BioPAXElement,List<Match>> matches,
OutputStream out)
This method writes the output as pairs of gene symbols of the given two ProteinReference.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
writeResult
protected String description
protected IDFetcher idFetcher
protected Map<BioPAXElement,Set<String>> idMap
protected MinerAdapter(String name, String description)
name
- name of the minerdescription
- description of the minerpublic void setBlacklist(Blacklist blacklist)
blacklist
- for identifying ubiquitous small moleculespublic void setIDFetcher(IDFetcher idFetcher)
idFetcher
- ID generator from BioPAX objectpublic abstract Pattern constructPattern()
public Pattern getPattern()
getPattern
in interface Miner
public String getDescription()
getDescription
in interface Miner
public void setDescription(String description)
public Map<BioPAXElement,Set<String>> getIdMap()
public void setIdMap(Map<BioPAXElement,Set<String>> idMap)
protected String getGeneSymbol(ProteinReference pr)
pr
- to search for a symbolprotected String getUniprotNameForHuman(ProteinReference pr)
pr
- to search for the uniprot nameprotected String getGeneSymbol(Match m, String label)
m
- current matchlabel
- label of the related EntityReference in the patternprotected String getUniprotNameForHuman(Match m, String label)
m
- current matchlabel
- label of the related EntityReference in the patternpublic boolean isInhibition(Control ctrl)
ctrl
- Control to checkpublic Set<String> toStringSet(Set<ModificationFeature> set)
set
- modificationspublic String getModificationTerm(ModificationFeature mf)
mf
- modification featurepublic int getPositionStart(ModificationFeature mf)
mf
- modification featurepublic String getPositionInString(ModificationFeature mf)
mf
- modification featureprotected Set<String> getModifications(Match m, String label)
m
- matchlabel
- label of the PhysicalEntityprotected Set<String> getModifications(Match m, String memLabel, String comLabel)
m
- matchmemLabel
- the member-end of the PhysicalEntity chaincomLabel
- the complex-end of the PhysicalEntity chainprotected Set<String> getCellularLocations(Match m, String memLabel, String comLabel)
m
- matchmemLabel
- the member-end of the PhysicalEntity chaincomLabel
- the complex-end of the PhysicalEntity chainprotected Set<String>[] getDeltaModifications(Match m, String memLabel1, String comLabel1, String memLabel2, String comLabel2)
m
- matchmemLabel1
- the member-end of the first PhysicalEntity chaincomLabel1
- the complex-end of the first PhysicalEntity chainmemLabel2
- the member-end of the second PhysicalEntity chaincomLabel2
- the complex-end of the second PhysicalEntity chainprotected Set<String>[] getDeltaCompartments(Match m, String memLabel1, String comLabel1, String memLabel2, String comLabel2)
m
- matchmemLabel1
- the member-end of the first PhysicalEntity chaincomLabel1
- the complex-end of the first PhysicalEntity chainmemLabel2
- the member-end of the second PhysicalEntity chaincomLabel2
- the complex-end of the second PhysicalEntity chainprotected PhysicalEntityChain getChain(Match m, String memLabel, String comLabel)
protected void removeCommon(Set<String> set1, Set<String> set2)
protected String concat(Set<String> set, String sep)
set
- the setsep
- separator stringprotected int sign(Control ctrl)
ctrl
- control to checkprotected int sign(Match m, String... ctrlLabel)
m
- result matchctrlLabel
- labels for controlsprotected boolean labeledInactive(Match m, String simpleLabel, String complexLabel)
m
- the result matchsimpleLabel
- simple end of the chaincomplexLabel
- complex end of the chainpublic void writeResultAsSIF(Map<BioPAXElement,List<Match>> matches, OutputStream out, boolean directed, String label1, String label2) throws IOException
matches
- the search resultout
- output stream for text outputdirected
- if true, reverse pairs is treated as different pairslabel1
- label for the first ProteinReference in the result matcheslabel2
- label for the second ProteinReference in the result matchesIOException
- if cannot write to output streampublic void writeSIFsUsingSIFFramework(Map<BioPAXElement,List<Match>> matches, OutputStream out) throws IOException
matches
- the search resultout
- output stream for text outputIOException
- if cannot write to output streampublic String getRelationType()
writeResultAsSIF
method can implement this to have a
relationship type between gene symbol pairs.public String getHeader()
public void writeResultDetailed(Map<BioPAXElement,List<Match>> matches, OutputStream out, int columns) throws IOException
matches
- result matchesout
- output streamcolumns
- number of columns in the resultIOException
- if cannot write to the streampublic String getValue(Match m, int col)
writeResultDetailed
method is used. It
creates the column value of the given Match. If this method returns null
for any
column, then the current match is ignored.m
- current matchcol
- current columnpublic Set<SIFInteraction> createSIFInteraction(Match m, IDFetcher fetcher)
m
- match to use for SIF creationfetcher
- ID generator from BioPAX objectprotected Set<String> fetchIDs(BioPAXElement ele, IDFetcher fetcher)
public String[] getMediatorLabels()
public String[] getSourcePELabels()
public String[] getTargetPELabels()
public Set<String> getIdentifiers(Match m, String label)
m
- current matchlabel
- label of the related EntityReference in the patternpublic String getCompoundName(SmallMoleculeReference smr)
smr
- small molecule refCopyright © 2015 BioPAX. All rights reserved.