當前位置: 首頁>>代碼示例>>Python>>正文


Python SampleTemplate.metadata_headers方法代碼示例

本文整理匯總了Python中qiita_db.metadata_template.sample_template.SampleTemplate.metadata_headers方法的典型用法代碼示例。如果您正苦於以下問題:Python SampleTemplate.metadata_headers方法的具體用法?Python SampleTemplate.metadata_headers怎麽用?Python SampleTemplate.metadata_headers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qiita_db.metadata_template.sample_template.SampleTemplate的用法示例。


在下文中一共展示了SampleTemplate.metadata_headers方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get

# 需要導入模塊: from qiita_db.metadata_template.sample_template import SampleTemplate [as 別名]
# 或者: from qiita_db.metadata_template.sample_template.SampleTemplate import metadata_headers [as 別名]
 def get(self, message="", msg_level=None):
     all_emails_except_current = yield Task(self._get_all_emails)
     all_emails_except_current.remove(self.current_user.id)
     avail_meta = SampleTemplate.metadata_headers() +\
         get_table_cols("study")
     self.render('list_studies.html',
                 availmeta=avail_meta,
                 all_emails_except_current=all_emails_except_current,
                 message=message,
                 msg_level=msg_level)
開發者ID:anupriyatripathi,項目名稱:qiita,代碼行數:12,代碼來源:listing_handlers.py

示例2: array_agg

# 需要導入模塊: from qiita_db.metadata_template.sample_template import SampleTemplate [as 別名]
# 或者: from qiita_db.metadata_template.sample_template.SampleTemplate import metadata_headers [as 別名]
with TRN:
    # a few notes: just getting the preps with duplicated values; ignoring
    # column 'sample_id' and tables 'study_sample', 'prep_template',
    # 'prep_template_sample'
    sql = """SELECT table_name, array_agg(column_name::text)
                FROM information_schema.columns
                WHERE column_name IN %s
                    AND column_name != 'sample_id'
                    AND table_name LIKE 'prep_%%'
                    AND table_name NOT IN (
                        'prep_template', 'prep_template_sample')
                GROUP BY table_name"""
    # note that we are looking for those columns with duplicated names in
    # the headers
    headers = set(PrepTemplate.metadata_headers()) & \
        set(SampleTemplate.metadata_headers())

    if headers:
        TRN.add(sql, [tuple(headers)])
        overlapping = dict(TRN.execute_fetchindex())
    else:
        overlapping = None

if overlapping is not None:
    # finding actual duplicates
    for table_name, cols in viewitems(overlapping):
        # leaving print so when we patch in the main system we know that
        # nothing was renamed or deal with that
        print table_name
        with TRN:
            for c in cols:
開發者ID:ElDeveloper,項目名稱:qiita,代碼行數:33,代碼來源:45.py


注:本文中的qiita_db.metadata_template.sample_template.SampleTemplate.metadata_headers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。