コード例 #1
0
ファイル: __init__.py プロジェクト: jmchilton/bioblend
 def get_most_recently_used_history(self):
     """
     Returns the current user's most recently used history (not deleted).
     """
     url = self.gi._make_url(self, None)
     url = "/".join([url, "most_recently_used"])
     return Client._get(self, url=url)
コード例 #2
0
ファイル: __init__.py プロジェクト: andrewjrobinson/bioblend
    def get_repository_revision_install_info(self,name,owner,changeset_revision):

        """
        Return a list of dictionaries of metadata about a certain changeset revision for a single tool
        
        :type name: string
        :param name: the name of the repository

        :type owner: string
        :param owner: the owner of the repository

        :type changeset_revision: string
        :param changeset_revision: the changset_revision of the RepositoryMetadata object associated with the repository
        
        :rtype: List of dictionaries
        :return: Returns a list of the following dictionaries:
        a dictionary defining the repository
        a dictionary defining the repository revision (RepositoryMetadata)
        a dictionary including the additional information required to install the repository
        
                 For example::
                 [{u'times_downloaded': 269, u'user_id': u'1de29d50c3c44272', u'description': u'Galaxy Freebayes Bayesian genetic variant detector tool', u'deleted': False, u'deprecated': False, u'private': False, u'long_description': u'Galaxy Freebayes Bayesian genetic variant detector tool originally included in the Galaxy code distribution but migrated to the tool shed.', u'url': u'/api/repositories/491b7a3fddf9366f', u'owner': u'devteam', u'id': u'491b7a3fddf9366f', u'name': u'freebayes'},
                 {u'repository_id': u'491b7a3fddf9366f', u'has_repository_dependencies': False, u'includes_tools_for_display_in_tool_panel': True, u'url': u'/api/repository_revisions/504be8aaa652c154', u'malicious': False, u'includes_workflows': False, u'downloadable': True, u'includes_tools': True, u'changeset_revision': u'd291dc763c4c', u'id': u'504be8aaa652c154', u'includes_tool_dependencies': True, u'includes_datatypes': False}, {u'freebayes': [u'Galaxy Freebayes Bayesian genetic variant detector tool', u'http://[email protected]/repos/devteam/freebayes', u'd291dc763c4c', u'9', u'devteam', {},
                 {u'freebayes/0.9.6_9608597d12e127c847ae03aa03440ab63992fedf': {u'repository_name': u'freebayes', u'name': u'freebayes', u'readme': u'\nFreeBayes requires g++ and the standard C and C++ development libraries.\nAdditionally, cmake is required for building the BamTools API.\n        ', u'version': u'0.9.6_9608597d12e127c847ae03aa03440ab63992fedf', u'repository_owner': u'devteam', u'changeset_revision': u'd291dc763c4c', u'type': u'package'}, u'samtools/0.1.18': {u'repository_name': u'freebayes', u'name': u'samtools', u'readme': u'\nCompiling SAMtools requires the ncurses and zlib development libraries.\n        ', u'version': u'0.1.18', u'repository_owner': u'devteam', u'changeset_revision': u'd291dc763c4c', u'type': u'package'}}]}]
        
        """
        
        url = self.url + '/get_repository_revision_install_info'
        params = {}
        params['name'] = name
        params['owner'] = owner
        params['changeset_revision']=changeset_revision

        return Client._get(self,url=url,params=params)
コード例 #3
0
ファイル: __init__.py プロジェクト: gvlproject/bioblend
    def show_invocation_step(self, workflow_id, invocation_id, step_id):
        """ See the details of a particular workflow invocation step.

        :type workflow_id: str
        :param workflow_id: Encoded workflow ID

        :type invocation_id: str
        :param invocation_id: Encoded workflow invocation ID

        :type step_id: str
        :param step_id: Encoded workflow invocation step ID

        :rtype: dict
        :return: The workflow invocation step.
           For example::

                   {u'workflow_step_uuid': u'4060554c-1dd5-4287-9040-8b4f281cf9dc',
                    u'update_time': u'2015-10-31T22:11:14',
                    u'job_id': None,
                    u'state': None,
                    u'workflow_step_label': None,
                    u'order_index': 2,
                    u'action': None,
                    u'model_class': u'WorkflowInvocationStep',
                    u'workflow_step_id': u'52e496b945151ee8',
                    u'id': u'63cd3858d057a6d1'}

        """
        url = self._invocation_step_url(workflow_id, invocation_id, step_id)
        return Client._get(self, url=url)
コード例 #4
0
ファイル: __init__.py プロジェクト: boratonAJ/bioblend
    def get_libraries(self, library_id=None, name=None, deleted=False):
        """
        Get all the libraries or filter for specific one(s) via the provided name or ID.
        Provide only one argument: ``name`` or ``library_id``, but not both.

        :type library_id: str
        :param library_id: filter for library by library id

        :type name: str
        :param name: If ``name`` is set and multiple names match the given
                     name, all the libraries matching the argument will be
                     returned.

        :type deleted: bool
        :param deleted: If set to ``True``, return libraries that have been
                        deleted.

        :rtype: list
        :return: list of dicts each containing basic information about a library.
        """
        if library_id is not None and name is not None:
            raise ValueError('Provide only one argument between name or library_id, but not both')
        libraries = Client._get(self, deleted=deleted)
        if library_id is not None:
            library = next((_ for _ in libraries if _['id'] == library_id), None)
            libraries = [library] if library is not None else []
        if name is not None:
            libraries = [_ for _ in libraries if _['name'] == name]
        return libraries
コード例 #5
0
 def show_history(self, history_id, contents=False):
     """
     Get details of a given history. By default, just get the history meta
     information. If ``contents`` is set to ``True``, get the complete list of
     datasets in the given history.
     """
     return Client._get(self, id=history_id, contents=contents)
コード例 #6
0
ファイル: __init__.py プロジェクト: kidaak/bioblend
    def show_genome(self, id, num=None, chrom=None, low=None, high=None):
        """
        Returns information about build <id>

        :type id: str
        :param id: Genome build ID to use

        :type num: str
        :param num: num

        :type chrom: str
        :param chrom: chrom

        :type low: str
        :param low: low

        :type high: str
        :param high: high
        """
        params = {}
        if num:
            params["num"] = num
        if chrom:
            params["chrom"] = chrom
        if low:
            params["low"] = low
        if high:
            params["high"] = high
        return Client._get(self, id, params)
