Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(issue #881) Fix add_meta function in libcbcf.pyx, so meta-information lines in he… #879

Conversation

lltw
Copy link
Contributor

@lltw lltw commented Jan 15, 2020

…ader added with this function have double-quoting rules in accordance to rules specified in VCF4.2 and VCF4.3 specifications

…ader added with it have double-quoting rules in accordance to rules specified in VCF4.2 and VCF4.3 specifications
@lltw lltw changed the title Fix add_meta function in libcbcf.pyx, so meta-information lines in he… (issue #881) Fix add_meta function in libcbcf.pyx, so meta-information lines in he… Jan 15, 2020
@AndreasHeger AndreasHeger merged commit 44fc853 into pysam-developers:master Jan 18, 2020
@AndreasHeger
Copy link
Contributor

Thanks!

@kishwarshafin
Copy link

Hello,

Not sure what happened here, with this code:

sq_id = sq
 n = self.fasta_handler.get_chromosome_sequence_length(sq)
items = [('ID', sq_id), 
         ('length', ln)]
header.add_meta(key='contig', items=items)

I keep getting:

Traceback (most recent call last):
  File "/home/kishwar/Kishwar/software/pepper/venv/bin/pepper_snp", line 11, in <module>
    load_entry_point('pepper-polish==0.0.6', 'console_scripts', 'pepper_snp')()
  File "/home/kishwar/Kishwar/software/pepper/venv/lib/python3.6/site-packages/pepper_polish-0.0.6-py3.6-linux-x86_64.egg/pepper_snp/pepper_snp.py", line 428, in main
    FLAGS.probability_threshold)
  File "/home/kishwar/Kishwar/software/pepper/venv/lib/python3.6/site-packages/pepper_polish-0.0.6-py3.6-linux-x86_64.egg/pepper_snp/modules/python/FindSNPCandidates.py", line 59, in find_candidates
    vcf_file.write_vcf_records(contig, all_candidates, reference_dict, positions)
  File "/home/kishwar/Kishwar/software/pepper/venv/lib/python3.6/site-packages/pepper_polish-0.0.6-py3.6-linux-x86_64.egg/pepper_snp/modules/python/VcfWriter.py", line 89, in write_vcf_records
    filter='PASS', alleles=alleles, GT=gt, GQ=60)
  File "pysam/libcbcf.pyx", line 4398, in pysam.libcbcf.VariantFile.new_record
  File "pysam/libcbcf.pyx", line 2074, in pysam.libcbcf.VariantHeader.new_record
  File "pysam/libcbcf.pyx", line 3061, in pysam.libcbcf.VariantRecord.contig.__set__
ValueError: Invalid chromosome/contig

However, works fine on 0.15.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants