divide vcf file by consequence
1
0
Entering edit mode
7.5 years ago
Medhat 9.8k

I have a VEP annotated VCF file I want to divide it based on consequence, my approach is:

awk '{ gsub(",","-",$4); print $0 >> $4".txt"}' input.txt

I substitute "," by "-" so file naming be convenient, but as a result because I depend on column 4 for naming; also the resulted file will contains "-"

for example if column number 4 is
start_lost,splice_region_variant
The output file will be
start_lost-splice_region_variant.txt
Which what I want. However, the resulted data in the file will be
start_lost-splice_region_variant instead of start_lost,splice_region_variant which is incorrect.

Any suggestion?

vcf awk • 1.2k views
ADD COMMENT
0
Entering edit mode

Could you provide first few lines of the vcf? May be head file.vcf?

ADD REPLY
2
Entering edit mode
7.5 years ago

do a copy of $0?

awk '{ P=$0; gsub(",","-",$4); print P >> $4".txt"}' input.txt
ADD COMMENT

Login before adding your answer.

Traffic: 3408 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6