How to delete sample using vcftools
1
0
Entering edit mode
7.6 years ago
chengyi31000 ▴ 10

If I had merged every vcf file of samples, but find one sample I don't want. How can I delete that sample using vcftools?? Thank you!!!

vcftools delete sample vcf • 18k views
ADD COMMENT
3
Entering edit mode
7.6 years ago

As it says in the manual

--indv <string>
--remove-indv <string>

Specify an individual to be kept or removed from the analysis. This option can be used multiple times to specify multiple individuals. If both options are specified, then the "--indv" option is executed before the "--remove-indv option".

So for example (untested)

vcftools --remove-indv YOUR_INDIVIDUALS_NAME --vcf your_snps.vcf --out your_filtered_snps.vcf
ADD COMMENT
0
Entering edit mode

Thank you I will try it!

ADD REPLY
0
Entering edit mode

It seems work But I can't find the output file?? There only a .log file.

Parameters as interpreted: --vcf /home/chung/vcftools_0.1.13/perl/QC/life_chr2.vcf --out /home/chung/vcftools_0.1.13/perl/QC/life_chr2_new.vcf --remove-indv NGS20140306D

Excluding individuals in 'exclude' list After filtering, kept 420 out of 421 Individuals After filtering, kept 2609042 out of a possible 2609042 Sites Run Time = 93.00 seconds

ADD REPLY
4
Entering edit mode

Hi! I was having the same trouble but if your just add --recode to your line, it will generate the file with the prefix you stated with --out. Like this:

vcftools --remove-indv YOUR_INDIVIDUALS_NAME --vcf your_snps.vcf --recode --out your_filtered_snps.vcf

According to the vcftools manual:

These options are used to generate a new file in either VCF or BCF from the input VCF or BCF file after applying the filtering options specified by the user.

Hope it helps!

ADD REPLY
1
Entering edit mode

Thank you for your post! I was having the same trouble and the --recode option worked!

ADD REPLY

Login before adding your answer.

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