Comments (4)
@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.
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.
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.
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)
- Doesn't understand PASS in filter column HOT 3
- VCF Writer seems not to write header HOT 2
- How fast is this compared to other libraries? HOT 1
- Help subsetting samples HOT 2
- Bug in is_variant HOT 1
- Problem with colons when writing INFO field value strings HOT 4
- FORMAT: list or tuple? HOT 1
- add FORMAT and calls to vcf? HOT 3
- Pysam UnicodeDecodeError when loading with tabixed VCF HOT 5
- Unknown Filter `PASS` HOT 5
- write_record() error: TypeError: 'int' object is not iterable HOT 2
- Escape characters
- [BUG] INFO flag raises TypeError HOT 3
- Couldn't parse compressed vcf file (vcf.bgz) HOT 1
- ModuleNotFoundError: No module named 'pysam' HOT 2
- Suggestion: Add process_alt() to __init__.py and documentation
- in _serialize_record row = [record.CHROM, record.POS] AttributeError: 'str' object has no attribute 'CHROM'
- ( never mind, please delete, sorry! )
- Record.fetch opens and closes TabixFile on each call, which slows down fetch calls drastically
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vcfpy.