Package: vcfpy
VCFPyPython 3 VCF library with good support for both reading and writingFree software: MIT licenseDocumentation:https://vcfpy.readthedocs.io.FeaturesSupport for reading and writing VCF v4.3Interface toINFOandFORMATfields is based onOrderedDictallows for easier modification than PyVCF (also I find this more pythonic)Read (and jump in) and write BGZF files just usingvcfpyWhy another VCF parser for Python!I've been using PyVCF with quite some success in the past. However, the
main bottleneck of PyVCF is when you want to modify the per-sample
genotype information. There are some issues in the tracker of PyVCF but
none of them can really be considered solved. I tried several hours to
solve these problems within PyVCF but this never got far or towards a
complete rewrite...For this reason, VCFPy was born and here it is!What's the State?VCFPy is the result of two full days of development plus some
maintenance work later now (right now). I'm using it in several projects
but it is not as battle-tested as PyVCF.Why Python 3 Only?As I'm only using Python 3 code, I see no advantage in carrying around
support for legacy Python 2 and maintaining it. At a later point when
VCFPy is known to be stable, Python 2 support might be added if someone
contributes a pull request.Changelog0.13.8(2024-01-10)Bug Fixesfixing manifest for changelog (#169) (83c5b8e)0.13.7(2024-01-10)Bug Fixesremove versioneer Python 3.12 compatibility (#160) (5e2860e)0.13.6(2022-11-28)Fixing bug insetup.pythat preventedpysamdependency to be loaded (#150).v0.13.5 (2022-11-13)Treat.bgzfiles the same as.gz(#145, #149)v0.13.4 (2022-04-13)Switching to Github Actions for CIFix INFO flag raises TypeError (#146)v0.13.3 (2020-09-14)AddingRecord.update_calls.MakingRecord.{format,calls}use list when emptyv0.13.2 (2020-08-20)AddingCall.set_genotype().v0.13.1 (2020-08-20)FixedCall.ploidy.FixedCall.is_variant.v0.13.0 (2020-07-10)Fixing bug in caseGTdescribes only one allele.Proper escaping of colon and semicolon (or the lack of escaping) inINFOandFORMAT.v0.12.2 (2020-04-29)Fixing bug in caseGTdescribes only one allele.v0.12.1 (2019-03-08)Not warning onPASSfilter if not defined in header.v0.12.0 (2019-01-29)Fixing tests for Python >=3.6Fixing CI, improving tox integration.Applyingblackformatting.Replacing Makefile with more minimal one.Removing some linting errors from flake8.Adding support for reading VCF withoutFORMATor any sample
column.Adding support for writing headers and records withoutFORMATand
any sample columns.v0.11.2 (2018-04-16)Removingpipmodule fromsetup.pywhich is not recommended
anyway.v0.11.1 (2018-03-06)Working around problem in HTSJDK output with incompleteFORMATfields (#127). Writing out.instead of keeping trailing empty
records empty.v0.11.0 (2017-11-22)The fieldFORMAT/FTis now expected to be a semicolon-separated
string. Internally, we will handle it as a list.Switching from warning helper utility code to Pythonwarningsmodule.Returnstrin case of problems with parsing value.v0.10.0 (2017-02-27)Extending API to allow for reading subsets of records. (Writing for
sample subsets or reordered samples is possible through using the
appropriatenameslist in theSamplesInfosfor theWriter).Deep-copying header lines and samples infos onWriterconstructionUsingsamplesattribute fromHeaderinReaderandWriterinstead of passing explicitely0.9.0 (2017-02-26)Restructuring of requirements.txt filesFixing parsing of no-callGTfields0.8.1 (2017-02-08)PEP8 style adjustmentsUsing versioneer for versioningUsingrequirements*.txtfiles now from setup.pyFixing dependency on cyordereddict to be for Python <3.6 instead of
<3.5Jumping by samtools coordinate string now also allowed0.8.0 (2016-10-31)AddingHeader.has_header_linefor querying existence of header
lineHeader.add_*_linereturn aboolno indicating any conflictsConstruction of Writer uses samples within header and no extra
parameter (breaks API)0.7.0 (2016-09-25)Smaller improvements and fixes to documentationAdding Codacy coverage and static code analysis results to READMEVarious smaller code cleanup triggered by Codacy resultsAdding__eq__,__neq__and__hash__to data types (where
applicable)0.6.0 (2016-09-25Refining implementation for breakend and symbolic allele classRemovingrecord.SV_CODESRefactoring parser module a bit to make the code cleanerFixing small typos and problems in documentation0.5.0 (2016-09-24)Deactivating warnings on record parsing by default because of
performanceAdding validation forINFOandFORMATfields on reading (#8)Adding predefinedINFOandFORMATfields topyvcf.header(#32)0.4.1 (2016-09-22)Initially enabling codeclimate0.4.0 (2016-09-22)Exporting constants for encoding variant typesExporting genotype constantsHOM_REF,HOM_ALT,HETImplementingCall.is_phased,Call.is_het,Call.is_variant,Call.is_phased,Call.is_hom_ref,Call.is_hom_altRemovingCall.phased(breaks API, next release is 0.4.0)Adding tests, fixing bugs for methods ofCall0.3.1 (2016-09-21)Work aroundFORMAT/FTbeing a string; this is done so in the Delly
output0.3.0 (2016-09-21)ReaderandWritercan now be used as context manager (withwith)Including license in documentation, including Biopython licenseAdding support for writing bgzf files (taken from Biopython)Adding support for parsing arrays in header linesRemovingexample-4.1-bnd.vcfexample file because v4.1 tumor
derival lacksIDfieldAddingAltAlleleHeaderLine,MetaHeaderLine,PedigreeHeaderLine, andSampleHeaderLineRenamingSimpleHeaderFiletoSimpleHeaderLineWarn on missingFILTERentries on parsingReordered parameters infrom_streamandfrom_file(#18)Renamedfrom_filetofrom_stream(#18)RenamedReader.jump_totoReader.fetchAddingheader_without_linesfunctionGenerally extending API to make it esier to useUpgrading dependencies, enabling pyup-botGreatly extending documentation0.2.1 (2016-09-19)First release on PyPI