コード例 #7
0
ファイル: __init__.py プロジェクト: bgruening/bioblend
    def get_datatypes(self, extension_only=False, upload_only=False):
        """
        Get the list of all installed datatypes.

        :rtype: list
        :return: A list of datatype names.
          For example::

            [u'snpmatrix',
             u'snptest',
             u'tabular',
             u'taxonomy',
             u'twobit',
             u'txt',
             u'vcf',
             u'wig',
             u'xgmml',
             u'xml']
        """

        params = {}
        if extension_only:
            params['extension_only'] = True

        if upload_only:
            params['upload_only'] = True

        return Client._get(self, params=params)
コード例 #8
0
ファイル: __init__.py プロジェクト: jmchilton/bioblend
    def show_history(self, history_id, contents=False, deleted=None, visible=None, details=None, types=None):
        """
        Get details of a given history. By default, just get the history meta
        information.

        :type history_id: str
        :param history_id: Encoded history ID to filter on

        :type contents: str
        :param contents: When true, the complete list of datasets in the given history.

        :type deleted: str
        :param deleted: Used when contents=True, includes deleted datasets is history dataset list

        :type visible: str
        :param visible: Used when contents=True, includes only visible datasets is history dataset list

        :type details: str
        :param details: Used when contents=True, includes dataset details. Set to 'all' for the most information

        :type types: str
        :param types: ???
        """
        params = {}
        if contents:
            if details:
                params["details"] = details
            if deleted is not None:
                params["deleted"] = deleted
            if visible is not None:
                params["visible"] = visible
            if types is not None:
                params["types"] = types.join(",")
        return Client._get(self, id=history_id, contents=contents, params=params)
コード例 #9
0
ファイル: __init__.py プロジェクト: odoppelt/bioblend
    def get_workflows(self, workflow_id=None, name=None, deleted=False):
        """
        Get all workflows or filter the specific one(s) via the provided ``name``
        or ``workflow_id``. Provide only one argument, ``name`` or ``workflow_id``,
        but not both.

        If ``name`` is set and multiple names match the given name, all the
        workflows matching the argument will be returned.

        If ``deleted`` is set to ``True``, return workflows that have been deleted.

        Return a list of JSON formatted dicts each containing basic information
        about a workflow.

        :rtype: list
        :return: A list of workflow dicts.
                 For example::

                   [{u'id': u'92c56938c2f9b315',
                     u'name': u'Simple',
                     u'url': u'/api/workflows/92c56938c2f9b315'}]

        """

        workflows = Client._get(self, deleted=deleted)
        if name is not None or workflow_id is not None:
            filtered_wfs = []
            for workflow in workflows:
                if name == workflow['name'] or workflow_id == workflow['id']:
                    filtered_wfs.append(workflow)
                    # Workflows ID's are unique so break now that the wf was found
                    if workflow_id is not None:
                        break
            workflows = filtered_wfs
        return workflows
コード例 #10
0
ファイル: __init__.py プロジェクト: ratzeni/bioblend
    def show_job(self, job_id, full_details=False):
        """
        Display information on a single job from current user

        :type job_id: str
        :param job_id: Specific job ID

        :type full_details: bool
        :param full_details: When ``True``, the complete list of details for the
          given job.

        :rtype: dict
        :return: A description of single job
                 For example::

                 {   u'create_time': u'2014-03-01T16:17:29.828624',
                 u'exit_code': 0,
                 u'id': u'a799d38679e985db',
                 u'inputs': {   u'input': {   u'id': u'ebfb8f50c6abde6d', u'src': u'hda'}},
                 u'model_class': u'Job',
                 u'outputs': {   u'output': {   u'id': u'a799d38679e985db', u'src': u'hda'}},
                 u'params': {   u'chromInfo': u'"/opt/galaxy-central/tool-data/shared/ucsc/chrom/?.len"',
                 u'dbkey': u'"?"',
                 u'seq_col': u'"2"',
                 u'title_col': u'["1"]'},
                 u'state': u'ok',
                 u'tool_id': u'tab2fasta',
                 u'update_time': u'2014-03-01T16:17:31.930728'}

        """
        params = {}
        if full_details:
            params['full'] = full_details

        return Client._get(self, id=job_id, params=params)
コード例 #11
0
ファイル: __init__.py プロジェクト: dannon/bioblend
    def get_jobs(self):
        """
        Get a list of jobs for current user

        :type   state: string or list
        :param  state: limit listing of jobs to those that match one of the included states. If none, all are returned.
        Valid Galaxy job states include:
        'new', 'upload', 'waiting', 'queued', 'running', 'ok', 'error', 'paused', 'deleted', 'deleted_new'

        :type   tool_id: string or list
        :param  tool_id: limit listing of jobs to those that match one of the included tool_ids. If none, all are returned.

        :type   history_id: string
        :param  history_id: limit listing of jobs to those that match the history_id. If none, all are returned.

        :rtype:     list
        :returns:   list of dictionaries containing summary job information
                 For example::

                 [{ u'create_time': u'2014-03-01T16:16:48.640550',
                 u'exit_code': 0,
                 u'id': u'ebfb8f50c6abde6d',
                 u'model_class': u'Job',
                 u'state': u'ok',
                 u'tool_id': u'fasta2tab',
                 u'update_time': u'2014-03-01T16:16:50.657399'},
                 {u'create_time': u'2014-03-01T16:05:34.851246',
                 u'exit_code': 0,
                 u'id': u'1cd8e2f6b131e891',
                 u'model_class': u'Job',
                 u'state': u'ok',
                 u'tool_id': u'upload1',
                 u'update_time': u'2014-03-01T16:05:39.558458'}]
        """
        return Client._get(self)
