-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read_vcf cannot read VCF file #21
Comments
Dear @GeorgeGkafas, Can you provide the following info:
|
Oh, wait, I see the problem already.
This won't work with your personal file. In the example, we use:
which means the function To read your own file you should simple provide the path and file name: read_vcf(x="crup.vcf") Please try that and report back if possible. Bárbara |
Hi Barbara,
As I tried to figure out the issue, I found this on a help-page "If a function, it will be called with old and expected to return the new column names. The new column names must be the same length as columns provided to old argument." Do you think that the read_vcf tries to find the exact same number of individuals? I use R version 4.1.2 (2021-11-01) -- "Bird Hippie", in a cluster sever using Linux. Thank you |
Hello, I was able to reproduce this error with the file you sent ("crup.vcf"). It appears the file has strange formatting separating the columns. |
So the problem is your vcf file has tabs ("\t") in the info lines beginning with "##". This confused the The best thing to do would be to select the contents in your vcf of the first 66 lines beginning with ## and replace tabs with spaces. Then paste that back into your file and it should work. Since this is not really a package issue I will likely not change the code, though I could eventually do so and replace the following line in
with
since both work. |
Here's how I did it in the command line. The modified version foryour file is read in properly by
then, in R:
works perfectly. Cheers |
Thank you very much!!!! It's much appreciated! best, |
Hi, |
Dear Dr. Bitarello,
I have a vcf file and I'm keen on examining for evidence of balancing selection. Using the read_vcf command there is an error:
Trying to incorprorate the skip_absent=TRUE,
Error in data.table::fread(x, skip = "##", header = TRUE) :
Input is empty or only contains BOM or terminal control characters
Any help, will be much appreciated.
The text was updated successfully, but these errors were encountered: