Przeglądaj źródła

count mendelian

master
LUYAO REN 5 lat temu
rodzic
commit
b0936f8dd9
6 zmienionych plików z 52 dodań i 18 usunięć
  1. +13
    -0
      codescripts/count_mendelian.py
  2. +0
    -16
      codescripts/merge_mendelian_vot.py
  3. +2
    -1
      inputs
  4. +25
    -0
      tasks/count_mendelian.wdl
  5. +1
    -1
      tasks/merge_mendelian.wdl
  6. +11
    -0
      workflow.wdl

+ 13
- 0
codescripts/count_mendelian.py Wyświetl plik

@@ -0,0 +1,13 @@
import pandas as pd
import sys, argparse, os

men = pd.read_table(sys.argv[1],header=None,low_memory=False)
vote = pd.read_table(sys.argv[2],low_memory=False)
men[1]=men[1].astype(str)
merged_df = pd.merge(vote, men, how='inner', left_on=['CHROM','POS'], right_on = [0,1])
lcl5_dat = merged_df[(merged_df[5]!='./.') & (merged_df[5]!='0/0')]
sub = lcl5_dat[['CHROM','POS','REF','ALT',4,5,6,7,8,'LCL5_consensus_calls', 'LCL5_detect_number','LCL5_same_diff',11]]
sub['mendelian_state'] = 'MIE'
sub.loc[sub[11]=='1:1:1','mendelian_state'] = 'MC'
sub.columns=['CHROM','POS','REF','ALT','variant_type','LCL5','LCL6','LCL7','LCL8','LCL5_consensus_calls','LCL5_detect_number','LCL5_same_diff','mendelian_detail','mendelian_state']
sub.to_csv(sys.argv[3],sep="\t",index=0)

+ 0
- 16
codescripts/merge_mendelian_vot.py Wyświetl plik

@@ -1,16 +0,0 @@
import pandas as pd
import sys, argparse, os

men = pd.read_table(sys.argv[1],header=None,low_memory=False)
vote = pd.read_table(sys.argv[2],low_memory=False)
men[1]=men[1].astype(str)
merged_df = pd.merge(vote, men, how='inner', left_on=['CHROM','POS'], right_on = [0,1])
lcl5_dat = merged_df[(merged_df[5]!='./.') & (merged_df[5]!='0/0')]

merged_df['mendelian_check'] = 'MIE'
merged_df.loc[merged_df[2]=='1:1:1','mendelian_check'] = 'MP'
sub = merged_df[['CHROM','POS','LCL5_detected_num','mendelian_check',2]]
sub.columns=['CHROM','POS','detected_num','mendelian','detail']
genotype_sub = pd.merge(sub, mut, how='inner', left_on=["CHROM","POS"], right_on = [0,1])
genotype_sub = genotype_sub[['CHROM','POS','detected_num','mendelian','detail',2,3]]
genotype_sub.to_csv(sys.argv[4],header=0,sep="\t",index=0)

+ 2
- 1
inputs Wyświetl plik

@@ -2,9 +2,10 @@
"{{ project_name }}.fasta": "GRCh38.d1.vd1.fa",
"{{ project_name }}.family_vcf": "{{ family_vcf }}",
"{{ project_name }}.disk_size": "500",
"{{ project_name }}.vote_summary": "{{ vote_summary }}",
"{{ project_name }}.SMALLcluster_config": "OnDemand bcs.ps.g.xlarge img-ubuntu-vpc",
"{{ project_name }}.BIGcluster_config": "OnDemand bcs.a2.7xlarge img-ubuntu-vpc",
"{{ project_name }}.MENDELIANdocker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/vbt:v1.1",
"{{ project_name }}.DIYdocker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/high_confidence_call_manuscript:v1.4",
"{{ project_name }}.ref_dir": "oss://pgx-reference-data/GRCh38.d1.vd1/"
}
}

+ 25
- 0
tasks/count_mendelian.wdl Wyświetl plik

@@ -0,0 +1,25 @@
task count_mendelian {
File project_mendelian
File vote_summary
File family_vcf
String family_name = basename(family_vcf,".vcf")
String docker
String cluster_config
String disk_size
command <<<

python /opt/count_mendelian.py ${project_mendelian} ${vote_summary} ${family_name}.mendelian.count.summary.txt

>>>

runtime {
docker:docker
cluster: cluster_config
systemDisk: "cloud_ssd 40"
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
}
output {
File mendelian_summary = "${family_name}.mendelian.count.summary.txt"
}
}

+ 1
- 1
tasks/merge_mendelian.wdl Wyświetl plik

@@ -2,7 +2,7 @@ task merge_mendelian {
File D5_trio_vcf
File D6_trio_vcf
File family_vcf
String family_name = basename(family_vcf,".family.vcf")
String family_name = basename(family_vcf,".vcf")
String docker
String cluster_config
String disk_size

+ 11
- 0
workflow.wdl Wyświetl plik

@@ -1,9 +1,11 @@
import "./tasks/mendelian.wdl" as mendelian
import "./tasks/merge_mendelian.wdl" as merge_mendelian
import "./tasks/count_mendelian.wdl" as count_mendelian

workflow {{ project_name }} {
File family_vcf
File ref_dir
File vote_summary
String fasta
String MENDELIANdocker
String DIYdocker
@@ -31,4 +33,13 @@ workflow {{ project_name }} {
disk_size=disk_size
}

call count_mendelian.count_mendelian as count_mendelian {
input:
project_mendelian=merge_mendelian.project_mendelian,
vote_summary=vote_summary,
family_vcf=family_vcf,
docker=DIYdocker,
cluster_config=SMALLcluster_config,
disk_size=disk_size
}
}

Ładowanie…
Anuluj
Zapisz