Closed traviswheeler closed 3 years ago
Sounds good. @npcarter, could you have a look at this?
Testing results: for all of --alirange, --modelrange, --ali2model, --model2ali, bounds checking works correctly.
--ali2model and --model2ali just output the conversions of the specified range to/from model space and did not generate an output msa file. Is this the correct behavior?
Valgrind reports memory leaks when run with any of the --alirange --modelrange --model2ali, --ali2model flags.
The --ali2model and --model2ali behavior is expected. I'll look into the valgrind errors.
@npcarter: This should be good for another check. I've cleaned out the memory errors (allocated vars not free'd at exit) and made a few small tweaks to the help text.
Every test of this version fails with the following error:
[npcarter@eddyfs01 hmmer]$ src/alimask --alirange 0-20 ../sequence_dbs/test.msa ~/foo.out no such option --apendmask
Sorry - the final changes I made (to account for re-spelling the appendmask flag) were sitting in a commit that I didn’t notice hadn't gone through. I’ve pushed them now.
This version looks good to go. I've merged it into develop.
This commit addresses issue #237:
"Alimask crashes if asked to mask an alignment in a region that's outside the range of the alignment."
I've added range checks on all four of --alirange, --modelrange, --ali2model, and --model2ali. For all four:
<from>
positions must be >0<to>
can not be less that<from>
<to>
positions is restricted as is described in the next paragraphs.For (--alirange, --ali2model):
<to>
can not exceed the alignment length.For (--modelrange, --model2ali):
<to>
can not exceed the resulting model length.The --ali2model required a bit of extra attention: The purpose of this flag is to print, for each alignment range
<from>..<to>
, a mapping of the range with two pairs i..j => m..n, such that<from>
and<to>
(inclusive) that maps to a model position; that position is m<from>
and<to>
(inclusive) that maps to a model position; that position is nThere were two bugs in this code. The first allowed j to exceed
<to>
if the<to>
column did not map to a model position. This is fixed. The second allowed a range-pair i..j => m..n to be produced even if no alignment columns in the range<from>..<to>
map to a model position. I've revised the mask output to indicate this lack of mapped positions with an output like:<from>..<to> -> -..- (no map)