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

CigarStats.apply could give better error if internal clipping operators found #834

Open
mjhipp opened this issue Apr 26, 2022 · 0 comments

Comments

@mjhipp
Copy link
Contributor

mjhipp commented Apr 26, 2022

After #761, this apply method will fail during this loop if a clipping operator is found within the read, as it halts prematurely here:

// aligned bases
while (index < cigar.elems.length && !cigar.elems(index).operator.isClipping) {
val elem = cigar.elems(index)
lengthOnQuery += elem.lengthOnQuery
lengthOnTarget += elem.lengthOnTarget
if (elem.operator.isAlignment) alignedBases += elem.length
index += 1
}

The error just says that the cigar did not consume all elements:

java.lang.IllegalArgumentException: requirement failed: Invalid cigar, did not consume all the elements: 5M5I5D5N5S5H[5P5=5X]

It would be helpful if the error specified that there were clipping operators found in the middle of the read.

@mjhipp mjhipp changed the title CigarStats.apply could give better error if internal clipping operators found inside re CigarStats.apply could give better error if internal clipping operators found Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants