This PR fixes a bug we bumped into, where reads that map partially beyond the end of the reference cause artic minion to crash.
The problem arises because the size of the vector depths in make_depth_mask.py is equal to the length of the reference. When calling bamFile.pileup(...), however, pileupcolumn.pos might cause an Index out of range error if there is a read that goes beyond the end of the reference or before its start position.
Since these sections of the reads are irrelevant to calculate coverage, the solution implemented here is to set boundaries for the bamFile.pileup(...) function, so that it only considers bases within the reference.
This PR fixes a bug we bumped into, where reads that map partially beyond the end of the reference cause
artic minion
to crash.The problem arises because the size of the vector
depths
inmake_depth_mask.py
is equal to the length of the reference. When callingbamFile.pileup(...)
, however,pileupcolumn.pos
might cause anIndex out of range
error if there is a read that goes beyond the end of the reference or before its start position.Since these sections of the reads are irrelevant to calculate coverage, the solution implemented here is to set boundaries for the
bamFile.pileup(...)
function, so that it only considers bases within the reference.