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 ?
"file 1 " , with a space, cannot be a real argument. show us the real filenames please, and the error messages.
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