extract sample DP values from VCF
3
0
Entering edit mode
7.7 years ago
Ana ▴ 200

I want to extract only sample DP values (the second value in the example below) from my cvf file, this is my genotype annotation

0/0:7:7,0:7:244:0:0:0,-2.10721,-20.8228
0/1:3:3,1:2:74:1:37:-2.76372,0,-3.15643
0/0:9:9,0:9:321:0:0:0,-2.70927,-19.2273
0/0:11:11,0:11:407:0:0:0,-3.31133,-36.8199

How can I do that? can I do that with vcf tools? I would appreciate any suggestion!

vcf perl vcftools • 4.1k views
ADD COMMENT
0
Entering edit mode

Alright, this is my code /data/programs/vcftools_0.1.13/bin/vcftools --vcf my_file.vcf --geno-depth --recode --out results1.vcf

bu I get an error message: Error: Only one output function may be called.

any suggestion for this problem?

ADD REPLY
1
Entering edit mode

Please use ADD COMMENT to reply to earlier answers, as such this thread remains logically structured and easy to follow.

ADD REPLY
0
Entering edit mode

The Error says that you may not use --geno-depth and --recode at the same time. Try using one after other.

ADD REPLY
0
Entering edit mode

are you able to use R? I did the same with R script

ADD REPLY
1
Entering edit mode
7.7 years ago
422385366 ▴ 10

vcftools --geno-depth; You can have a try.

ADD COMMENT
0
Entering edit mode
7.7 years ago
noeD ▴ 130

if you want you can use R (in my opinion it is the best solution) or bash script, for the second option you have to select the column with that field and the following command will extract the DP:

perl -F: -w 'print $F[1]'
ADD COMMENT
0
Entering edit mode
5.9 years ago
b.bearmi ▴ 10
cat file.vcf | awk -F  ":" '/1/ {print $2}' > DP.values.from.vcf.file
ADD COMMENT

Login before adding your answer.

Traffic: 2184 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