import pandas as pd | |||||
import sys, argparse, os | |||||
# input arguments | |||||
parser = argparse.ArgumentParser(description="This script is to get column sum of all variants in SV breakpoints flanking region") | |||||
parser.add_argument('-file', '--file', type=str, help='The bed annotated file', required=True) | |||||
parser.add_argument('-prefix', '--prefix', type=str, help='The prefix of output file', required=True) | |||||
args = parser.parse_args() | |||||
file = args.file | |||||
prefix = args.prefix | |||||
dat = pd.read_table(file,header=None) | |||||
dat_sub = dat.iloc[:,5:] | |||||
dat_sum = pd.DataFrame(dat_sub.sum()) | |||||
dat_sum.columns = [prefix] | |||||
file_name = prefix + '.sum.txt' | |||||
dat_sum.to_csv(file_name,index=0) |
{ | { | ||||
"{{ project_name }}.colSum.docker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/high_confidence_call_manuscript:v1.4", | |||||
"{{ project_name }}.disk_size": "200", | "{{ project_name }}.disk_size": "200", | ||||
"{{ project_name }}.bedAnnotation.docker": "registry-internal.cn-shanghai.aliyuncs.com/pgx-docker-registry/bedtools:v2.27.1", | "{{ project_name }}.bedAnnotation.docker": "registry-internal.cn-shanghai.aliyuncs.com/pgx-docker-registry/bedtools:v2.27.1", | ||||
"{{ project_name }}.inputSamplesFile": "{{ inputSamplesFile }}", | "{{ project_name }}.inputSamplesFile": "{{ inputSamplesFile }}", |
task colSum { | |||||
File filtered_bnd | |||||
File filtered_ins | |||||
File filtered_inv | |||||
File filtered_del | |||||
File filtered_dup | |||||
File voted_bnd | |||||
File voted_ins | |||||
File voted_inv | |||||
File voted_del | |||||
File voted_dup | |||||
String sample_name | |||||
String docker | |||||
String cluster_config | |||||
String disk_size | |||||
command <<< | |||||
python /opt/colsum.py -file ${filtered_bnd} -prefix ${sample_name}.BND.filtered | |||||
python /opt/colsum.py -file ${filtered_ins} -prefix ${sample_name}.INS.filtered | |||||
python /opt/colsum.py -file ${filtered_inv} -prefix ${sample_name}.INV.filtered | |||||
python /opt/colsum.py -file ${filtered_del} -prefix ${sample_name}.DEL.filtered | |||||
python /opt/colsum.py -file ${filtered_dup} -prefix ${sample_name}.DUP.filtered | |||||
python /opt/colsum.py -file ${voted_bnd} -prefix ${sample_name}.BND.voted | |||||
python /opt/colsum.py -file ${voted_ins} -prefix ${sample_name}.INS.voted | |||||
python /opt/colsum.py -file ${voted_inv} -prefix ${sample_name}.INV.voted | |||||
python /opt/colsum.py -file ${voted_del} -prefix ${sample_name}.DEL.voted | |||||
python /opt/colsum.py -file ${voted_dup} -prefix ${sample_name}.DUP.voted | |||||
>>> | |||||
runtime { | |||||
docker:docker | |||||
cluster: cluster_config | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
File filtered_bnd_sum = "${sample_name}.BND.filtered.sum.txt" | |||||
File filtered_ins_sum = "${sample_name}.INS.filtered.sum.txt" | |||||
File filtered_inv_sum = "${sample_name}.INV.filtered.sum.txt" | |||||
File filtered_del_sum = "${sample_name}.DEL.filtered.sum.txt" | |||||
File filtered_dup_sum = "${sample_name}.DUP.filtered.sum.txt" | |||||
File voted_bnd_sum = "${sample_name}.BND.voted.sum.txt" | |||||
File voted_ins_sum = "${sample_name}.INS.voted.sum.txt" | |||||
File voted_inv_sum = "${sample_name}.INV.voted.sum.txt" | |||||
File voted_del_sum = "${sample_name}.DEL.voted.sum.txt" | |||||
File voted_dup_sum = "${sample_name}.DUP.voted.sum.txt" | |||||
} | |||||
} |
import "./tasks/vcf2bed.wdl" as vcf2bed | import "./tasks/vcf2bed.wdl" as vcf2bed | ||||
import "./tasks/mergeBed.wdl" as mergeBed | import "./tasks/mergeBed.wdl" as mergeBed | ||||
import "./tasks/bedAnnotation.wdl" as bedAnnotation | import "./tasks/bedAnnotation.wdl" as bedAnnotation | ||||
import "./tasks/colSum.wdl" as colSum | |||||
workflow {{ project_name }} { | workflow {{ project_name }} { | ||||
File inputSamplesFile | File inputSamplesFile | ||||
cluster_config=cluster_config, | cluster_config=cluster_config, | ||||
disk_size=disk_size | disk_size=disk_size | ||||
} | } | ||||
call colSum.colSum as colSum { | |||||
input: | |||||
filtered_bnd=bedAnnotation.filtered_bnd, | |||||
filtered_ins=bedAnnotation.filtered_ins, | |||||
filtered_inv=bedAnnotation.filtered_inv, | |||||
filtered_del=bedAnnotation.filtered_del, | |||||
filtered_dup=bedAnnotation.filtered_dup, | |||||
voted_bnd=bedAnnotation.voted_bnd, | |||||
voted_ins=bedAnnotation.voted_ins, | |||||
voted_inv=bedAnnotation.voted_inv, | |||||
voted_del=bedAnnotation.voted_del, | |||||
voted_dup=bedAnnotation.voted_dup, | |||||
sample_name=sample_name, | |||||
cluster_config=cluster_config, | |||||
disk_size=disk_size | |||||
} | |||||
} | } |