Skip to content
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

Raise error if input file is incomplete #6

Open
youngchanpark opened this issue May 26, 2021 · 1 comment
Open

Raise error if input file is incomplete #6

youngchanpark opened this issue May 26, 2021 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@youngchanpark
Copy link
Member

data.table outputs a warning message if it tries to read an incomplete file:

Warning message:
In data.table::fread(filepath, select = c(chr, pos, a1, a2, pval,  :
  Discarded single-line footer: <<6     6:28098445      28098445        T       G       0.0478  0.0051  0.0424  0.0527  -0.0115 0.0>>

In this particular case, I was trying to read a file which was still copying. So what data.table did was to just remove the incomplete line and saved the remaining content. I think an error would be more appropriate than a warning message.

@youngchanpark youngchanpark added the bug Something isn't working label May 26, 2021
@youngchanpark youngchanpark added this to the v1.0.0 milestone May 26, 2021
@agilly
Copy link
Member

agilly commented May 27, 2021

This is a behaviour of fread which cannot easily be circumvented as far as I know. What could be done is to check after loading that all autosomes are present, and then error out unless an option --ignore-filechecks is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants