Question: extract specific population (vcf) from 1000 genomes - keep option
0
gravatar for muralinmars
5.1 years ago by
muralinmars70
France
muralinmars70 wrote:

hi all,

how can i extract 1000 genome data in vcf format of a specific population using vcftools. Currently I am using tabix to download the data

tabix -fh ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20110521/ALL.chr`echo ${REGION} | awk -F [\:] '{print $1}'`.phase1_release_v3.20101123.snps_indels_svs.genotypes.vcf.gz $REGION > temp.vcf

and then include only the individuals from european population (CEU,GBR,FIN,TSI); through (--keep) option by providing a txt file (pop_file) including their individualIDs,,,

vcftools --vcf temp.vcf --keep $POP_FILE --recode > temp.vcf

where am i going wrong - As i producing the initial Vcf file but not after the filtering for specific pop.

Any suggestions PLEEEEASE

linux vcftools sequencing • 4.2k views
ADD COMMENTlink modified 5.1 years ago by Pierre Lindenbaum124k • written 5.1 years ago by muralinmars70
2
gravatar for Pierre Lindenbaum
5.1 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum124k wrote:

when using

 

vcftools --vcf temp.vcf --keep $POP_FILE --recode > temp.vcf

 

the file temp.vcf will be overwittern before vcftools is started.

You're working with an empty file

 

Use

vcftools --vcf temp.vcf --keep $POP_FILE --recode > temp2.vcf

 

ADD COMMENTlink written 5.1 years ago by Pierre Lindenbaum124k

thanks... I tried to change the name of the VCF file (to temp2) generated after `keep` option,,,,

But it does not create the temp2 file (while the recode.vcf file is generated properly after filtering for specific population)

here is the code again

#select specific population
if [ "$POP_FILE" != "" ]; then
    vcftools --vcf temp.vcf --keep $POP_FILE --recode --out popfilter > temp2.vcf 2> /dev/null
else
    cp -f temp.vcf temp2.vcf    
fi

ADD REPLYlink written 5.1 years ago by muralinmars70

you're redirecting stderr to /dev/null what was the content of the error message ?

ADD REPLYlink written 5.1 years ago by Pierre Lindenbaum124k
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: 969 users visited in the last hour