Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error installing vcftools jlelias Bioinformatics 14 08-10-2014 06:58 AM
VCFtools Ploidy Issue ercfrtz Bioinformatics 1 11-30-2013 12:03 AM
vcftools non-binary genotypes info_nowise Bioinformatics 0 02-24-2012 08:29 AM
vcftools to annotate SNP rururara Bioinformatics 0 03-31-2011 07:47 AM
vcftools perl script weiyulin Bioinformatics 6 12-09-2010 03:13 PM

Thread Tools
Old 08-25-2013, 02:56 PM   #1
Junior Member
Location: Maryland

Join Date: Mar 2013
Posts: 5
Default extract a chromosome with vcftools

I tried to extract Chr 1 data and recode a new vcf using the example in the basic documentation and got no data out. All I want to do is break the large input file into small files of one chromosome each.

this is the log file:

VCFtools - v0.1.10
(C) Adam Auton 2009

Parameters as interpreted:
--gzvcf /Users/williamcassano/Desktop/Variations/PG0000652-BLD.genome.block.anno.vcf.gz
--chr 1
--out chr1

Using zlib version: 1.2.5
Reading Index file.
File contains 128054613 entries and 1 individuals.
Filtering by chromosome.
Chromosome: chr18
Chromosome: chr3
Chromosome: chr20
Chromosome: chr17
Chromosome: chr8
Chromosome: chr19
Chromosome: chr15
Chromosome: chr10
Chromosome: chr12
Chromosome: chr16
Chromosome: chrX
Chromosome: chr14
Chromosome: chr5
Chromosome: chr22
Chromosome: chr2
Chromosome: chr6
Chromosome: chr7
Chromosome: chr1
Chromosome: chr9
Chromosome: chr13
Chromosome: chr21
Chromosome: chrM
Chromosome: chrY
Chromosome: chr4
Chromosome: chr11
Keeping 0 entries on specified chromosomes.
Applying Required Filters.
After filtering, kept 1 out of 1 Individuals
After filtering, kept 0 out of a possible 0 Sites
Error:No data left for analysis!
willMD is offline   Reply With Quote
Old 08-26-2013, 01:56 AM   #2
Junior Member
Location: France

Join Date: Aug 2013
Posts: 1

You may have to put '--chr chr1' instead of '--chr 1'. Your vcf file has chromosoms marked as 'chr$number'.
Good luck
Benjelloun is offline   Reply With Quote
Old 02-20-2017, 01:10 AM   #3
Location: india

Join Date: Feb 2017
Posts: 14

i have applied this vcftools but it showing following program
My input command :
vcftools --gzvcf ExAC.r0.3.1.sites.vep.vcf.gz --chr chr21 --out chr21 --recode

And error is showing like this:

(C) Adam Auton and Anthony Marcketta 2009

Parameters as interpreted:
--gzvcf ExAC.r0.3.1.sites.vep.vcf.gz
--chr chr21
--out chr21

Using zlib version: 1.2.8
After filtering, kept 0 out of 0 Individuals
Outputting VCF file...
After filtering, kept 0 out of a possible 0 Sites
File does not contain any sites
Run Time = 0.00 seconds

I am getting all these things as log file as output?

Could anyone please help me to split the chromosome21.vcf from my input file with proper command line discription?

I have looked and tried all vcf command and and even gatk too?
rajeshkmaurya08 is offline   Reply With Quote
Old 02-21-2017, 10:12 PM   #4
Registered Vendor
Location: Eugene, OR

Join Date: May 2013
Posts: 453

I think you have the opposite problem as the original poster. They used --chr 1 but the vcf used chr1 instead of 1 to describe the chromosome number. You are using --chr chr21 but it looks like ExAC uses 21 instead of chr21 to describe the chromosome number.
1 13372 . G C 608.91 PASS
Providing nextRAD genotyping and PacBio sequencing services.
SNPsaurus is offline   Reply With Quote
Old 02-21-2017, 10:20 PM   #5
Location: india

Join Date: Feb 2017
Posts: 14

yes you right,
but vcf tool was not giving output.

so i tried with tabix

tabix -h file_name 21

it vcf file of chr 21 but i am not sure about its ending statement.

is it right to extract by this command?
rajeshkmaurya08 is offline   Reply With Quote
Old 06-22-2017, 12:58 PM   #6
Location: US

Join Date: Jul 2013
Posts: 28
Default Keep all chromosomes and remove scaffolds


I am trying to do something similar, I want to keep information for 10 chromosomes (Chr01-10) and remove the scaffold SNP information in my vcf file.

This is the code I have run
vcftools --vcf original.vcf --out varCHR.vcf --chr Chr[01-10]

And I receive the following
After filtering, kept 2 out of 2 Individuals
After filtering, kept 0 out of a possible 166402 Sites
No data left for analysis!
Run Time = 0.00 seconds

Can anyone help me with my problem?
Thank you
htetre is offline   Reply With Quote
Old 06-27-2017, 12:26 PM   #7
Brian Bushnell
Super Moderator
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707

You can also use BBMap's like this:

Code: in=original.vcf out=varCHR.vcf contigs=Chr01,Chr02,Chr03,Chr04,Chr05,Chr06,Chr07,Chr08,Chr09,Chr10
...assuming those chromosome names are correct. Please let me know if that does not work.
Brian Bushnell is offline   Reply With Quote
Old 01-24-2018, 04:21 AM   #8
Junior Member
Location: Chennai

Join Date: Jan 2018
Posts: 1

Great tool for splitting vcf files
plreddy is offline   Reply With Quote
Old 02-01-2018, 02:24 AM   #9
Junior Member
Location: tamilnadu, india

Join Date: Aug 2017
Posts: 1

vcftools can do this, here is a command
vcftools --chr chr1 --vcf myfile.vcf --recode --recode -INFO-all --out myfile.chr1.vcf

check your vcf file first to assure how chromosome number has been marked. (chr1 or 1) use that in command line.
suryat is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 03:44 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO