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

terminate called after throwing an instance of 'std::invalid_argument' #7

Closed
tseemann opened this issue Mar 19, 2020 · 5 comments
Closed
Assignees

Comments

@tseemann
Copy link

tseemann commented Mar 19, 2020

using 1.1 and htslib 1.10.2

% ivar trim -i ivar.bam -b nCoV-2019.scheme.bed -p out

terminate called after throwing an instance of 'std::invalid_argument'
 what():  stoi
Aborted (core dumped)

Maybe it's the BED:

% cut -f1-3 nCoV-2019.scheme.bed > new.bed

ivar trim -i ivar.bam -b nww.bed -p out
Number of references: 1
Reference Name: MN908947
Reference Length: 29903
Using Region: MN908947
Sorted By Coordinate
Sorted By Query Name
Segmentation fault (core dumped)

Any ideas?

@tseemann
Copy link
Author

via @drpowell

I think the reason it does on your original bed is because a score is expected in col 5 which you don't have
https://github.com/andersen-lab/ivar/blob/master/src/primer_bed.cpp#L88
(and a strand in col 6)

@tseemann
Copy link
Author

See also artic-network/artic-ncov2019#12

@gkarthik
Copy link
Member

I think that is the source of the error. I use the BED format from here - https://genome.ucsc.edu/FAQ/FAQformat.html#format1.

The order I followed is,

chrom, chromStart,chromEnd, name, score, strand

It seems to match the default 6 column BED format generated by bedtools bamtobed. I assumed that order was standard (maybe I'm in the wrong there?).

This issue does bring up the lack of checks while reading the BED file. I'll get on it :).

@tseemann
Copy link
Author

Yes it seems @scalene has produced invalid BED files.
Some robustness in ivar would be appreciated however :-)

@gkarthik gkarthik self-assigned this Mar 19, 2020
@gkarthik
Copy link
Member

Closed #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants