neksa / mutagene

Python library and package for mutational analysis
https://www.ncbi.nlm.nih.gov/projects/mutagene/
Other
3 stars 3 forks source link

motif str requirement in cli #8

Closed carolinecunningham closed 5 years ago

carolinecunningham commented 5 years ago

if motif following -m is not in string format, program works unless user uses > to represent mutation

is user uses >, motif truncates beforehand

problem: having to manually put in string format is confusing to user, esp. b/c works sometimes w/o being a str

ways to fix:

neksa commented 5 years ago

It's not a bug. > is a special character in sh and bash that means redirect output. Check your directory for files with "T]N" names and so on.

That's why help says to use quotes: https://github.com/neksa/mutagene/blob/6989ef5fb1052b2a06cba6854f28a00c8c70bd31/mutagene/cli/motif_menu.py#L31

That's also why I have the following code: https://github.com/neksa/mutagene/blob/6989ef5fb1052b2a06cba6854f28a00c8c70bd31/mutagene/cli/motif_menu.py#L49

The only way to detect a problem is to check that both [ and ] brackets are present in the string and generate an error otherwise. However, motif_scanf already does that with a regular expression and returns an empty entry. So if Y[C>T]N inputted, it will not search for Y[C, rather it should not search at all.

carolinecunningham commented 5 years ago

Ok, got it.

However, even if it doesn't search, user still is given impression that it is searching. This is what user sees when running -m Y[C>N]N:

INFO Searching for motif Y[C WARNING No significant motif matches found

I will look at code to try and raise an error when quotes not found in motif_scanf

On Tue, Jul 2, 2019 at 10:35 AM Alexander Goncearenco < notifications@github.com> wrote:

It's not a bug. > is a special character in sh and bash that means redirect output. Check your directory for files with "T]N" names and so on.

That's why help says to use quotes:

https://github.com/neksa/mutagene/blob/6989ef5fb1052b2a06cba6854f28a00c8c70bd31/mutagene/cli/motif_menu.py#L31

That's also why I have the following code:

https://github.com/neksa/mutagene/blob/6989ef5fb1052b2a06cba6854f28a00c8c70bd31/mutagene/cli/motif_menu.py#L49

The only way to detect a problem is to check that both [ and ] brackets are present in the string and generate an error otherwise. However, motif_scanf already does that with a regular expression and returns an empty entry. So if Y[C>T]N inputted, it will not search for Y[C, rather it should not search at all.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neksa/mutagene/issues/8?email_source=notifications&email_token=AJXYVVAQNCIXNCMRULZYPDTP5NRS7A5CNFSM4H44LBF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZBPREY#issuecomment-507705491, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXYVVGBHVBTQQAZTOQYGNDP5NRS7ANCNFSM4H44LBFQ .

carolinecunningham commented 5 years ago

Just fixed issue by adding logger warning, so resolving it.

On Tue, Jul 2, 2019 at 10:39 AM Caroline Cunningham caroline7750@gmail.com wrote:

Ok, got it.

However, even if it doesn't search, user still is given impression that it is searching. This is what user sees when running -m Y[C>N]N:

INFO Searching for motif Y[C WARNING No significant motif matches found

I will look at code to try and raise an error when quotes not found in motif_scanf

On Tue, Jul 2, 2019 at 10:35 AM Alexander Goncearenco < notifications@github.com> wrote:

It's not a bug. > is a special character in sh and bash that means redirect output. Check your directory for files with "T]N" names and so on.

That's why help says to use quotes:

https://github.com/neksa/mutagene/blob/6989ef5fb1052b2a06cba6854f28a00c8c70bd31/mutagene/cli/motif_menu.py#L31

That's also why I have the following code:

https://github.com/neksa/mutagene/blob/6989ef5fb1052b2a06cba6854f28a00c8c70bd31/mutagene/cli/motif_menu.py#L49

The only way to detect a problem is to check that both [ and ] brackets are present in the string and generate an error otherwise. However, motif_scanf already does that with a regular expression and returns an empty entry. So if Y[C>T]N inputted, it will not search for Y[C, rather it should not search at all.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/neksa/mutagene/issues/8?email_source=notifications&email_token=AJXYVVAQNCIXNCMRULZYPDTP5NRS7A5CNFSM4H44LBF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZBPREY#issuecomment-507705491, or mute the thread https://github.com/notifications/unsubscribe-auth/AJXYVVGBHVBTQQAZTOQYGNDP5NRS7ANCNFSM4H44LBFQ .