Question: extract sample DP values from VCF
0
gravatar for Ana
2.4 years ago by
Ana170
Ana170 wrote:

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 filtering vcf tools perl vcf • 1.6k views
ADD COMMENTlink modified 6 months ago by b.bearmi0 • written 2.4 years ago by Ana170

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 REPLYlink written 2.4 years ago by Ana170
1

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

ADD REPLYlink written 2.4 years ago by WouterDeCoster40k

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

ADD REPLYlink written 2.4 years ago by Santosh Anand4.9k

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

ADD REPLYlink written 2.4 years ago by noeD70
1
gravatar for 422385366
2.4 years ago by
42238536610
42238536610 wrote:

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

ADD COMMENTlink written 2.4 years ago by 42238536610
0
gravatar for noeD
2.4 years ago by
noeD70
noeD70 wrote:

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 COMMENTlink written 2.4 years ago by noeD70
0
gravatar for b.bearmi
6 months ago by
b.bearmi0
b.bearmi0 wrote:
cat file.vcf | awk -F  ":" '/1/ {print $2}' > DP.values.from.vcf.file
ADD COMMENTlink written 6 months ago by b.bearmi0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1066 users visited in the last hour