コード例 #12
0
ファイル: __init__.py プロジェクト: dannon/bioblend
    def show_job(self, job_id):
        """
        Display information on a single job from current user

        :type job_id: string
        :param job_id: Specific job ID

        :rtype: dict
        :return: A description of single job
                 For example::

                 {   u'create_time': u'2014-03-01T16:17:29.828624',
                 u'exit_code': 0,
                 u'id': u'a799d38679e985db',
                 u'inputs': {   u'input': {   u'id': u'ebfb8f50c6abde6d', u'src': u'hda'}},
                 u'model_class': u'Job',
                 u'outputs': {   u'output': {   u'id': u'a799d38679e985db', u'src': u'hda'}},
                 u'params': {   u'chromInfo': u'"/opt/galaxy-central/tool-data/shared/ucsc/chrom/?.len"',
                 u'dbkey': u'"?"',
                 u'seq_col': u'"2"',
                 u'title_col': u'["1"]'},
                 u'state': u'ok',
                 u'tool_id': u'tab2fasta',
                 u'update_time': u'2014-03-01T16:17:31.930728'}

        """

        return Client._get(self, id=job_id)
コード例 #13
0
 def get_current_history(self):
     """
     Returns the current user's most recently used history object (not deleted)
     """
     url = self.gi._make_url(self, None)
     url = '/'.join([url, 'most_recently_used'])
     return Client._get(self, url=url)
コード例 #14
0
ファイル: __init__.py プロジェクト: Pandorin/bioblend
    def show_visualization(self, visual_id):
        """
        Display information on a visualization

        :type visual_id: string
        :param visual_id: Encoded visualization ID

        :rtype: dict
        :return: A description of visualization
                 For example::

                   {u'annotation': None,u'dbkey': u'mm9',
                   u'id': u'18df9134ea75e49c',
                   u'latest_revision': {  ... },
                   u'model_class': u'Visualization',
                   u'revisions': [   u'aa90649bb3ec7dcb',
                   u'20622bc6249c0c71'],
                   u'slug': u'visualization-for-grant-1',
                   u'title': u'Visualization For Grant',
                   u'type': u'trackster',
                   u'url': u'/u/azaron/v/visualization-for-grant-1',
                   u'user_id': u'21e4aed91386ca8b'}

        """
        return Client._get(self, id=visual_id)
コード例 #15
0
ファイル: __init__.py プロジェクト: abretaud/bioblend
    def show_quota(self, quota_id, deleted=False):
        """
        Display information on a quota

        :type quota_id: string
        :param quota_id: Encoded quota ID

        :type deleted: Boolean
        :param deleted: Search for quota in list of ones already marked as deleted


        :rtype: dict
        :return: A description of quota
                 For example::

                   {   u'bytes': 107374182400,
                   u'default': [],
                   u'description': u'just testing',
                   u'display_amount': u'100.0 GB',
                   u'groups': [],
                   u'id': u'0604c8a56abe9a50',
                   u'model_class': u'Quota',
                   u'name': u'test ',
                   u'operation': u'=',
                   u'users': []}


        """
        return Client._get(self, id=quota_id, deleted=deleted)
コード例 #16
0
ファイル: __init__.py プロジェクト: AAFC-MBB/bioblend
    def get_histories(self, history_id=None, name=None, deleted=False):
        """
        Get all histories or filter the specific one(s) via the provided
        ``name`` or ``history_id``. Provide only one argument, ``name`` or
        ``history_id``, but not both.

        If ``deleted`` is set to ``True``, return histories that have been
        deleted.

        :type history_id: str
        :param history_id: Encoded history ID to filter on

        :type name: str
        :param name: Name of history to filter on

        :rtype: list
        :return: Return a list of history element dicts. If more than one
                 history matches the given ``name``, return the list of all the
                 histories with the given name
        """
        if history_id is not None and name is not None:
            raise ValueError('Provide only one argument between name or history_id, but not both')
        histories = Client._get(self, deleted=deleted)
        if history_id is not None:
            history = next((_ for _ in histories if _['id'] == history_id), None)
            histories = [history] if history is not None else []
        elif name is not None:
            histories = [_ for _ in histories if _['name'] == name]
        return histories
コード例 #17
0
ファイル: __init__.py プロジェクト: bgruening/bioblend
    def show_repository(self, toolShed_id):
        """
        Display information of a repository from Tool Shed

        :type toolShed_id: str
        :param toolShed_id: Encoded Tool Shed ID

        :rtype: dict
        :return: Information about the tool.
          For example::

            {u'category_ids': [u'c1df3132f6334b0e', u'f6d7b0037d901d9b'],
             u'deleted': False,
             u'deprecated': False,
             u'description': u'Order Contigs',
             u'homepage_url': u'',
             u'id': u'287bd69f724b99ce',
             u'long_description': u'',
             u'name': u'best_tool_ever',
             u'owner': u'billybob',
             u'private': False,
             u'remote_repository_url': u'',
             u'times_downloaded': 0,
             u'type': u'unrestricted',
             u'url': u'/api/repositories/287bd69f724b99ce',
             u'user_id': u'5cefd48bc04af6d4'}

        .. versionchanged:: 0.4.1
          Changed method name from ``show_tool`` to ``show_repository`` to
          better align with the Tool Shed concepts.
        """
        return Client._get(self, id=toolShed_id)
コード例 #18
0
ファイル: __init__.py プロジェクト: Intel-HSS/bioblend
    def get_sniffers(self):
        """
        Displays a collection (list) of sniffers.

        :rtype: list
        :return: A list of  individual sniffers.
                 For example::

                 [u'galaxy.datatypes.tabular:Vcf',
                 u'galaxy.datatypes.binary:TwoBit',
                 u'galaxy.datatypes.binary:Bam',
                 u'galaxy.datatypes.binary:Sff',
                 u'galaxy.datatypes.xml:Phyloxml',
                 u'galaxy.datatypes.xml:GenericXml',
                 u'galaxy.datatypes.sequence:Maf',
                 u'galaxy.datatypes.sequence:Lav',
                 u'galaxy.datatypes.sequence:csFasta']



        """

        url = self.gi._make_url(self)
        url = '/'.join([url, "sniffers"])

        return Client._get(self, url=url)
コード例 #19
0
ファイル: __init__.py プロジェクト: abretaud/bioblend
 def get_current_user(self):
     """
     Returns the user id associated with this Galaxy connection
     """
     url = self.gi._make_url(self, None)
     url = '/'.join([url, 'current'])
     return Client._get(self, url=url)
コード例 #20
0
ファイル: __init__.py プロジェクト: odoppelt/bioblend
    def get_folders(self, library_id, folder_id=None, name=None, deleted=False):
        """
        Get all the folders or filter specific one(s) via the provided ``name``
        or ``folder_id`` in data library with id ``library_id``. Provide only one
        argument: ``name`` or ``folder_id``, but not both.

        If ``name`` is set and multiple names match the given name, all the
        folders matching the argument will be returned.

        If ``deleted`` is set to ``True``, return folders that have been deleted.

        Return a list of JSON formatted dicts each containing basic information
        about a folder.
        """
        library_contents = Client._get(self, id=library_id, contents=True)
        folders = []
        filtered_folders = []
        for content in library_contents:
            if content['type'] == 'folder':
                folders.append(content)
                if name == content['name'] or folder_id == content['id']:
                    filtered_folders.append(content)
                if folder_id is not None and filtered_folders:
                    break
        if name is not None or folder_id is not None:
            folders = filtered_folders
        return folders
コード例 #21
0
ファイル: __init__.py プロジェクト: cariaso/bioblend
    def get_folders(self, library_id, folder_id=None, name=None, deleted=False):
        """
        Get all the folders or filter specific one(s) via the provided ``name``
        or ``folder_id`` in data library with id ``library_id``. Provide only one
        argument: ``name`` or ``folder_id``, but not both.

        If ``name`` is set and multiple names match the given name, all the
        folders matching the argument will be returned.

        If ``deleted`` is set to ``True``, return folders that have been deleted.

        Return a list of JSON formatted dicts each containing basic information
        about a folder.
        """
        if folder_id is not None and name is not None:
            raise ValueError('Provide only one argument between name or folder_id, but not both')
        library_contents = Client._get(self, id=library_id, contents=True)
        if folder_id is not None:
            folder = next((_ for _ in library_contents if _['type'] == 'folder' and _['id'] == folder_id), None)
            folders = [folder] if folder is not None else []
        elif name is not None:
            folders = [_ for _ in library_contents if _['type'] == 'folder' and _['name'] == name]
        else:
            folders = [_ for _ in library_contents if _['type'] == 'folder']
        return folders
コード例 #22
0
ファイル: __init__.py プロジェクト: abretaud/bioblend
 def show_dataset_collection(self, history_id, dataset_collection_id):
     """
     Get details about a given history dataset collection.
     """
     url = self.gi._make_url(self, history_id, contents=True)
     url = '/'.join([url, "dataset_collections", dataset_collection_id])
     return Client._get(self, url=url)
コード例 #23
0
ファイル: __init__.py プロジェクト: boratonAJ/bioblend
 def __show_item(self, library_id, item_id):
     """
     Get details about a given library item.
     """
     url = self.gi._make_url(self, library_id, contents=True)
     url = '/'.join([url, item_id])
     return Client._get(self, url=url)
コード例 #24
0
ファイル: __init__.py プロジェクト: martenson/bioblend
    def show_repository_revision(self, metadata_id):
        '''
        Returns a dictionary that includes information about a specified repository
        revision.

        :type metadata_id: str
        :param metadata_id: Encoded repository metadata ID

        :rtype: dictionary
        :return: Returns a dictionary that includes information about a specified
                 repository revision.
                 For example::

                     {u'repository_id': u'491b7a3fddf9366f',
                      u'has_repository_dependencies': False,
                      u'includes_tools_for_display_in_tool_panel': True,
                      u'test_install_error': False,
                      u'url': u'/api/repository_revisions/504be8aaa652c154',
                      u'malicious': False,
                      u'includes_workflows': False,
                      u'id': u'504be8aaa652c154',
                      u'do_not_test': False,
                      u'downloadable': True,
                      u'includes_tools': True,
                      u'tool_test_results': {u'missing_test_components': [],,
                      u'includes_datatypes': False}

        '''
        # Not using '_make_url' or '_get' to create url since the module id used
        # to create url is not the same as needed for this method
        # since metadata_id has to be defined, easy to create the url here
        url = self.gi.url + '/repository_revisions/' + metadata_id

        return Client._get(self, url=url)
コード例 #25
0
ファイル: __init__.py プロジェクト: Intel-HSS/bioblend
    def show_data_table(self, data_table_id):
        """
        Display information on a single data_table

        :type data_table_id: str
        :param data_table_id: ID of the data table

        :rtype: dict
        :return: A description of data_table and its content
                 For example::

            {
                "columns": ["value", "dbkey", "name", "path"],
                "fields": [
                    [
                        "test id", "test", "test name",
                        "/opt/galaxy-dist/tool-data/test/seq/test id.fa"
                    ]
                ],
                "model_class": "TabularToolDataTable",
                "name": "all_fasta"
            }
        """

        return Client._get(self, id=data_table_id)
コード例 #26
0
ファイル: __init__.py プロジェクト: bgruening/bioblend
    def get_repositories(self):
        """
        Get a list of all the repositories in a Galaxy Tool Shed.

        :rtype: list
        :return: Returns a list of dictionaries containing information about
          repositories present in the Tool Shed.
          For example::

            [{u'category_ids': [u'c1df3132f6334b0e', u'f6d7b0037d901d9b'],
              u'deleted': False,
              u'deprecated': False,
              u'description': u'Order Contigs',
              u'homepage_url': u'',
              u'id': u'287bd69f724b99ce',
              u'name': u'best_tool_ever',
              u'owner': u'billybob',
              u'private': False,
              u'remote_repository_url': u'',
              u'times_downloaded': 0,
              u'type': u'unrestricted',
              u'url': u'/api/repositories/287bd69f724b99ce',
              u'user_id': u'5cefd48bc04af6d4'}]

        .. versionchanged:: 0.4.1
          Changed method name from ``get_tools`` to ``get_repositories`` to
          better align with the Tool Shed concepts.
        """
        return Client._get(self)
コード例 #27
0
ファイル: __init__.py プロジェクト: Intel-HSS/bioblend
    def get_datatypes(self, extension_only=False, upload_only=False):
        """
        Displays a collection (list) of datatypes.


        :rtype: list
        :return: A list of dicts with details on individual datatypes.
                 For example::

                 [ u'snpmatrix',
                 u'snptest',
                 u'tabular',
                 u'taxonomy',
                 u'twobit',
                 u'txt',
                 u'vcf',
                 u'wig',
                 u'xgmml',
                 u'xml']

        """

        params = {}
        if extension_only:
            params['extension_only'] = True

        if upload_only:
            params['upload_only'] = True

        return Client._get(self, params=params)
