本文整理匯總了Python中scilifelab.db.statusdb.ProjectSummaryConnection.map_name_to_srm方法的典型用法代碼示例。如果您正苦於以下問題:Python ProjectSummaryConnection.map_name_to_srm方法的具體用法?Python ProjectSummaryConnection.map_name_to_srm怎麽用?Python ProjectSummaryConnection.map_name_to_srm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scilifelab.db.statusdb.ProjectSummaryConnection
的用法示例。
在下文中一共展示了ProjectSummaryConnection.map_name_to_srm方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_2_make_project_note
# 需要導入模塊: from scilifelab.db.statusdb import ProjectSummaryConnection [as 別名]
# 或者: from scilifelab.db.statusdb.ProjectSummaryConnection import map_name_to_srm [as 別名]
def test_2_make_project_note(self):
"""Make a project note subset by flowcell and project"""
s_con = SampleRunMetricsConnection(username=self.user, password=self.pw, url=self.url)
fc_con = FlowcellRunMetricsConnection(username=self.user, password=self.pw, url=self.url)
p_con = ProjectSummaryConnection(username=self.user, password=self.pw, url=self.url)
paragraphs = project_note_paragraphs()
headers = project_note_headers()
param = parameters
project = p_con.get_entry(self.examples["project"])
if not project:
print "No project named {}".format(self.examples["project"])
return
if project:
ordered_amount = p_con.get_ordered_amount(self.examples["project"])
else:
return
ordered_amount = self.pargs.ordered_million_reads
## Start collecting the data
sample_table = []
sample_list = project['samples']
param.update({key:project.get(ps_to_parameter[key], None) for key in ps_to_parameter.keys()})
samples = p_con.map_name_to_srm(self.examples["project"], check_consistency=True, use_bc_map=True)
all_passed = True
for k,v in samples.items():
if k=="Unexpected":
continue
project_sample = sample_list[k]
vals = {x:project_sample.get(prjs_to_table[x], None) for x in prjs_to_table.keys()}
vals['MOrdered'] = ordered_amount
vals['BarcodeSeq'] = s_con.get_entry(v.keys()[0], "sequence")
## Set status
vals['Status'] = set_status(vals) if vals['Status'] is None else vals['Status']
vals.update({k:"N/A" for k in vals.keys() if vals[k] is None})
if vals['Status']=="N/A" or vals['Status']=="NP": all_passed = False
sample_table.append([vals[k] for k in table_keys])
if all_passed: param["finished"] = 'Project finished.'
sample_table.sort()
sample_table = list(sample_table for sample_table,_ in itertools.groupby(sample_table))
sample_table.insert(0, ['ScilifeID', 'CustomerID', 'BarcodeSeq', 'MSequenced', 'MOrdered', 'Status'])
paragraphs["Samples"]["tpl"] = make_sample_table(sample_table)
make_note("{}.pdf".format(self.examples["project"]), headers, paragraphs, **param)
示例2: test_3_sample_map
# 需要導入模塊: from scilifelab.db.statusdb import ProjectSummaryConnection [as 別名]
# 或者: from scilifelab.db.statusdb.ProjectSummaryConnection import map_name_to_srm [as 別名]
def test_3_sample_map(self):
"""Test getting a sample mapping"""
p_con = ProjectSummaryConnection(username=self.user, password=self.pw, url=self.url)
sample_map = p_con.map_name_to_srm(self.examples["project"], use_ps_map=False, check_consistency=True)
print sample_map