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
Error: Invalid wig ID on line 1 #239
Comments
Got it, it needs the multisplit tag |
Thanks for the report. Because this input is a file stream, and not a regular file, there would be no way for wig2bed (convert2bed) to read ahead and know that the input contains multiple sections, without reading through the entire file. But I'll look at modifying the error message to suggest to the user to investigate if the wig file contains multiple sections, in the case this error is thrown. |
Ah ok I understand. But yes if it threw a line saying "maybe there are multiple sections" that would be handy. thank you for bedops |
Yep, that's probably what I'll do. I'll leave this ticket open to add a commit. |
Fixed in d9776fd |
I ran into this problem today, same error, apparently the same cause, running version 2.4.39 (installed via conda). I also tried to test by building an executable from the repo, but wasn't able to successfully run convert2bed-typical --input=wig (because the "sort-bed binary" apparently isn't installed on this machine). I was following the instructions from a tool/pipeline from someone's ≈4 year old paper. So either this behavior didn't exist then, or that author didn't accurately relate the commands in his pipeline. Indeed, adding the command-line option --multisplit=something fixes the problem (or, I should say, the problem doesn't occur on line 1). But I'm at a loss as to how I (or any other user) could be expected to discover this. The error message makes you think the input wig file is non-compliant. So I kept looking at the UCSC wiggle format spec and at my file and damned if it didn't look fine. And I pored through the options to see if there was something I was missing. And now even that I know --multisplit is the answer, and reading the description of that option, I would never have realized that is the magic incantation needed to solve my problem. As best I can tell, this error comes from line ≈6110 in convert2bed.c. And it doesn't look to me like it is checking the validity of a wig ID. It's just checking whether the internal wig->id string is empty. And that string is empty because wig->start_write is initialized as false and never gets set to true. A more useful error mesage would include the suggestion that user try "--multisplit". |
@rsharris Thanks for the report. Streaming input is great because it is fast. It can be problematic, however, as there is no way to check if the input is valid, or that certain options are required, until after chunks of data come in. If you can provide a link to the input or paper, I can investigate that file and see if a patch makes sense. Let me know if I can help further. |
You should be able to access the wig file via this link: (I've posted the same file in issue 255) The command that failed was |
…input contains multiple sections
Added warning message in commit d932dc1 |
Cool. I'm a big proponent of trying to make the program tell the user what might solve the problem. If for no other reason than that it might cut down on users having to resort to contacting me. |
Hello, trying
here is the beginning of my wig file
it seems all right to me.
Thanks
The text was updated successfully, but these errors were encountered: