Class GeneSetController


  • @Controller
    @RequestMapping("/geneSet")
    public class GeneSetController
    extends Object
    Exposes GeneSetServices methods over ajax. Some methods take and return collections to be compatible with Store interfaces (which, as of May 2014, we do not use)
    Author:
    kelsey
    • Constructor Detail

      • GeneSetController

        public GeneSetController()
    • Method Detail

      • addSessionGroups

        @Deprecated
        public Collection<SessionBoundGeneSetValueObject> addSessionGroups​(Collection<SessionBoundGeneSetValueObject> geneSetVos,
                                                                           Boolean modificationBased)
        Deprecated.
        AJAX adds the gene group to the session, used by SessionGeneGroupStore and SessionDatasetGroupStore sets the groups taxon value and reference.
        Parameters:
        geneSetVos - value object constructed on the client.
        modificationBased - whether the set was modified by the user
        Returns:
        collection of added session groups (with updated reference.id etc)
      • addSessionGroup

        public SessionBoundGeneSetValueObject addSessionGroup​(SessionBoundGeneSetValueObject gsvo,
                                                              Boolean modificationBased)
        * AJAX adds the gene group to the session, used by SessionGeneGroupStore and SessionDatasetGroupStore sets the groups taxon value and reference.
        Parameters:
        gsvo - gsvo
        modificationBased - whether the set was modified by the user
        Returns:
        gene set vo
      • canCurrentUserEditGroup

        public String canCurrentUserEditGroup​(GeneSetValueObject gsvo)
        AJAX returns a JSON string encoding whether the current user owns the group and whether the group is db-backed
        Parameters:
        gsvo - gsvo
        Returns:
        string
      • create

        public Collection<GeneSetValueObject> create​(Collection<GeneSetValueObject> geneSetVos)
        AJAX create an entities in the database based on the value objects passed in
        Parameters:
        geneSetVos - value objects constructed on the client.
        Returns:
        value objects converted from the newly created entities
      • findGeneSetsByGene

        public Collection<GeneSetValueObject> findGeneSetsByGene​(Long geneId)
        Given a Gemma Gene Id will find all gene groups that the current user is allowed to use
        Parameters:
        geneId - gene id
        Returns:
        collection of geneSetValueObject
      • findGeneSetsByName

        public Collection<GeneSetValueObject> findGeneSetsByName​(String query,
                                                                 Long taxonId)
        Parameters:
        query - string to match to a gene set.
        taxonId - taxon id
        Returns:
        collection of GeneSetValueObject
      • getGenesInGroup

        public Collection<GeneValueObject> getGenesInGroup​(Long groupId,
                                                           Integer limit)
        AJAX If the current user has access to given gene group, will return the gene value objects in the gene group
        Parameters:
        groupId - group id
        limit - if greater than zero, limit to how many genes are returned (for previews)
        Returns:
        gene vos
      • getGeneIdsInGroup

        public Collection<Long> getGeneIdsInGroup​(Long groupId)
        AJAX
        Parameters:
        groupId - group id
        Returns:
        ids of genes in the gene set.
      • getUserAndSessionGeneGroups

        public Collection<GeneSetValueObject> getUserAndSessionGeneGroups​(boolean privateOnly,
                                                                          Long taxonId)
        AJAX Returns the current users gene sets as well as their session gene sets
        Parameters:
        privateOnly - private only
        taxonId - if non-null, restrict the groups by ones which have genes in the given taxon.
        Returns:
        gene set vos
      • getUserSessionGeneGroups

        public Collection<SessionBoundGeneSetValueObject> getUserSessionGeneGroups​(boolean privateOnly,
                                                                                   Long taxonId)
        AJAX Returns just the current users gene sets
        Parameters:
        privateOnly - private only
        taxonId - if non-null, restrict the groups by ones which have genes in the given taxon.
        Returns:
        gene set vos
      • getUsersGeneGroups

        public Collection<DatabaseBackedGeneSetValueObject> getUsersGeneGroups​(boolean privateOnly,
                                                                               Long taxonId)
        AJAX Returns just the current users gene sets
        Parameters:
        privateOnly - private only
        taxonId - if non-null, restrict the groups by ones which have genes in the given taxon.
        Returns:
        gene set vos
      • showGeneSet

        @RequestMapping(value="/showGeneSet.html",
                        method={GET,HEAD})
        public org.springframework.web.servlet.ModelAndView showGeneSet​(javax.servlet.http.HttpServletRequest request)
        If the current user has access to given gene group will return the gene ids in the gene group;
        Parameters:
        request - request
        Returns:
        model and view
      • updateMembers

        public void updateMembers​(Long groupId,
                                  Collection<Long> geneIds)
        AJAX Updates the given gene group (permission permitting) with the given list of geneIds Will not allow the same gene to be added to the gene set twice. Cannot update name or description, just members
        Parameters:
        groupId - id of the gene set being updated
        geneIds - gene ids
      • updateNameDesc

        public DatabaseBackedGeneSetValueObject updateNameDesc​(DatabaseBackedGeneSetValueObject geneSetVO)
        AJAX Updates the given gene group (permission permitting) with the given list of geneIds Will not allow the same gene to be added to the gene set twice.
        Parameters:
        geneSetVO - gene set vos
        Returns:
        gene set vo