Class BiGGGeneProductAnnotator
java.lang.Object
de.uni_halle.informatik.biodata.mp.annotation.AbstractAnnotator
de.uni_halle.informatik.biodata.mp.annotation.bigg.AbstractBiGGAnnotator
de.uni_halle.informatik.biodata.mp.annotation.bigg.BiGGCVTermAnnotator<org.sbml.jsbml.ext.fbc.GeneProduct>
de.uni_halle.informatik.biodata.mp.annotation.bigg.ext.fbc.BiGGGeneProductAnnotator
- All Implemented Interfaces:
IAnnotateSBases<org.sbml.jsbml.ext.fbc.GeneProduct>
,IReportDiffs
,IReportStatus
public class BiGGGeneProductAnnotator
extends BiGGCVTermAnnotator<org.sbml.jsbml.ext.fbc.GeneProduct>
implements IAnnotateSBases<org.sbml.jsbml.ext.fbc.GeneProduct>
Provides functionality to annotate gene products in an SBML model using data from the BiGG database.
This class extends
BiGGCVTermAnnotator
and specifically handles the annotation of GeneProduct
instances.
It includes methods to validate gene product IDs, retrieve and set labels, and add annotations based on BiGG IDs.-
Field Summary
Fields inherited from class de.uni_halle.informatik.biodata.mp.annotation.bigg.AbstractBiGGAnnotator
bigg, biGGAnnotationParameters, registry
-
Constructor Summary
ConstructorDescriptionBiGGGeneProductAnnotator
(BiGGGeneProductReferencesAnnotator gprAnnotator, BiGGDB bigg, BiGGAnnotationParameters parameters, Registry registry, List<ProgressObserver> observers) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotations
(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct, BiGGId biggId) Adds annotations to a gene product based on a givenBiGGId
.void
This method handles the annotation of gene products in a given SBML model.void
annotate
(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct) Annotates a gene product by adding relevant metadata and references.findBiGGId
(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct) Validates the ID of aGeneProduct
against the expected BiGG ID format and attempts to retrieve a correspondingBiGGId
from existing annotations if the initial ID does not conform to the BiGG format.Retrieves the label for a gene product based on the provided BiGGId.void
setGPLabelName
(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct, String label) Updates the label of a gene product and sets its name based on the retrieved gene name from the BiGG database.Methods inherited from class de.uni_halle.informatik.biodata.mp.annotation.bigg.AbstractBiGGAnnotator
getBiGGIdFromResources
Methods inherited from class de.uni_halle.informatik.biodata.mp.annotation.AbstractAnnotator
diffReport, getObservers, statusReport
-
Field Details
-
BIGG_GENE_ID_PATTERN
- See Also:
-
-
Constructor Details
-
BiGGGeneProductAnnotator
public BiGGGeneProductAnnotator(BiGGGeneProductReferencesAnnotator gprAnnotator, BiGGDB bigg, BiGGAnnotationParameters parameters, Registry registry, List<ProgressObserver> observers)
-
-
Method Details
-
annotate
This method handles the annotation of gene products in a given SBML model. It checks if the model has the FBC plugin set and then proceeds to annotate each gene product found within the model. The progress bar is updated to reflect the number of gene products being annotated.- Specified by:
annotate
in interfaceIAnnotateSBases<org.sbml.jsbml.ext.fbc.GeneProduct>
- Throws:
SQLException
-
annotate
Annotates a gene product by adding relevant metadata and references. This method first checks the gene product's ID for validity and retrieves a corresponding BiGGId if available. It then attempts to get a label for the gene product. If no label is found, the method returns early. If a label is present, it updates the gene product reference in the association, adds annotations using the BiGGId, and sets the gene product's metaId if it has any CV terms. Finally, it sets the gene product's label name.- Specified by:
annotate
in interfaceIAnnotateSBases<org.sbml.jsbml.ext.fbc.GeneProduct>
- Throws:
SQLException
-
findBiGGId
Validates the ID of aGeneProduct
against the expected BiGG ID format and attempts to retrieve a correspondingBiGGId
from existing annotations if the initial ID does not conform to the BiGG format. The method first checks if the gene product's ID matches the BiGG ID pattern. If it does not match, it then tries to find a valid BiGG ID from the gene product's annotations. If a valid BiGG ID is found among the annotations, it updates the ID; otherwise, it retains the original ID.- Specified by:
findBiGGId
in classBiGGCVTermAnnotator<org.sbml.jsbml.ext.fbc.GeneProduct>
- Returns:
- An
Optional<BiGGId>
containing the validated or retrieved BiGG ID, or an empty Optional if no valid ID is found. - Throws:
SQLException
-
getLabel
Retrieves the label for a gene product based on the provided BiGGId. If the gene product has a label set and it is not "None", that label is returned. If no label is set but the gene product has an ID, the BiGGId is converted to a string and returned. If neither condition is met, an empty string is returned.- Parameters:
biggId
- An Optional containing the BiGGId of the gene product, which may be used to generate a label if the gene product's own label is not set.- Returns:
- An
Optional<String>
containing the label of the gene product, or an empty string if no appropriate label is found.
-
setGPLabelName
public void setGPLabelName(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct, String label) throws SQLException Updates the label of a gene product and sets its name based on the retrieved gene name from the BiGG database. If the current label is set to "None", it updates the label to the provided one. It then attempts to fetch the gene name corresponding to this label from the BiGG database. If a gene name is found, it checks if the current gene product name is different from the fetched name. If they differ, it logs a warning and updates the gene product name. If no gene name is found, it logs this as a fine-level message.- Parameters:
label
- The label to set or use for fetching the gene name. This label should correspond to aBiGGId
or be derived fromAbstractSBase.getId()
.- Throws:
SQLException
-
addAnnotations
public void addAnnotations(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct, BiGGId biggId) throws SQLException Adds annotations to a gene product based on a givenBiGGId
. This method differentiates between annotations that specify what the gene product 'is' and what it 'is encoded by'. Resources are fetched from the BiGG database using the abbreviation from the provided BiGGId. Each resource URL is checked and parsed to determine the appropriate category ('is' or 'is encoded by') based on predefined prefixes.- Parameters:
biggId
- TheBiGGId
associated with the gene product, typically derived from a species ID.- Throws:
SQLException
-