コード例 #28
0
ファイル: activity.py プロジェクト: galaxyproject/planemo
def has_jobs_in_states(gi, history_id, states):
    params = {"history_id": history_id}
    jobs_url = gi._make_url(gi.jobs)
    jobs = Client._get(gi.jobs, params=params, url=jobs_url)

    target_jobs = [j for j in jobs if j["state"] in states]

    return len(target_jobs) > 0
コード例 #29
0
 def get_workflow_inputs(self, workflow_id, label):
     """
     Get a list of workflow input IDs that match the given label. 
     If no input matches the given label, an empty list is returned. 
     """
     wf = Client._get(self, id=workflow_id)
     inputs = wf['inputs']
     return [id for id in inputs if inputs[id]['label'] == label]
コード例 #30
0
ファイル: __init__.py プロジェクト: bgruening/bioblend
    def get_ftp_files(self, deleted=False):
        """
        Get a list of local files.

        :rtype: list
        :return: A list of dicts with details on individual files on FTP
        """
        return Client._get(self)
コード例 #31
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def show_repository(self, toolShed_id):
        """
        Get details of a given Tool Shed repository as it is installed on this
        Galaxy instance.

        :type toolShed_id: str
        :param toolShed_id: Encoded toolShed ID

        :rtype: dict
        :return: Information about the tool
          For example::

            {u'changeset_revision': u'b17455fb6222',
             u'ctx_rev': u'8',
             u'owner': u'aaron',
             u'status': u'Installed',
             u'url': u'/api/tool_shed_repositories/82de4a4c7135b20a'}

        .. versionchanged:: 0.4.1
            Changed method name from ``show_tool`` to ``show_repository`` to
            better align with the Tool Shed concepts
        """
        return Client._get(self, id=toolShed_id)
コード例 #32
0
    def get_histories(self, history_id=None, name=None, deleted=False):
        """
        Get all histories or filter the specific one(s) via the provided ``name``
        or ``history_id``. Provide only one argument, ``name`` or ``history_id``,
        but not both.

        If ``deleted`` is set to ``True``, return histories that have been deleted.

        Return a list of history element dicts. If more than one history
        matches the given ``name``, return the list of all the histories with the
        given name.
        """
        histories = Client._get(self, deleted=deleted)
        if name is not None or history_id is not None:
            filtered_hists = []
            for history in histories:
                if name == history['name'] or history_id == history['id']:
                    filtered_hists.append(history)
                    # History ID's are unique so break now that the hist was found
                    if history_id is not None:
                        break
            histories = filtered_hists
        return histories
コード例 #33
0
    def get_visualizations(self):
        """
        Get a list of visualizations

        :rtype: list
        :return: A list of dicts with details on individual visualizations.
                 For example::

                   [{   u'dbkey': u'eschColi_K12',
                   u'id': u'df1c7c96fc427c2d',
                   u'title': u'AVTest1',
                   u'type': u'trackster',
                   u'url': u'/api/visualizations/df1c7c96fc427c2d'},
                   {   u'dbkey': u'mm9',
                   u'id': u'a669f50f8bf55b02',
                   u'title': u'Bam to Bigwig',
                   u'type': u'trackster',
                   u'url': u'/api/visualizations/a669f50f8bf55b02'}]


        """
        results = Client._get(self)
        return results
コード例 #34
0
    def get_sniffers(self):
        """
        Get the list of all installed sniffers.

        :rtype: list
        :return: A list of sniffer names.
          For example::

            [u'galaxy.datatypes.tabular:Vcf',
             u'galaxy.datatypes.binary:TwoBit',
             u'galaxy.datatypes.binary:Bam',
             u'galaxy.datatypes.binary:Sff',
             u'galaxy.datatypes.xml:Phyloxml',
             u'galaxy.datatypes.xml:GenericXml',
             u'galaxy.datatypes.sequence:Maf',
             u'galaxy.datatypes.sequence:Lav',
             u'galaxy.datatypes.sequence:csFasta']
        """

        url = self.gi._make_url(self)
        url = '/'.join([url, "sniffers"])

        return Client._get(self, url=url)
コード例 #35
0
    def show_repository(self, toolShed_id):
        """
        Display information of a repository from Tool Shed

        :type toolShed_id: str
        :param toolShed_id: Encoded toolShed ID

        :rtype: dictionary
        :return: Information about the tool
                 For example::

                     {{u'times_downloaded': 0, u'user_id': u'5cefd48bc04af6d4',
                     u'description': u'Order Contigs', u'deleted': False,
                     u'deprecated': False, u'private': False,
                     u'url': u'/api/repositories/287bd69f724b99ce',
                     u'owner': u'billybob', u'id': u'287bd69f724b99ce',
                     u'name': u'best_tool_ever'}

        .. versionchanged:: 0.4.1
            Changed method name from ``show_tool`` to ``show_repository`` to
            better align with the Tool Shed concepts
        """
        return Client._get(self, id=toolShed_id)
