コード例 #1
0
ファイル: heatmap.py プロジェクト: cokelaer/biokit
 def _check_metric(self, value):
     easydev.check_param_in_list(value,
         ['braycurtis', 'canberra', 'chebyshev', 'cityblock',
          'correlation', 'cosine', 'dice', 'euclidean', 'hamming',
          'jaccard', 'kulsinski', 'mahalanobis', 'matching',
          'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean',
          'kalmichener', 'sokalsneath', 'sqeuclidean', 'yule'])
コード例 #2
0
 def check_method(self, value):
     # None is possible
     # in R, in addition to single, complete, average, centroid,
     # median and ward
     # there are  ward.D, wardD2 and mcquitty
     # default is complete
     easydev.check_param_in_list(str(value), self.methods)
コード例 #3
0
 def _check_metric(self, value):
     easydev.check_param_in_list(value, [
         'braycurtis', 'canberra', 'chebyshev', 'cityblock', 'correlation',
         'cosine', 'dice', 'euclidean', 'hamming', 'jaccard', 'kulsinski',
         'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto',
         'russellrao', 'seuclidean', 'kalmichener', 'sokalsneath',
         'sqeuclidean', 'yule'
     ])
コード例 #4
0
ファイル: linkage.py プロジェクト: biokit/biokit
 def check_method(self, value):
     # None is possible
     # in R, in addition to single, complete, average, centroid, 
     # median and ward
     # there are  ward.D, wardD2 and mcquitty
     # default is complete
     return
     from biokit.viz.commons import valid_methods
     easydev.check_param_in_list(str(value), valid_methods)
コード例 #5
0
 def check_method(self, value):
     # None is possible
     # in R, in addition to single, complete, average, centroid,
     # median and ward
     # there are  ward.D, wardD2 and mcquitty
     # default is complete
     return
     from biokit.viz.commons import valid_methods
     easydev.check_param_in_list(str(value), valid_methods)
コード例 #6
0
ファイル: devtools.py プロジェクト: ltobalina/cellnopt
    def check_param_in_list(self, param, valid_values):
        """

        transforms valid_values into list (e.g., convenient if
        an iterator)
        """
        param = self.tolist(param)
        for name in param:
            easydev.check_param_in_list(name, list(valid_values))
コード例 #7
0
ファイル: heatmap.py プロジェクト: cokelaer/biokit
    def _check_method(self, value):
        # None is possible
        # in R, in addition to single, complete, average, centroid, median and ward
        # there are  ward.D, wardD2 and mcquitty
        # default is complete

        easydev.check_param_in_list(str(value), ['linkage', 'single', 'complete', 'None',
                                           'average',' weighted', 'centroid',
                                           'median', 'ward'])
コード例 #8
0
    def _check_method(self, value):
        # None is possible
        # in R, in addition to single, complete, average, centroid, median and ward
        # there are  ward.D, wardD2 and mcquitty
        # default is complete

        easydev.check_param_in_list(str(value), [
            'linkage', 'single', 'complete', 'None', 'average', ' weighted',
            'centroid', 'median', 'ward'
        ])
コード例 #9
0
ファイル: hgnc.py プロジェクト: cokelaer/bioservices
    def search(self, database_or_query=None, query=None, frmt='json'):
        """Search a searchable field (database) for a pattern

        The search request is more powerful than fetch for querying the
        database, but search will only returns the fields hgnc_id, symbol and
        score. This is because this tool is mainly intended to query the server
        to find possible entries of interest or to check data (such as your own
        symbols) rather than to fetch information about the genes. If you want
        to retrieve all the data for a set of genes from the search result, the
        user could use the hgnc_id returned by search to then fire off a fetch
        request by hgnc_id.

        :param database: if not provided, search all databases. 


        ::

            # Search all searchable fields for the tern BRAF
            h.search('BRAF')

            # Return all records that have symbols that start with ZNF
            h.search('symbol', 'ZNF*')

            # Return all records that have symbols that start with ZNF
            # followed by one and only one character (e.g. ZNF3)
            # Nov 2015 does not work neither here nor in within in the 
            # official documentation
            h.search('symbol', 'ZNF?')

            # search for symbols starting with ZNF that have been approved 
            # by HGNC
            h.search('symbol', 'ZNF*+AND+status:Approved')
            
            # return ZNF3 and ZNF12
            h.search('symbol', 'ZNF3+OR+ZNF12')

            # Return all records that have symbols that start with ZNF which 
            # are not approved (ie entry withdrawn)
            h.search('symbol', 'ZNF*+NOT+status:Approved')

        """
        if database_or_query is None and query is None:
            raise ValueError('you must provide at least one parameter')
        elif database_or_query is not None and query is None:
            # presumably user wants to search all databases
            query = database_or_query
            url = 'search/{0}'.format(query)
        else:
            database = database_or_query
            easydev.check_param_in_list(database, self.searchable_fields)
            url = 'search/{0}/{1}'.format(database, query)

        headers = self.get_headers(content=frmt)
        res = self.http_get(url, frmt=frmt, headers=headers)
        return res
