CRISPResso2 icon indicating copy to clipboard operation
CRISPResso2 copied to clipboard

Get custom Needleman Wunsch alignment matrix location

Open Colelyman opened this issue 2 years ago • 3 comments

@kclem is there a particular reason why this alignment matrix can't be customized?

Colelyman avatar Nov 17 '23 17:11 Colelyman

The problem is that _ROOT is dynamic at runtime depending on where the package is installed, and the EDNAFULL matrix file is placed there during installation. This works for the arg default 'EDNAFULL', but if we prepend args.needleman_wunsch_aln_matrix_loc by ROOT, that won't produce a valid path for users who specify their own file.

Some other options would be:

  1. have args.needleman_wunsch_aln_matrix_loc default to None, and if at runtime the arg is None, we look for the EDNAFULL in _ROOT. However, this may be confusing to users ("The default value is None?!?") although we could potentially compassionately deceive users by telling them the default is ENDAFULL and have the default really be None
  2. get rid of the EDNAFULL matrix file and just recreate it in memory

kclem avatar Nov 17 '23 18:11 kclem

Ah, I see what it is like that now; I figured there was a good reason :).

  1. I like this option because it keeps the file separate which makes it easier to modify. Also, if a user wants a custom matrix, but doesn't want to supply --needleman_wunsch_aln_matrix with every run, they can just modify the EDNAFULL file, et voila. (They would need to update it with each install, so it wouldn't be very practical... but I think it is more transparent?)
  2. Not a bad idea either, the only drawback I see is that it makes it slightly more difficult for a user to know how to format a custom matrix file.

Any opposition to me implementing the first option?

Colelyman avatar Nov 17 '23 21:11 Colelyman

On second thought, isn't this line only executed at runtime (it is inside the main function)? So we should be able to use args.needleman_wunsch_aln_matrix_loc, unless I'm missing something.

Colelyman avatar Nov 17 '23 21:11 Colelyman