本文整理汇总了Python中ngi_pipeline.database.classes.CharonSession.libprep_get方法的典型用法代码示例。如果您正苦于以下问题:Python CharonSession.libprep_get方法的具体用法?Python CharonSession.libprep_get怎么用?Python CharonSession.libprep_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ngi_pipeline.database.classes.CharonSession
的用法示例。
在下文中一共展示了CharonSession.libprep_get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: analyze
# 需要导入模块: from ngi_pipeline.database.classes import CharonSession [as 别名]
# 或者: from ngi_pipeline.database.classes.CharonSession import libprep_get [as 别名]
def analyze(analysis_object, config=None, config_file_path=None):
charon_session = CharonSession()
charon_pj=charon_session.project_get(analysis_object.project.project_id)
reference_genome=charon_pj.get('reference')
if charon_pj.get("sequencing_facility") == "NGI-S":
analysis_object.sequencing_facility="sthlm"
elif charon_pj.get("sequencing_facility") == "NGI-U":
analysis_object.sequencing_facility="upps"
else:
LOG.error("charon project not registered with stockholm or uppsala. Which config file should we use for the RNA pipeline ?")
raise RuntimeError
fastq_files=[]
if reference_genome and reference_genome != 'other':
for sample in analysis_object.project:
try:
charon_reported_status = charon_session.sample_get(analysis_object.project.project_id,
sample).get('analysis_status')
# Check Charon to ensure this hasn't already been processed
do_analyze=handle_sample_status(analysis_object, sample, charon_reported_status)
if not do_analyze :
continue
except CharonError as e:
LOG.error(e)
for libprep in sample:
charon_lp_status=charon_session.libprep_get(analysis_object.project.project_id, sample.name, libprep.name).get('qc')
do_analyze=handle_libprep_status(analysis_object, libprep, charon_lp_status)
if not do_analyze :
continue
else:
for seqrun in libprep:
charon_sr_status=charon_session.seqrun_get(analysis_object.project.project_id, sample.name, libprep.name, seqrun.name).get('alignment_status')
do_analyze=handle_seqrun_status(analysis_object, seqrun, charon_sr_status)
if not do_analyze :
continue
else:
seqrun.being_analyzed=True
sample.being_analyzed = sample.being_analyzed or True
# filter out index files from analysis
for fastq_file in filter(lambda f: not is_index_file(f), seqrun.fastq_files):
fastq_path=os.path.join(analysis_object.project.base_path, "DATA", analysis_object.project.project_id, sample.name, libprep.name, seqrun.name, fastq_file)
fastq_files.append(fastq_path)
if not fastq_files:
LOG.error("No fastq files obtained for the analysis fo project {}, please check the Charon status.".format(analysis_object.project.name))
else :
if analysis_object.restart_running_jobs:
stop_ongoing_analysis(analysis_object)
fastq_dir=preprocess_analysis(analysis_object, fastq_files)
sbatch_path=write_batch_job(analysis_object, reference_genome, fastq_dir)
job_id=start_analysis(sbatch_path)
analysis_path=os.path.join(analysis_object.project.base_path, "ANALYSIS", analysis_object.project.project_id, 'rna_ngi')
record_project_job(analysis_object.project, job_id, analysis_path)