コード例 #10
0
ファイル: hgnc.py プロジェクト: zencore/bioservices
    def search(self, database_or_query=None, query=None, frmt='json'):
        """Search a searchable field (database) for a pattern

        The search request is more powerful than fetch for querying the
        database, but search will only returns the fields hgnc_id, symbol and
        score. This is because this tool is mainly intended to query the server
        to find possible entries of interest or to check data (such as your own
        symbols) rather than to fetch information about the genes. If you want
        to retrieve all the data for a set of genes from the search result, the
        user could use the hgnc_id returned by search to then fire off a fetch
        request by hgnc_id.

        :param database: if not provided, search all databases. 


        ::

            # Search all searchable fields for the tern BRAF
            h.search('BRAF')

            # Return all records that have symbols that start with ZNF
            h.search('symbol', 'ZNF*')

            # Return all records that have symbols that start with ZNF
            # followed by one and only one character (e.g. ZNF3)
            # Nov 2015 does not work neither here nor in within in the 
            # official documentation
            h.search('symbol', 'ZNF?')

            # search for symbols starting with ZNF that have been approved 
            # by HGNC
            h.search('symbol', 'ZNF*+AND+status:Approved')
            
            # return ZNF3 and ZNF12
            h.search('symbol', 'ZNF3+OR+ZNF12')

            # Return all records that have symbols that start with ZNF which 
            # are not approved (ie entry withdrawn)
            h.search('symbol', 'ZNF*+NOT+status:Approved')

        """
        if database_or_query is None and query is None:
            raise ValueError('you must provide at least one parameter')
        elif database_or_query is not None and query is None:
            # presumably user wants to search all databases
            query = database_or_query
            url = 'search/{0}'.format(query)
        else:
            database = database_or_query
            easydev.check_param_in_list(database, self.searchable_fields)
            url = 'search/{0}/{1}'.format(database, query)

        headers = self.get_headers(content=frmt)
        res = self.http_get(url, frmt=frmt, headers=headers)
        return res
コード例 #11
0
ファイル: setup.py プロジェクト: cellnopt/CellNOptR
def setup():
    argv = sys.argv
    # default mode is INSTALL
    if len(argv) == 1:
        mode = 'INSTALL'
    elif len(argv) == 2:
        easydev.check_param_in_list(argv[1], ['install', 'build'])
        mode = argv[1]

    for package in ['CellNOptR', 'CNORdt', 'CNORfuzzy', 'CNORfeeder', 'CNORode']:
        if mode == 'install':
            cmd = 'INSTALL'
        elif mode == 'build':
            cmd = 'build'
        cmd = 'R CMD %s packages' % cmd + os.sep + package
        print cmd
        os.system(cmd)
コード例 #12
0
ファイル: hgnc.py プロジェクト: zencore/bioservices
    def fetch(self, database, query, frmt='json'):
        """Retrieve particular records from a searchable fields

        Returned object is a json object with fields as in
        :attr:`stored_field`, which is returned from :meth:`get_info` method.

        Only one query at a time. No wild cards are accepted.
        ::

            >>> h = HGNC()
            >>> h.fetch('symbol', 'ZNF3')
            >>> h.fetch('alias_name', 'A-kinase anchor protein, 350kDa')
        """
        easydev.check_param_in_list(database, self.searchable_fields)
        url = 'fetch/{0}/{1}'.format(database, query)
        headers = self.get_headers(content=frmt)
        res = self.http_get(url, frmt=frmt, headers=headers)
        return res
コード例 #13
0
ファイル: hgnc.py プロジェクト: cokelaer/bioservices
    def fetch(self, database, query, frmt='json'):
        """Retrieve particular records from a searchable fields

        Returned object is a json object with fields as in
        :attr:`stored_field`, which is returned from :meth:`get_info` method.

        Only one query at a time. No wild cards are accepted.
        ::

            >>> h = HGNC()
            >>> h.fetch('symbol', 'ZNF3')
            >>> h.fetch('alias_name', 'A-kinase anchor protein, 350kDa')
        """
        easydev.check_param_in_list(database, self.searchable_fields)
        url = 'fetch/{0}/{1}'.format(database, query)
        headers = self.get_headers(content=frmt)
        res = self.http_get(url, frmt=frmt, headers=headers)
        return res
コード例 #14
0
ファイル: scoring.py プロジェクト: thomasyu888/dreamtools
 def _check_subname(self, subname):
     from easydev import check_param_in_list
     check_param_in_list(subname, self.sub_challenges)
コード例 #15
0
 def check_metric(self, value):
     return
     from biokit.viz.commons import valid_metrics
     easydev.check_param_in_list(value, valid_metrics)
コード例 #16
0
ファイル: stats.py プロジェクト: shukwong/gdsctools
 def _set_method(self, method):
     easydev.check_param_in_list(method, self.valid_methods)
     if method == 'fdr':
         method = 'fdr_bh'
     self._method = method
コード例 #17
0
ファイル: challenge.py プロジェクト: nagyistoce/dreamtools
 def _check_subname(self, subname):
     from easydev import check_param_in_list
     check_param_in_list(subname, self.sub_challenges)
コード例 #18
0
 def check_param_in_list(self, param, valid_values):
     easydev.check_param_in_list(param, valid_values)
コード例 #19
0
ファイル: services.py プロジェクト: pjshort/bioservices
 def check_param_in_list(self, param, valid_values):
     easydev.check_param_in_list(param, valid_values)
コード例 #20
0
 def check_metric(self, value):
     easydev.check_param_in_list(value, self.metrics)
コード例 #21
0
ファイル: linkage.py プロジェクト: biokit/biokit
 def check_metric(self, value):
     return
     from biokit.viz.commons import valid_metrics
     easydev.check_param_in_list(value, valid_metrics)
コード例 #22
0
 def _set_mode(self, mode):
     easydev.check_param_in_list(mode, ["time", "control"])
     self._mode = mode
コード例 #23
0
 def from_bool(self, value):
     check_param_in_list(value, [True, False])
     if value is True:
         return "T"
     if value is False:
         return "F"