Class GeneModelCache


  • public final class GeneModelCache
    extends java.lang.Object
    A cache for gene models by Gene object id. A GeneModel represetnts a transcripts with exons, introns, UTRs and CDSs where data are available. Lookups can be done by any component of the gene model and the corresponding gene will be found first. The implementation uses a CacheMap to allow garbage collection.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.apache.log4j.Logger LOG  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.util.List<GeneModel> fetchGeneModels​(org.intermine.model.bio.Gene gene, org.intermine.metadata.Model model)
      Look up gene models for a particular gene, either fetch from cache or create new gene models for each transcript.
      static java.util.Set<java.lang.Integer> getGeneModelIds​(org.intermine.model.InterMineObject object, org.intermine.metadata.Model model)
      Look up the gene models for a given gene or gene model component and return the ids of all objects involved.
      static GeneModelSettings getGeneModelOrganismSettings​(java.lang.String organismName, org.intermine.objectstore.ObjectStore os)  
      static java.util.List<GeneModel> getGeneModels​(org.intermine.model.InterMineObject object, org.intermine.metadata.Model model)
      Fetch a list of gene models for a gene.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        protected static final org.apache.log4j.Logger LOG
    • Method Detail

      • getGeneModels

        public static java.util.List<GeneModel> getGeneModels​(org.intermine.model.InterMineObject object,
                                                              org.intermine.metadata.Model model)
        Fetch a list of gene models for a gene. The method can be called with an component of a gene model (Transcript, Exon, Intron, UTR, CDS) and corresponding gene will be returned first. e.g. if called with an exon, the related gene will be found and all gene models created for all transcripts of that gene regardless of whether they contain that exon. If called with an object that isn't a gene model component an empty list is returned.
        Parameters:
        object - a the gene to get gene models for, or a component of a gene model
        model - the data model
        Returns:
        a list of GeneModels, one per transcript or an empty list
      • fetchGeneModels

        protected static java.util.List<GeneModel> fetchGeneModels​(org.intermine.model.bio.Gene gene,
                                                                   org.intermine.metadata.Model model)
        Look up gene models for a particular gene, either fetch from cache or create new gene models for each transcript.
        Parameters:
        gene - the gene to fetch gene models for
        model - the data model
        Returns:
        a list of gene models or an empty list
      • getGeneModelOrganismSettings

        public static GeneModelSettings getGeneModelOrganismSettings​(java.lang.String organismName,
                                                                     org.intermine.objectstore.ObjectStore os)
        Parameters:
        organismName - org name
        os - ObjectStore
        Returns:
        GeneModelSettings
      • getGeneModelIds

        public static java.util.Set<java.lang.Integer> getGeneModelIds​(org.intermine.model.InterMineObject object,
                                                                       org.intermine.metadata.Model model)
        Look up the gene models for a given gene or gene model component and return the ids of all objects involved. If no gene model is found or object is not a gene model component and empty set is returned.
        Parameters:
        object - a gene or gene model component to look up
        model - the data model
        Returns:
        the ids of all objects in the gene model or an empty set