@@ -0,0 +1,42 @@ | |||
import sys,getopt | |||
import os | |||
import fileinput | |||
outFile = open(sys.argv[2],'w') | |||
for line in fileinput.input(sys.argv[1]): | |||
line = line.rstrip() | |||
strings = line.strip().split('\t') | |||
#d5 | |||
if ',' in strings[6]: | |||
alt_strings = strings[6].split(',') | |||
alt_len = [len(i) for i in alt_strings] | |||
alt = max(alt_len) | |||
else: | |||
alt = len(strings[6]) | |||
ref = strings[5] | |||
pos = int(strings[1]) | |||
if len(ref) == 1 and alt == 1: | |||
StartPos = int(pos) -1 | |||
EndPos = int(pos) | |||
cate = 'SNV' | |||
elif len(ref) > alt: | |||
StartPos = int(pos) - 1 | |||
EndPos = int(pos) + (len(ref) - 1) | |||
cate = 'INDEL' | |||
elif alt > len(ref): | |||
StartPos = int(pos) - 1 | |||
EndPos = int(pos) + (alt - 1) | |||
cate = 'INDEL' | |||
elif len(ref) == alt: | |||
StartPos = int(pos) - 1 | |||
EndPos = int(pos) + (alt - 1) | |||
cate = 'INDEL' | |||
outline = '\t'.join(strings) + '\t' + str(StartPos) + '\t' + str(EndPos) + '\t' + cate + '\n' | |||
outFile.write(outline) | |||
@@ -1,6 +1,7 @@ | |||
{ | |||
"{{ project_name }}.right_200": "oss://pgx-result/renluyao/manuscript/small_variants_near_SV/chr6.ins.right.200", | |||
"{{ project_name }}.left_100": "oss://pgx-result/renluyao/manuscript/small_variants_near_SV/chr6.ins.left.100", | |||
"{{ project_name }}.MIEpos2bed.docker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/high_confidence_call_manuscript:v1.4", | |||
"{{ project_name }}.disk_size": "100", | |||
"{{ project_name }}.right_50": "oss://pgx-result/renluyao/manuscript/small_variants_near_SV/chr6.ins.right.50", | |||
"{{ project_name }}.chromo": "chr6", | |||
@@ -8,8 +9,8 @@ | |||
"{{ project_name }}.inputSamplesFile": "{{ inputSamplesFile }}", | |||
"{{ project_name }}.right_100": "oss://pgx-result/renluyao/manuscript/small_variants_near_SV/chr6.ins.right.100", | |||
"{{ project_name }}.left_150": "oss://pgx-result/renluyao/manuscript/small_variants_near_SV/chr6.ins.left.150", | |||
"{{ project_name }}.docker": "registry-internal.cn-shanghai.aliyuncs.com/pgx-docker-registry/bedtools:v2.27.1", | |||
"{{ project_name }}.left_200": "oss://pgx-result/renluyao/manuscript/small_variants_near_SV/chr6.ins.left.200", | |||
"{{ project_name }}.bedCoverage.docker": "registry-internal.cn-shanghai.aliyuncs.com/pgx-docker-registry/bedtools:v2.27.1", | |||
"{{ project_name }}.left_50": "oss://pgx-result/renluyao/manuscript/small_variants_near_SV/chr6.ins.left.50", | |||
"{{ project_name }}.cluster_config": "OnDemand bcs.a2.large img-ubuntu-vpc" | |||
} |
@@ -8,9 +8,11 @@ task MIEpos2bed { | |||
command <<< | |||
cat ${mie_file} | awk '{print $1"\t"$2"\t"$2}' > ${sample_name}.${chromo}.allvariants.bed | |||
python /opt/vcf2bed.py ${mie_file} ${sample_name}.${chromo}.info.txt | |||
cat ${mie_file} | grep -v '1:1:1' | awk '{print $1"\t"$2"\t"$2}' > ${sample_name}.${chromo}.mie.bed | |||
cat ${mie_file} | awk '{ if ($3 == 0) { print } }' | cut -f1,8,9 > ${sample_name}.${chromo}.allvariants.bed | |||
cat ${mie_file} | awk '{ if ($3 == 0) { print } }' | grep 'MIE' | cut -f1,8,9 > ${sample_name}.${chromo}.mie.bed | |||
>>> | |||
@@ -21,6 +23,7 @@ task MIEpos2bed { | |||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||
} | |||
output { | |||
File info = "${sample_name}.${chromo}.info.txt" | |||
File mie_bed = "${sample_name}.${chromo}.mie.bed" | |||
File all_bed = "${sample_name}.${chromo}.allvariants.bed" | |||
} |
@@ -13,7 +13,6 @@ workflow {{ project_name }} { | |||
File right_150 | |||
File right_200 | |||
String chromo | |||
String docker | |||
String cluster_config | |||
String disk_size | |||
@@ -23,7 +22,6 @@ workflow {{ project_name }} { | |||
mie_file=sample[0], | |||
chromo=chromo, | |||
sample_name=sample[1], | |||
docker=docker, | |||
cluster_config=cluster_config, | |||
disk_size=disk_size | |||
} | |||
@@ -41,7 +39,6 @@ workflow {{ project_name }} { | |||
right_200=right_200, | |||
sample_name=sample[1], | |||
chromo=chromo, | |||
docker=docker, | |||
cluster_config=cluster_config, | |||
disk_size=disk_size | |||
} |