コード例 #36
0
ファイル: __init__.py プロジェクト: bzeitner/bioblend
    def get_repository_revision_install_info(self, name, owner,
                                             changeset_revision):
        """
        Return a list of dictionaries of metadata about a certain changeset
        revision for a single tool.

        :type name: string
        :param name: the name of the repository

        :type owner: string
        :param owner: the owner of the repository

        :type changeset_revision: string
        :param changeset_revision: the changset_revision of the RepositoryMetadata
                                   object associated with the repository

        :rtype: List of dictionaries
        :return: Returns a list of the following dictionaries:
        a dictionary defining the repository
        a dictionary defining the repository revision (RepositoryMetadata)
        a dictionary including the additional information required to install the repository

                 For example::

                     [{u'times_downloaded': 269, u'user_id': u'1de29d50c3c44272', u'description': u'Galaxy Freebayes Bayesian genetic variant detector tool', u'deleted': False, u'deprecated': False, u'private': False, u'long_description': u'Galaxy Freebayes Bayesian genetic variant detector tool originally included in the Galaxy code distribution but migrated to the tool shed.', u'url': u'/api/repositories/491b7a3fddf9366f', u'owner': u'devteam', u'id': u'491b7a3fddf9366f', u'name': u'freebayes'},
                     {u'repository_id': u'491b7a3fddf9366f', u'has_repository_dependencies': False, u'includes_tools_for_display_in_tool_panel': True, u'url': u'/api/repository_revisions/504be8aaa652c154', u'malicious': False, u'includes_workflows': False, u'downloadable': True, u'includes_tools': True, u'changeset_revision': u'd291dc763c4c', u'id': u'504be8aaa652c154', u'includes_tool_dependencies': True, u'includes_datatypes': False}, {u'freebayes': [u'Galaxy Freebayes Bayesian genetic variant detector tool', u'http://[email protected]/repos/devteam/freebayes', u'd291dc763c4c', u'9', u'devteam', {},
                     {u'freebayes/0.9.6_9608597d12e127c847ae03aa03440ab63992fedf': {u'repository_name': u'freebayes', u'name': u'freebayes', u'readme': u'\nFreeBayes requires g++ and the standard C and C++ development libraries.\nAdditionally, cmake is required for building the BamTools API.\n        ', u'version': u'0.9.6_9608597d12e127c847ae03aa03440ab63992fedf', u'repository_owner': u'devteam', u'changeset_revision': u'd291dc763c4c', u'type': u'package'}, u'samtools/0.1.18': {u'repository_name': u'freebayes', u'name': u'samtools', u'readme': u'\nCompiling SAMtools requires the ncurses and zlib development libraries.\n        ', u'version': u'0.1.18', u'repository_owner': u'devteam', u'changeset_revision': u'd291dc763c4c', u'type': u'package'}}]}]

        """

        url = self.url + '/get_repository_revision_install_info'
        params = {}
        params['name'] = name
        params['owner'] = owner
        params['changeset_revision'] = changeset_revision

        return Client._get(self, url=url, params=params)
コード例 #37
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def show_repository_revision(self, metadata_id):
        '''
        Returns a dictionary that includes information about a specified
        repository revision.

        :type metadata_id: str
        :param metadata_id: Encoded repository metadata ID

        :rtype: dict
        :return: Returns a dictionary that includes information about a
          specified repository revision.
          For example::

            {u'changeset_revision': u'7602de1e7f32',
             u'do_not_test': False,
             u'downloadable': True,
             u'has_repository_dependencies': False,
             u'id': u'504be8aaa652c154',
             u'includes_datatypes': False,
             u'includes_tool_dependencies': False,
             u'includes_tools': True,
             u'includes_tools_for_display_in_tool_panel': True,
             u'includes_workflows': False,
             u'malicious': False,
             u'missing_test_components': True,
             u'repository_id': u'491b7a3fddf9366f',
             u'test_install_error': False,
             u'time_last_tested': None,
             u'tool_test_results': {u'missing_test_components': []},
             u'tools_functionally_correct': False,
             u'url': u'/api/repository_revisions/504be8aaa652c154'}
        '''
        # Not using '_make_url' or '_get' to create url since the module id used
        # to create url is not the same as needed for this method
        # since metadata_id has to be defined, easy to create the url here
        url = '/'.join([self.gi.url, 'repository_revisions', metadata_id])
        return Client._get(self, url=url)
コード例 #38
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def get_jobs(self):
        """
        Get the list of jobs of the current user.

        :rtype: list
        :returns: list of dictionaries containing summary job information.
          For example::

            [{u'create_time': u'2014-03-01T16:16:48.640550',
              u'exit_code': 0,
              u'id': u'ebfb8f50c6abde6d',
              u'model_class': u'Job',
              u'state': u'ok',
              u'tool_id': u'fasta2tab',
              u'update_time': u'2014-03-01T16:16:50.657399'},
             {u'create_time': u'2014-03-01T16:05:34.851246',
              u'exit_code': 0,
              u'id': u'1cd8e2f6b131e891',
              u'model_class': u'Job',
              u'state': u'ok',
              u'tool_id': u'upload1',
              u'update_time': u'2014-03-01T16:05:39.558458'}]
        """
        return Client._get(self)
コード例 #39
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def show_job(self, job_id, full_details=False):
        """
        Get details of a given job of the current user.

        :type job_id: str
        :param job_id: job ID

        :type full_details: bool
        :param full_details: when ``True``, the complete list of details for the
          given job.

        :rtype: dict
        :return: A description of the given job.
          For example::

            {u'create_time': u'2014-03-01T16:17:29.828624',
             u'exit_code': 0,
             u'id': u'a799d38679e985db',
             u'inputs': {u'input': {u'id': u'ebfb8f50c6abde6d',
               u'src': u'hda'}},
             u'model_class': u'Job',
             u'outputs': {u'output': {u'id': u'a799d38679e985db',
               u'src': u'hda'}},
             u'params': {u'chromInfo': u'"/opt/galaxy-central/tool-data/shared/ucsc/chrom/?.len"',
               u'dbkey': u'"?"',
               u'seq_col': u'"2"',
               u'title_col': u'["1"]'},
             u'state': u'ok',
             u'tool_id': u'tab2fasta',
             u'update_time': u'2014-03-01T16:17:31.930728'}
        """
        params = {}
        if full_details:
            params['full'] = full_details

        return Client._get(self, id=job_id, params=params)
コード例 #40
0
    def get_quotas(self,deleted=False):
        """
        Get a list of quotas

        :type deleted: Boolean
        :param deleted: Only return quota(s) that have been deleted

        
        :rtype: list
        :return: A list of dicts with details on individual quotas.
                 For example::

                   [{   u'id': u'0604c8a56abe9a50',
                   u'model_class': u'Quota',
                   u'name': u'test ',
                   u'url': u'/api/quotas/0604c8a56abe9a50'},
                   {   u'id': u'1ee267091d0190af',
                   u'model_class': u'Quota',
                   u'name': u'workshop',
                   u'url': u'/api/quotas/1ee267091d0190af'}]
                                                    
        
        """
        return Client._get(self,deleted=deleted)
