Giter VIP home page Giter VIP logo

Comments (7)

vjcitn avatar vjcitn commented on July 17, 2024

you did a lot of work. I think the problem is a stray blank character at the end of the #CHROM line. Once I remove that readVcf works.

from variantannotation.

vjcitn avatar vjcitn commented on July 17, 2024

thanks for the thorough report.

from variantannotation.

vjcitn avatar vjcitn commented on July 17, 2024

How did I find it out? I ran the example of readVcf, then did a readLines on the example file and on your excerpt of the problematic file. I noticed that the #CHROM lines differed as noted. A sad lack of resilience in the parsing infrastructure.

from variantannotation.

cyrusmallon avatar cyrusmallon commented on July 17, 2024

Thank you so much for your quick reply and solution! I didn't know about the readLines() function, but I just ran it and see the same space you did! After taking the space away vcf now loads.

I will close the issue now.

Thanks again!

from variantannotation.

sandra-biology avatar sandra-biology commented on July 17, 2024

you did a lot of work. I think the problem is a stray blank character at the end of the #CHROM line. Once I remove that readVcf works.

Hi, could you clarify what you mean by a stray blank character at the end of the #CHROM line? I'm having my own problems with bcftools not parsing header and think this might be my solution.

from variantannotation.

cyrusmallon avatar cyrusmallon commented on July 17, 2024

Hi,

If you're working with R you can use the readLines() command to look at all input lines of your vcf file, line by line (same thing as row by row). Your output should be something like this:

#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER

Notice that this is a tab separated file and there are no spaces anywhere, only the \t denoting the tab separation.

If you happen to see something like this:

#CHROM\tPOS\tID\tREF\tALT\tQUAL\t FILTER

Where there is a weird space somewhere, then it may be difficult to parse your vcf file. Also take note of the error messages. If I remember correctly, if there is an "INFO" column, then it must be proceeded by some columns with metadata (something to that effect). Also, if you look up the current vcf guidelines, the formats of vcf files are standardized. So perhaps your vcf file is somehow different than the standard format and for that reason it cannot be parsed/loaded.

from variantannotation.

cyrusmallon avatar cyrusmallon commented on July 17, 2024

I see you're working in python. In python you can use readlines()

from variantannotation.

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.