pysam-developers / pysam

Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
https://pysam.readthedocs.io/en/latest/
MIT License
773 stars 274 forks source link

set_encoding_error_handler example #1260

Open nathanLauHKGI opened 7 months ago

nathanLauHKGI commented 7 months ago

Hi,

I would like to use set_encoding_error_handler to handle non-ascii character in vcf info field, e.g. 'Papillon-Lefèvre_syndrome', generate the following issue:

UnicodeDecodeError: 'utf-8' codec can't decode byte

please can you provide an example python source code?