diff --git a/codes/run_wdl.py b/codes/run_wdl.py index 9ef956f..95e9e39 100755 --- a/codes/run_wdl.py +++ b/codes/run_wdl.py @@ -9,6 +9,7 @@ import time from datetime import datetime import pandas as pd +import requests def get_branch_nodes(graph, start_node): @@ -62,6 +63,17 @@ def get_catecode(project, start_node='addQc'): return cate_dict +def send_ding(msg): + ''' + 发送钉钉消息功能 + ''' + url = 'https://oapi.dingtalk.com/robot/send?access_token=d4a0749cc7ff87bd12079a79dd74ca3423becb1ce161c3088acc6628a7a188dd' + data = {"msgtype": "text", "text": {"content": "pipeline:" + str(msg)}, "at": {"isAtAll": True}} + headers = {'Content-Type': 'application/json;charset=UTF-8'} + send_data = json.dumps(data).encode('utf-8') + ret = requests.post(url=url, data=send_data, headers=headers) + + def run(barcode, normal, umi, input_dir, output_dir, project, cancer, probe, wdl, start_node): input_dir = os.path.realpath(input_dir) output_dir = os.path.realpath(output_dir) @@ -108,6 +120,8 @@ def run(barcode, normal, umi, input_dir, output_dir, project, cancer, probe, wdl output, error = ret.communicate() print(output, error) + send_ding(msg=f'样本{barcode}已开始分析,分析地址\n{output_dir}') + stdout = open(os.path.join(output_dir, f'{args.barcode}_{logname}_stdout.log'), 'w') stderr = open(os.path.join(output_dir, f'{args.barcode}_{logname}_stderr.log'), 'w') @@ -159,6 +173,7 @@ def run(barcode, normal, umi, input_dir, output_dir, project, cancer, probe, wdl stderr.write(file_path + '\n') stderr.write(f.read()) stderr.write('\n\n') + send_ding(msg=f'样本{barcode}已分析完成,分析地址\n{output_dir}, 请查看!') stdout.close() stderr.close() diff --git a/wdl/msi.wdl b/wdl/msi.wdl index ec329ce..b804b83 100755 --- a/wdl/msi.wdl +++ b/wdl/msi.wdl @@ -36,7 +36,7 @@ task run_msi { msisensor2 msi \ -M /dataseq/jmdna/software/msisensor2/models_hg19_GRCh37 \ -t ${tumor_rmdup_bam} -e $PUBLIC/msi/624_650_160_intersect_74.bed \ - -b 10 ${output_dir}/msi/${name}.msi.txt + -b 10 -o ${output_dir}/msi/${name}.msi.txt else echo "未知的选项: ${probe}"