Giter Club home page Giter Club logo

Comments (4)

GarrettNg avatar GarrettNg commented on June 8, 2024 1

The noodles developer has previously mentioned a strong desire to maintain spec compliance, so in this case, your error was a feature and not a bug. We've found that many VCF files in the wild aren't spec compliant, so the situation isn't ideal regarding those files unfortunately.

from oxbow.

GarrettNg avatar GarrettNg commented on June 8, 2024

Hi Andreas, thank you for the detailed report. I was able to replicate your issue.

The error indicates that RS values in the INFO column are causing integer overflow.

To check this, I dug into the VCF file itself with pysam, another tool.

# pysam_check.py
import pysam
with pysam.VariantFile("./GCF_000001405.40.gz") as f:
    records = []
    for record in f.fetch():
        records.append(record)
    print(records)

This produced the following output and warning, which seems consistent with the error message you got.

NC_000001.11    6259533 rs2148352434    C       T       .       .       RS=.;dbSNPBuildID=156;SSR=0;GENEINFO=GPR153:387509;VC=SNV;INT;R5;GNO;FREQ=1000Genomes:0.9998,0.0001562

[W::vcf_parse_info] Extreme INFO/RS value encountered and set to missing at NC_000001.11:6259533

The ID value rs2148352424 seems to represent the actual RS value, which pysam is converting to RS=. in the INFO column since it's too large.

Oxbow is using the noodles library to parse some file formats, including VCF files. Noodles aims to be spec compliant, and appears to be following the VCF 4.4 spec, which uses 32-bit signed integers.

Any attempts to parse numbers greater than 2^31-1 would cause errors.

Next, I looked through the contents of the VCF records to confirm if there are indeed such large numbers present.

# pysam_print_vcf.py
import pysam
with pysam.VariantFile("./GCF_000001405.40.gz") as f:
    for record in f.fetch():
        print(record)
$ python pysam_print_vcf.py > vcf_out  # manually interrupted since it's long running
$ grep "RS=\." vcf_out

Output snippet:

...
NC_000001.11    23815613        rs2148423122    A       G       .       .       RS=.;dbSNPBuildID=156;SSR=0;GENEINFO=HMGCL:3155;VC=SNV;INT
NC_000001.11    23815620        rs2148423131    T       C       .       .       RS=.;dbSNPBuildID=156;SSR=0;GENEINFO=HMGCL:3155;VC=SNV;INT
NC_000001.11    23815640        rs2148423145    T       C       .       .       RS=.;dbSNPBuildID=156;SSR=0;GENEINFO=HMGCL:3155;VC=SNV;INT
...

There are many RS values that exceed the 32-bit signed integer limit.

Unfortunately, this means that you won't be able to parse this particular VCF file with oxbow due to upstream spec conformance.

If you want to view the data by setting the too-large values as missing, you can use another tool like pysam or our VCF dataframe flattener, VCFormer, which wraps pysam.

from oxbow.

ap-- avatar ap-- commented on June 8, 2024

Thank you for the quick reply @GarrettNg!
I'll check out vcformer. Do you think it would make sense to report this upstream with noodles?

from oxbow.

ap-- avatar ap-- commented on June 8, 2024

Makes sense. I'll see if I can report the incorrect format to ncbi.

from oxbow.

Related Issues (14)

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.