コード例 #41
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def get_config(self):
        """
        Get a list of attributes about the Galaxy instance. More attributes will
        be present if the user is an admin.

        :rtype: list
        :return: A list of attributes.
          For example::

            {u'allow_library_path_paste': False,
             u'allow_user_creation': True,
             u'allow_user_dataset_purge': True,
             u'allow_user_deletion': False,
             u'enable_unique_workflow_defaults': False,
             u'ftp_upload_dir': u'/SOMEWHERE/galaxy/ftp_dir',
             u'ftp_upload_site': u'galaxy.com',
             u'library_import_dir': u'None',
             u'logo_url': None,
             u'support_url': u'http://wiki.g2.bx.psu.edu/Support',
             u'terms_url': None,
             u'user_library_import_dir': None,
             u'wiki_url': u'http://g2.trac.bx.psu.edu/'}
        """
        return Client._get(self)
コード例 #42
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def get_repositories(self):
        """
        Get the list of all installed Tool Shed repositories on this Galaxy instance.

        :rtype: list
        :return: a list of dictionaries containing information about
          repositories present in the Tool Shed.
          For example::

            [{u'changeset_revision': u'4afe13ac23b6',
              u'deleted': False,
              u'dist_to_shed': False,
              u'error_message': u'',
              u'name': u'velvet_toolsuite',
              u'owner': u'edward-kirton',
              u'status': u'Installed'}]

        .. versionchanged:: 0.4.1
            Changed method name from ``get_tools`` to ``get_repositories`` to
            better align with the Tool Shed concepts

        .. seealso:: bioblend.galaxy.tools.get_tool_panel()
        """
        return Client._get(self)
コード例 #43
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def show_visualization(self, visual_id):
        """
        Get details of a given visualization.

        :type visual_id: str
        :param visual_id: Encoded visualization ID

        :rtype: dict
        :return: A description of the given visualization.
          For example::

            {u'annotation': None,
             u'dbkey': u'mm9',
             u'id': u'18df9134ea75e49c',
             u'latest_revision': {  ... },
             u'model_class': u'Visualization',
             u'revisions': [u'aa90649bb3ec7dcb', u'20622bc6249c0c71'],
             u'slug': u'visualization-for-grant-1',
             u'title': u'Visualization For Grant',
             u'type': u'trackster',
             u'url': u'/u/azaron/v/visualization-for-grant-1',
             u'user_id': u'21e4aed91386ca8b'}
        """
        return Client._get(self, id=visual_id)
コード例 #44
0
    def show_form(self, form_id):
        """
        Display information on a single form

        :type form_id: string
        :param form_id: Encoded form ID

        :rtype: dict
        :return: A description of single form
                 For example::

                   {   u'desc': u'here it is ',
                   u'fields': [],
                   u'form_definition_current_id': u'f2db41e1fa331b3e',
                   u'id': u'f2db41e1fa331b3e',
                   u'layout': [],
                   u'model_class': u'FormDefinition',
                   u'name': u'First form',
                   u'url': u'/api/forms/f2db41e1fa331b3e'}
                            
                   
        """

        return Client._get(self, id=form_id)
コード例 #45
0
 def get_genomes(self):
     """
     Returns a list of installed genomes
     """
     genomes = Client._get(self)
     return genomes
コード例 #46
0
 def show_user(self, user_id, deleted=False):
     """
     Display information about a user. If ``deleted`` is set to ``True``,
     display information about a deleted user.
     """
     return Client._get(self, id=user_id, deleted=deleted)
コード例 #47
0
ファイル: __init__.py プロジェクト: nuwang/bioblend
    def get_repository_revision_install_info(self, name, owner,
                                             changeset_revision):
        """
        Return a list of dictionaries of metadata about a certain changeset
        revision for a single tool.

        :type name: str
        :param name: the name of the repository

        :type owner: str
        :param owner: the owner of the repository

        :type changeset_revision: str
        :param changeset_revision: the changeset_revision of the
          RepositoryMetadata object associated with the repository

        :rtype: List of dictionaries
        :return: Returns a list of the following dictionaries:

          #. a dictionary defining the repository
          #. a dictionary defining the repository revision (RepositoryMetadata)
          #. a dictionary including the additional information required to
             install the repository

          For example::

                     [{u'deleted': False,
                       u'deprecated': False,
                       u'description': u'Galaxy Freebayes Bayesian genetic variant detector tool',
                       u'homepage_url': u'',
                       u'id': u'491b7a3fddf9366f',
                       u'long_description': u'Galaxy Freebayes Bayesian genetic variant detector tool originally included in the Galaxy code distribution but migrated to the tool shed.',
                       u'name': u'freebayes',
                       u'owner': u'devteam',
                       u'private': False,
                       u'remote_repository_url': u'',
                       u'times_downloaded': 269,
                       u'type': u'unrestricted',
                       u'url': u'/api/repositories/491b7a3fddf9366f',
                       u'user_id': u'1de29d50c3c44272'},
                      {u'changeset_revision': u'd291dc763c4c',
                       u'do_not_test': False,
                       u'downloadable': True,
                       u'has_repository_dependencies': False,
                       u'id': u'504be8aaa652c154',
                       u'includes_datatypes': False,
                       u'includes_tool_dependencies': True,
                       u'includes_tools': True,
                       u'includes_tools_for_display_in_tool_panel': True,
                       u'includes_workflows': False,
                       u'malicious': False,
                       u'repository_id': u'491b7a3fddf9366f',
                       u'url': u'/api/repository_revisions/504be8aaa652c154'},
                      {u'freebayes': [u'Galaxy Freebayes Bayesian genetic variant detector tool',
                        u'http://testtoolshed.g2.bx.psu.edu/repos/devteam/freebayes',
                        u'd291dc763c4c',
                        u'9',
                        u'devteam',
                        {},
                        {u'freebayes/0.9.6_9608597d12e127c847ae03aa03440ab63992fedf': {u'changeset_revision': u'd291dc763c4c',
                          u'name': u'freebayes',
                          u'repository_name': u'freebayes',
                          u'repository_owner': u'devteam',
                          u'type': u'package',
                          u'version': u'0.9.6_9608597d12e127c847ae03aa03440ab63992fedf'},
                         u'samtools/0.1.18': {u'changeset_revision': u'd291dc763c4c',
                          u'name': u'samtools',
                          u'repository_name': u'freebayes',
                          u'repository_owner': u'devteam',
                          u'type': u'package',
                          u'version': u'0.1.18'}}]}]
        """
        url = '/'.join([self.url, 'get_repository_revision_install_info'])
        params = {
            'name': name,
            'owner': owner,
            'changeset_revision': changeset_revision
        }
        return Client._get(self, url=url, params=params)
