Open masterzhen119 opened 1 year ago
I try to rewrite the vcf file with the following code:
import pysam main_url_saving = '/home/Data/Data/' post_vcf = 'unadjusted.vcf' out_vcf = 'justed.vcf' vcf_file_url = main_url_saving+post_vcf bcf_in = pysam.VariantFile(vcf_file_url) # auto-detect input format bcf_out = pysam.VariantFile(main_url_saving+out_vcf, 'w', header=bcf_in.header) for rec in bcf_in: bcf_out.write(rec)
But I have the titled error. Is there anything wrong? By the way, the original format of vcf is 4.1.
I try to rewrite the vcf file with the following code:
import pysam main_url_saving = '/home/Data/Data/' post_vcf = 'unadjusted.vcf' out_vcf = 'justed.vcf' vcf_file_url = main_url_saving+post_vcf bcf_in = pysam.VariantFile(vcf_file_url) # auto-detect input format bcf_out = pysam.VariantFile(main_url_saving+out_vcf, 'w', header=bcf_in.header) for rec in bcf_in: bcf_out.write(rec)
But I have the titled error. Is there anything wrong? By the way, the original format of vcf is 4.1.