merge vcf.gz file
1
0
Entering edit mode
10 weeks ago
Mali • 0

i have vcf.gz file I am tring to merge with bcftools . when i am using the command line it works

bcftools index -f file 1 
bcftools index -f file 2 
bcftools merge file1  file2  > out.vcf

I get the following error when I call the commands from R or Python: : "the file is not BGZF compressed" The file are files are gzip-compressed variant . why it's working only threw the command line ?

vcf.gz bcftools • 317 views
ADD COMMENT
0
Entering edit mode

"file 1 " , with a space, cannot be a real argument. show us the real filenames please, and the error messages.

ADD REPLY
0
Entering edit mode

file1 = '/sci/labs/orzuk/orzuk/projects/Skin/data/Ichilov/vcfFiles/vcfFiles/eb3_1001_748-gatk-haplotype.final.vcf.gz' file2 = '/sci/labs/orzuk/orzuk/projects/Skin/data/Ichilov/vcfFiles/vcfFiles/g15_02001_785-gatk-haplotype.final.vcf.gz' merged_vcf = '/sci/home/mali.tsadok/merged.vcf' bcftools_cmd = ["bcftools" , "index" ,"-f" ,file1 ] proc = subprocess.run(bcftools_cmd) bcftools_cmd = ["bcftools" , "index" ,"-f" ,file2 ] proc = subprocess.run(bcftools_cmd) bcftools_cmd = ["bcftools", "merge" ,file1,file2 , "-o", merged_vcf] proc = subprocess.run(bcftools_cmd)

Failed to open /sci/labs/orzuk/orzuk/projects/Skin/data/Ichilov/vcfFiles/vcfFiles/eb3_1001_748-gatk-haplotype.final.vcf.gz: not compressed with bgzip

ADD REPLY
1
Entering edit mode
10 weeks ago
ATpoint 73k

You must compress with bgzip.

gzip -d your.vcf.gz
bgzip your.vcf
ADD COMMENT

Login before adding your answer.

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