コード例 #48
0
 def __show_item(self, library_id, item_id):
     url = self.gi._make_url(self, library_id, contents=True)
     url = '/'.join([url, item_id])
     return Client._get(self, url=url)
コード例 #49
0
 def _get_extra_files(self, dataset_details):
     extra_files_url = "%s/%s/contents/%s/extra_files" % (
         self._user_gi._make_url(self._user_gi.histories), self._history_id, dataset_details["id"]
     )
     extra_files = Client._get(self._user_gi.jobs, url=extra_files_url)
     return extra_files
コード例 #50
0
 def _raw_get_tool(self, in_panel=None, trackster=None):
     params = {}
     params['in_panel'] = in_panel
     params['trackster'] = trackster
     return Client._get(self, params=params)
コード例 #51
0
ファイル: __init__.py プロジェクト: jdiggans/bioblend
 def show_dataset(self, dataset_id, deleted=False):
     """
     Display information about and/or content of a dataset. This can be a
     history or a library dataset.
     """
     return Client._get(self, id=dataset_id, deleted=deleted)
コード例 #52
0
ファイル: __init__.py プロジェクト: fmareuil/bioblend
    def repository_revisions(self,
                             downloadable=None,
                             malicious=None,
                             tools_functionally_correct=None,
                             missing_test_components=None,
                             do_not_test=None,
                             includes_tools=None,
                             test_install_error=None,
                             skip_tool_test=None):
        """
        Returns a (possibly filtered) list of dictionaries that include information
        about all repository revisions.  The following parameters can be used to
        filter the list.

        :type downloadable: Boolean
        :param downloadable: Can the tool be downloaded

        :type malicious: Boolean
        :param malicious:

        :type tools_functionally_correct: Boolean
        :param tools_functionally_correct:

        :type missing_test_components: Boolean
        :param missing_test_components:

        :type do_not_test: Boolean
        :param do_not_test:

        :type includes_tools: Boolean
        :param includes_tools:

        :type test_install_error: Boolean
        :param test_install_error:

        :type skip_tool_test: Boolean
        :param skip_tool_test:

        :rtype: List of dictionaries
        :return: Returns a (possibly filtered) list of dictionaries that include
                 information about all repository revisions.
                 For example::

                     [{u'repository_id': u'78f2604ff5e65707', u'has_repository_dependencies': False, u'includes_tools_for_display_in_tool_panel': True, u'url': u'/api/repository_revisions/92250afff777a169', u'malicious': False, u'includes_workflows': False, u'downloadable': True, u'includes_tools': True, u'changeset_revision': u'6e26c5a48e9a', u'id': u'92250afff777a169', u'includes_tool_dependencies': False, u'includes_datatypes': False},
                     {u'repository_id': u'f9662009da7bfce0', u'has_repository_dependencies': False, u'includes_tools_for_display_in_tool_panel': True, u'url': u'/api/repository_revisions/d3823c748ae2205d', u'malicious': False, u'includes_workflows': False, u'downloadable': True, u'includes_tools': True, u'changeset_revision': u'15a54fa11ad7', u'id': u'd3823c748ae2205d', u'includes_tool_dependencies': False, u'includes_datatypes': False}]

        """

        # Not using '_make_url' or '_get' to create url since the module id used
        # to create url is not the same as needed for this method
        url = self.gi.url + '/repository_revisions'
        params = {}

        # nice and long... my god!
        if downloadable:
            params['downloadable'] = 'True'
        if malicious:
            params['malicious'] = 'True'
        if tools_functionally_correct:
            params['tools_functionally_correct'] = 'True'
        if missing_test_components:
            params['missing_test_components'] = 'True'
        if do_not_test:
            params['do_not_test'] = 'True'
        if includes_tools:
            params['includes_tools'] = 'True'
        if test_install_error:
            params['test_install_error'] = 'True'
        if skip_tool_test:
            params['skip_tool_test'] = 'True'

        return Client._get(self, url=url, params=params).json()
コード例 #53
0
    def search_repositories(self, q, page=1, page_size=10):
        """
        Search for repositories in a Galaxy Tool Shed

        :type  q: str
        :param q: query string for searching purposes

        :type  page: int
        :param page: page requested

        :type  page_size: int
        :param page_size: page size requested

        :rtype:  dict
        :return: dictionary containing search hits as well as metadata
                for the search
                example:
                {
                u'hits':
                [
                    {
                        u'matched_terms': [],
                        u'repository':
                            {
                                u'approved': u'no',
                                u'description': u'Convert export file to fastq',
                                u'full_last_updated': u'2015-01-18 09:48 AM',
                                u'homepage_url': None,
                                u'id': u'bdfa208f0cf6504e',
                                u'last_updated': u'less than a year',
                                u'long_description': u'This is a simple too to convert Solexas Export files to FASTQ files. The tool installation needs to add a new Export file type, the new class is included in the README file as a patch.',
                                u'name': u'export_to_fastq',
                                u'remote_repository_url': None,
                                u'repo_owner_username': u'louise',
                                u'times_downloaded': 164
                            },
                        u'score': 4.92
                    },
                   {
                        u'matched_terms': [],
                        u'repository':
                            {
                                u'approved': u'no',
                                u'description': u'Convert BAM file to fastq',
                                u'full_last_updated': u'2015-04-07 11:57 AM',
                                u'homepage_url': None,
                                u'id': u'175812cd7caaf439',
                                u'last_updated': u'less than a month',
                                u'long_description': u'Use Picards SamToFastq to convert a BAM file to fastq. Useful for storing reads as BAM in Galaxy and converting to fastq when needed for analysis.',
                                u'name': u'bam_to_fastq',
                                u'remote_repository_url': None,
                                u'repo_owner_username': u'brad-chapman',
                                u'times_downloaded': 138
                            },
                        u'score': 4.14
                    }
                ],
                u'hostname': u'https://testtoolshed.g2.bx.psu.edu/',
                u'page': u'1',
                u'page_size': u'2',
                u'total_results': u'64'
                }
        """
        params = dict(q=q, page=page, page_size=page_size)
        return Client._get(self, params=params)