Git Product home page Git Product logo

Comments (4)

holtgrewe avatar holtgrewe commented on June 5, 2024

@robertopreste Thanks for the report! Your VCF example is not complete, apparently, I had to add the ##fileformat header line. I could not reproduce your problem.

Could you setup a minimal working example with a complete minimal VCF file, a minimal python script to trigger the problem (or a fork of vcfpy with a test case that triggers the problem)?

Try the branch 130-gt-data. Then install all dependencies in requirements/*.txt. Then:

# pytest tests/test_vcfs_from_the_wild.py
rootdir: /mnt/c/Users/mholtgre/Documents/Development/vcfpy, inifile: setup.cfg
plugins: cov-2.7.1, sugar-0.9.2
collecting ...
 tests/test_vcfs_from_the_wild.py ✓                                                                                                                                                                                          100% ██████████
============================================================================================================= warnings summary =============================================================================================================
/home/manuel/miniconda3/envs/vcfpy/lib/python3.7/site-packages/pysam/__init__.py:16
/home/manuel/miniconda3/envs/vcfpy/lib/python3.7/site-packages/pysam/__init__.py:16
  /home/manuel/miniconda3/envs/vcfpy/lib/python3.7/site-packages/pysam/__init__.py:16: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    import pysam.libcsamfile as libcsamfile

-- Docs: https://docs.pytest.org/en/latest/warnings.html

----------- coverage: platform linux, python 3.7.3-final-0 -----------
Coverage XML written to file coverage.xml


Results (0.47s):
       1 passed

PS: you appear to be using bumpversion. You might be interested in the excellent versioneer package.

from vcfpy.

robertopreste avatar robertopreste commented on June 5, 2024

Hello, thanks for your response.
I just made a pull request with the complete VCF file that causes the error I mentioned. The tests/test_vcfs_from_the_wild.py test works fine, but if you add a simple loop to iterate over each record in the given VCF file, it breaks and returns the error I described. (It also does the same thing with the small snippet of VCF I provided above, but maybe with the complete file you might be able to investigate it better.)

from vcfpy.

holtgrewe avatar holtgrewe commented on June 5, 2024

Hi @robertopreste. I'm sorry for taking so long to answer. The issue is the following header:

##FORMAT=<ID=GT,Number=.,Type=String,Description="Genotype">

The issue is the Number=. The VCF Standard proposes the following see (1.6.2 in https://samtools.github.io/hts-specs/VCFv4.3.pdf)

##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">

tl;dr -- your file is noncompliant in my opinion. How should we proceed here?

from vcfpy.

robertopreste avatar robertopreste commented on June 5, 2024

Hello @holtgrewe, thanks for your answer.
I will forward this to the colleague who gave me this VCF file, so that he can hopefully fix the format. FYI, since my colleague was in a hurry for some analyses, I'm currently using a custom version of your vcfpy package which addresses this issue with an ugly try-except clause, but I'm going to delete it as soon as this issue is fixed.

I guess we can close this issue now. Thanks again for your help.

from vcfpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.