Class MinerAdapter
java.lang.Object
org.biopax.paxtools.pattern.miner.MinerAdapter
- All Implemented Interfaces:
Miner
- Direct Known Subclasses:
AbstractSIFMiner,ControlsStateChangeDetailedMiner,DirectedRelationMiner,RelatedGenesOfInteractionsMiner,UbiquitousIDMiner
Adapter class for a miner.
- Author:
- Ozgun Babur
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BlacklistBlacklist for identifying ubiquitous small molecules.protected StringDescription of the miner.protected IDFetcherID fetcher is used for skipping objects that cannot generate a valid ID during the search.protected Map<BioPAXElement, Set<String>> Memory for object IDs.protected StringName of the miner. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMinerAdapter(String name, String description) Constructor with name and description. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringConverts the set of string to a single string.abstract PatternConstructs the pattern to use for mining.createSIFInteraction(Match m, IDFetcher fetcher) Creates a SIF interaction for the given match.fetchIDs(BioPAXElement ele, IDFetcher fetcher) getCellularLocations(Match m, String memLabel, String comLabel) Gets cellular locations of the given elements in a string set.protected PhysicalEntityChainprotected StringGets the name of the small molecule to use in SIF.getDeltaCompartments(Match m, String memLabel1, String comLabel1, String memLabel2, String comLabel2) Gets delta compartments of the given two PE chains.getDeltaModifications(Match m, String memLabel1, String comLabel1, String memLabel2, String comLabel2) Gets delta modifications of the given elements in string sets.Gets the description of the miner.protected StringSearches for the gene symbol of the given EntityReference.protected StringgetGeneSymbol(Match m, String label) Searches for the gene symbol of the given EntityReference.Gets the first line of the result file.getIdentifiers(Match m, String label) Uses uniprot name or gene symbol as identifier.getIdMap()String[]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.getModifications(Match m, String label) Gets modifications of the given element in a string.getModifications(Match m, String memLabel, String comLabel) Gets modifications of the given elements in a string set.Gets the String term of the modification feature.getName()Gets the name of the miner.Gets the pattern, constructs if null.Gets the position of the modification feature as a String.intGets the first position of the modification feature.protected StringChecks if the relation captured by match has a type.String[]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[]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 StringSearches for the uniprot name of the given human EntityReference.protected StringgetUniprotNameForHuman(Match m, String label) Searches for the uniprot name of the given human EntityReference.This method has to be overridden ifwriteResultDetailedmethod is used.booleanisInhibition(Control ctrl) Checks if the type of a Control is inhibition.protected booleanlabeledInactive(Match m, String simpleLabel, String complexLabel) Checks if a PE chain is labeled as inactive.protected voidremoveCommon(Set<String> set1, Set<String> set2) voidsetBlacklist(Blacklist blacklist) Sets the blacklist to use during SIF search.voidsetDescription(String description) voidsetIDFetcher(IDFetcher idFetcher) Sets the ID fetcher to use during SIF search.voidsetIdMap(Map<BioPAXElement, Set<String>> idMap) voidprotected intIdentifies negative and positive controls.protected intChecks the cumulative sign of the chained controls.toString()Uses the name as sting representation of the miner.Sorts the modifications and gets them in a String.protected voidwriteResultAsSIF(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.protected voidwriteResultDetailed(Map<BioPAXElement, List<Match>> matches, OutputStream out, int columns) Writes the result as a tab delimited format, where the column values are customized.protected voidwriteSIFsUsingSIFFramework(Map<BioPAXElement, List<Match>> matches, OutputStream out) This method writes the output as pairs of gene symbols of the given two ProteinReference.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biopax.paxtools.pattern.miner.Miner
writeResult
-
Field Details
-
name
Name of the miner. -
description
Description of the miner. -
blacklist
Blacklist for identifying ubiquitous small molecules. -
idFetcher
ID fetcher is used for skipping objects that cannot generate a valid ID during the search. -
idMap
Memory for object IDs. This is needed for performance issues. Without this, half of SIF conversion is spent for fetchIDs().
-
-
Constructor Details
-
MinerAdapter
Constructor with name and description.- Parameters:
name- name of the minerdescription- description of the miner
-
-
Method Details
-
setBlacklist
Sets the blacklist to use during SIF search.- Parameters:
blacklist- for identifying ubiquitous small molecules
-
setIDFetcher
Sets the ID fetcher to use during SIF search.- Parameters:
idFetcher- ID generator from BioPAX object
-
constructPattern
Constructs the pattern to use for mining.- Returns:
- the pattern
-
getPattern
Gets the pattern, constructs if null.- Specified by:
getPatternin interfaceMiner- Returns:
- pattern
-
getName
Gets the name of the miner. -
getDescription
Gets the description of the miner.- Specified by:
getDescriptionin interfaceMiner- Returns:
- description
-
setName
-
setDescription
-
getIdMap
-
setIdMap
-
toString
Uses the name as sting representation of the miner. -
getGeneSymbol
Searches for the gene symbol of the given EntityReference.- Parameters:
pr- to search for a symbol- Returns:
- symbol
-
getUniprotNameForHuman
Searches for the uniprot name of the given human EntityReference.- Parameters:
pr- to search for the uniprot name- Returns:
- uniprot name
-
getGeneSymbol
Searches for the gene symbol of the given EntityReference.- Parameters:
m- current matchlabel- label of the related EntityReference in the pattern- Returns:
- symbol
-
getUniprotNameForHuman
Searches for the uniprot name of the given human EntityReference.- Parameters:
m- current matchlabel- label of the related EntityReference in the pattern- Returns:
- uniprot name
-
isInhibition
Checks if the type of a Control is inhibition.- Parameters:
ctrl- Control to check- Returns:
- true if type is inhibition related
-
toStringSet
Sorts the modifications and gets them in a String.- Parameters:
set- modifications- Returns:
- a String listing the modifications
-
getModificationTerm
Gets the String term of the modification feature.- Parameters:
mf- modification feature- Returns:
- modification term
-
getPositionStart
Gets the first position of the modification feature.- Parameters:
mf- modification feature- Returns:
- first location
-
getPositionInString
Gets the position of the modification feature as a String.- Parameters:
mf- modification feature- Returns:
- location
-
getModifications
Gets modifications of the given element in a string. The element has to be a PhysicalEntity.- Parameters:
m- matchlabel- label of the PhysicalEntity- Returns:
- modifications
-
getModifications
Gets modifications of the given elements in a string set. The elements has to be a PhysicalEntity and they must be two ends of a chain with homology and/or complex membership relations.- Parameters:
m- matchmemLabel- the member-end of the PhysicalEntity chaincomLabel- the complex-end of the PhysicalEntity chain- Returns:
- modifications
-
getCellularLocations
Gets cellular locations of the given elements in a string set. The elements has to be a PhysicalEntity and they must be two ends of a chain with homology and/or complex membership relations.- Parameters:
m- matchmemLabel- the member-end of the PhysicalEntity chaincomLabel- the complex-end of the PhysicalEntity chain- Returns:
- cellular locations
-
getDeltaModifications
protected Set<String>[] getDeltaModifications(Match m, String memLabel1, String comLabel1, String memLabel2, String comLabel2) Gets delta modifications of the given elements in string sets. The elements has to be two PhysicalEntity chains. The result array is composed of two strings: gained (0) and lost (1).- Parameters:
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 chain- Returns:
- delta modifications
-
getDeltaCompartments
protected Set<String>[] getDeltaCompartments(Match m, String memLabel1, String comLabel1, String memLabel2, String comLabel2) Gets delta compartments of the given two PE chains. The result array is composed of two string sets: gained (0) and lost (1).- Parameters:
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 chain- Returns:
- delta compartments
-
getChain
-
removeCommon
-
concat
Converts the set of string to a single string.- Parameters:
set- the setsep- separator string- Returns:
- concatenated string
-
sign
Identifies negative and positive controls. Assumes positive by default.- Parameters:
ctrl- control to check- Returns:
- sign
-
sign
Checks the cumulative sign of the chained controls.- Parameters:
m- result matchctrlLabel- labels for controls- Returns:
- sign
-
labeledInactive
Checks if a PE chain is labeled as inactive.- Parameters:
m- the result matchsimpleLabel- simple end of the chaincomplexLabel- complex end of the chain- Returns:
- true if labeled inactive
-
writeResultAsSIF
protected void writeResultAsSIF(Map<BioPAXElement, List<Match>> matches, OutputStream out, boolean directed, String label1, String label2) throws IOExceptionThis method writes the output as pairs of gene symbols of the given two ProteinReference. Parameters labels have to map to ProteinReference.- Parameters:
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 matches- Throws:
IOException- if cannot write to output stream
-
writeSIFsUsingSIFFramework
protected void writeSIFsUsingSIFFramework(Map<BioPAXElement, List<Match>> matches, OutputStream out) throws IOExceptionThis method writes the output as pairs of gene symbols of the given two ProteinReference. Parameters labels have to map to ProteinReference.- Parameters:
matches- the search resultout- output stream for text output- Throws:
IOException- if cannot write to output stream
-
getRelationType
Checks if the relation captured by match has a type. THis method just returns null but any child class usingwriteResultAsSIFmethod can implement this to have a relationship type between gene symbol pairs.- Returns:
- type of the relation
-
getHeader
Gets the first line of the result file. This method should be overridden to customize the header of the result file.- Returns:
- header
-
writeResultDetailed
protected void writeResultDetailed(Map<BioPAXElement, List<Match>> matches, OutputStream out, int columns) throws IOExceptionWrites the result as a tab delimited format, where the column values are customized.- Parameters:
matches- result matchesout- output streamcolumns- number of columns in the result- Throws:
IOException- if cannot write to the stream
-
getValue
This method has to be overridden ifwriteResultDetailedmethod is used. It creates the column value of the given Match. If this method returnsnullfor any column, then the current match is ignored.- Parameters:
m- current matchcol- current column- Returns:
- column value
-
createSIFInteraction
Creates a SIF interaction for the given match.- Parameters:
m- match to use for SIF creationfetcher- ID generator from BioPAX object- Returns:
- SIF interaction
-
fetchIDs
-
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.- Returns:
- labels of elements to collect publication refs
-
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.- Returns:
- labels of elements
-
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.- Returns:
- labels of elements
-
getIdentifiers
Uses uniprot name or gene symbol as identifier.- Parameters:
m- current matchlabel- label of the related EntityReference in the pattern- Returns:
- identifier
-
getCompoundName
Gets the name of the small molecule to use in SIF.- Parameters:
smr- small molecule ref- Returns:
- a name
-