Comments (7)
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.
thanks for the thorough report.
from variantannotation.
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.
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.
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.
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.
I see you're working in python. In python you can use readlines()
from variantannotation.
Related Issues (20)
- locateVariants returns genes from both Forward and Reverse strands in PRECEDEID and FOLLOWID HOT 3
- Files do not exist error HOT 3
- Converting VCF --> data.table HOT 18
- Speed up `readVcf` HOT 16
- Populate INFO column with VariantAnnotation::writeVcf HOT 4
- predictCoding with incorrect predictions HOT 1
- SNPlocs version in vignette needs updating HOT 1
- writeVcf Output Causes IGV Errors from htsjdk HOT 5
- Error message from predictCoding () HOT 1
- backward compatibility of info() function HOT 12
- readVcf is Slow if ScanVcfParam which Regions is Lengthy HOT 3
- readVcf error: if (NROW(flesh) != flesh_len2) stop("shape of 'skeleton' is not compatible with 'NROW(flesh)'") HOT 6
- expand Error data is NULL
- Memory Error for readGeno but not for readVcf HOT 5
- locateVariant from VariantAnnotation returns wrong results HOT 1
- readVcf(), VariantAnnotation and shiny compatibility HOT 1
- Faithfully recapitulate metadata via a round-trip through `writeVcf` + `readVcf`. HOT 4
- Convert `Number=A` to `Number=1` when creating an `ExpandedVCF` HOT 5
- `readVcf` doesn't handle quoted `=` in `hapmap_exome_chr22.vcf.gz` correctly HOT 8
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 variantannotation.