Class 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 Details

  • Constructor Details

  • Method Details

    • annotate

      public void annotate(List<org.sbml.jsbml.ext.fbc.GeneProduct> geneProducts) throws SQLException
      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 interface IAnnotateSBases<org.sbml.jsbml.ext.fbc.GeneProduct>
      Throws:
      SQLException
    • annotate

      public void annotate(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct) throws SQLException
      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 interface IAnnotateSBases<org.sbml.jsbml.ext.fbc.GeneProduct>
      Throws:
      SQLException
    • findBiGGId

      public BiGGId findBiGGId(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct) throws SQLException
      Validates the ID of a GeneProduct against the expected BiGG ID format and attempts to retrieve a corresponding BiGGId 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 class BiGGCVTermAnnotator<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

      public String getLabel(org.sbml.jsbml.ext.fbc.GeneProduct geneProduct, BiGGId biggId)
      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 a BiGGId or be derived from AbstractSBase.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 given BiGGId. 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 - The BiGGId associated with the gene product, typically derived from a species ID.
      Throws:
      SQLException