Class CommonQueries


  • public class CommonQueries
    extends Object
    Contains methods to perform 'common' queries that are needed across DAOs.
    Author:
    paul
    • Constructor Detail

      • CommonQueries

        public CommonQueries()
    • Method Detail

      • getArrayDesignsUsed

        public static Map<ArrayDesign,​Collection<Long>> getArrayDesignsUsed​(Collection<Long> ees,
                                                                                  Session session)
        Parameters:
        ees - collection of expression experiments.
        session - session
        Returns:
        map of array designs to the experiments they were used in.
      • getArrayDesignsUsedEEMap

        public static Map<Long,​Collection<Long>> getArrayDesignsUsedEEMap​(Collection<Long> ees,
                                                                                Session session)
        Parameters:
        ees - experiments
        session - session
        Returns:
        map of experiment to collection of array design ids. If any of the ids given are for subsets, then the key in the return value will be for the subset, not the source experiment (so it is consistent with the input)
      • getArrayDesignsUsed

        public static Collection<ArrayDesign> getArrayDesignsUsed​(ExpressionExperiment ee,
                                                                  Session session)
        Parameters:
        session - session
        ee - experiment
        Returns:
        list of array designs used in given expression experiment
      • getArrayDesignIdsUsed

        public static Collection<Long> getArrayDesignIdsUsed​(Long eeId,
                                                             Session session)
        Parameters:
        session - session
        eeId - experiment id
        Returns:
        list of array designs IDs used in given expression experiment
      • getCompositeSequences

        public static Collection<CompositeSequence> getCompositeSequences​(Gene gene,
                                                                          Session session)
        Given a gene, get all the composite sequences that map to it.
        Parameters:
        session - session
        gene - gene
        Returns:
        composite sequences
      • getCs2GeneIdMap

        public static Map<Long,​Collection<Long>> getCs2GeneIdMap​(Collection<Long> genes,
                                                                       Collection<Long> arrayDesigns,
                                                                       Session session)
        Parameters:
        session - session
        genes - genes
        arrayDesigns - array design
        Returns:
        map of probe IDs to collections of gene IDs.
      • getCs2GeneMap

        public static Map<CompositeSequence,​Collection<Gene>> getCs2GeneMap​(Collection<Gene> genes,
                                                                                  Session session)
        Parameters:
        genes - genes
        session - session
        Returns:
        map of probes to input genes they map to. Other genes those probes might detect are not included.
      • getCs2GeneMapForProbes

        public static Map<Long,​Collection<Long>> getCs2GeneMapForProbes​(Collection<Long> probes,
                                                                              Session session)
        Parameters:
        session - session
        probes - probes
        Returns:
        map of probes to all the genes 'detected' by those probes. Probes that don't map to genes will have an empty gene collection.