Class GenomicRegionSearchQueryRunner

  • All Implemented Interfaces:
    java.lang.Runnable

    public class GenomicRegionSearchQueryRunner
    extends java.lang.Object
    implements java.lang.Runnable
    This class has all database query logics for genomic region search. private static final Logger LOG = Logger.getLogger(GenomicRegionSearchService.class);
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​ChromosomeInfo>> getChromosomeInfo​(org.intermine.api.InterMineAPI im)
      Query the information of all the organisms and their chromosomes' names and length.
      static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​ChromosomeInfo>> getChromosomeInfo​(org.intermine.api.InterMineAPI im, int batchSize)
      Query the information of all the organisms and their chromosomes' names and length.
      static java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getFeatureAndSOInfo​(org.intermine.api.InterMineAPI im, java.util.Map<java.lang.String,​java.lang.String> classDescrs, int batchSize)
      Query the information of all feature types and their according so terms.
      static void getRegionStringFromPathQuery​(org.intermine.pathquery.PathQuery query, org.intermine.api.InterMineAPI im, org.intermine.api.profile.Profile profile)
      query chromosome locations by a ready-to-use pathquery, return region string as chr:start..end
      static void getRegionStringFromSequenceFeatureList​(java.util.Collection<org.intermine.model.bio.SequenceFeature> features, org.intermine.api.InterMineAPI im, org.intermine.api.profile.Profile profile)
      query chromosome locations by a list of sequence features, return region string as chr:start..end
      static java.util.Map<java.lang.String,​java.lang.String> getTaxonInfo​(org.intermine.api.InterMineAPI im, int batchSize)
      Query the information of all organisms and their taxon ids.
      void run()  
      void search()
      Main body of db search
      • Methods inherited from class java.lang.Object

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

      • GenomicRegionSearchQueryRunner

        public GenomicRegionSearchQueryRunner​(javax.servlet.http.HttpServletRequest request,
                                              java.lang.String spanUUIDString,
                                              GenomicRegionSearchConstraint grsc,
                                              java.util.Map<GenomicRegion,​org.intermine.objectstore.query.Query> queryMap)
        Constructor
        Parameters:
        request - HttpServletRequest
        spanUUIDString - UUID
        grsc - GenomicRegionSearchConstraint
        queryMap - map of span and its query
    • Method Detail

      • search

        public void search()
        Main body of db search
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • getChromosomeInfo

        public static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​ChromosomeInfo>> getChromosomeInfo​(org.intermine.api.InterMineAPI im)
        Query the information of all the organisms and their chromosomes' names and length. The results is stored in a Map. The result data will be used to validate users' span data. For each span, its chromosome must match the chrPID and range must not go beyond the length.
        Parameters:
        im - - the InterMineAPI
        Returns:
        chrInfoMap - a HashMap with orgName as key and its chrInfo accordingly as value
      • getChromosomeInfo

        public static java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​ChromosomeInfo>> getChromosomeInfo​(org.intermine.api.InterMineAPI im,
                                                                                                                                   int batchSize)
        Query the information of all the organisms and their chromosomes' names and length. The results is stored in a Map. The result data will be used to validate users' span data. For each span, its chromosome must match the chrPID and range must not go beyond the length.
        Parameters:
        im - - the InterMineAPI
        batchSize - - the query batch size to use
        Returns:
        chrInfoMap - a HashMap with orgName as key and its chrInfo accordingly as value
      • getFeatureAndSOInfo

        public static java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getFeatureAndSOInfo​(org.intermine.api.InterMineAPI im,
                                                                                                                 java.util.Map<java.lang.String,​java.lang.String> classDescrs,
                                                                                                                 int batchSize)
        Query the information of all feature types and their according so terms.
        Parameters:
        im - - the InterMineAPI
        classDescrs - map of feature class/type to description
        batchSize - the query batch size to use
        Returns:
        featureTypeToSOTermMap - a HashMap with featureType as key and its SO info accordingly as value
      • getTaxonInfo

        public static java.util.Map<java.lang.String,​java.lang.String> getTaxonInfo​(org.intermine.api.InterMineAPI im,
                                                                                          int batchSize)
        Query the information of all organisms and their taxon ids.
        Parameters:
        im - - the InterMineAPI
        batchSize - the query batch size
        Returns:
        orgTaxonIdMap - a HashMap with organism as key and its taxonId as value
      • getRegionStringFromSequenceFeatureList

        public static void getRegionStringFromSequenceFeatureList​(java.util.Collection<org.intermine.model.bio.SequenceFeature> features,
                                                                  org.intermine.api.InterMineAPI im,
                                                                  org.intermine.api.profile.Profile profile)
        query chromosome locations by a list of sequence features, return region string as chr:start..end
        Parameters:
        features - list of SequenceFeature
        im - the InterMineAPI
        profile - Profile
      • getRegionStringFromPathQuery

        public static void getRegionStringFromPathQuery​(org.intermine.pathquery.PathQuery query,
                                                        org.intermine.api.InterMineAPI im,
                                                        org.intermine.api.profile.Profile profile)
        query chromosome locations by a ready-to-use pathquery, return region string as chr:start..end
        Parameters:
        query - pathquery
        im - the InterMineAPI
        profile - Profile