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

Single or double quotation mark in descr file matters #1

Open
qifei9 opened this issue Dec 14, 2021 · 5 comments
Open

Single or double quotation mark in descr file matters #1

qifei9 opened this issue Dec 14, 2021 · 5 comments

Comments

@qifei9
Copy link

qifei9 commented Dec 14, 2021

When single quotation mark is used for the seq parameters in the descr files, the behavior is weird.

Tested on sequence:

>t
TTTT

When single quotation marks are used in descr file, for example:

descr
ss(seq='^TT')

no motif could be found. Also seq='^UU' and seq='^uu' result in no motif found. Only seq='^tt' could find the motif.

However, when double quotation marks are used, all of seq="^TT", "^tt", "^UU", "^uu" could find the motif.

Is this the designed behavior or a bug?

@dacase
Copy link
Owner

dacase commented Dec 16, 2021 via email

@dacase
Copy link
Owner

dacase commented Dec 16, 2021

Here is the reply from Tom Macke:

seq="gnra" with double quotes considers the letters to be IUPAC base codes, so n
= [acgt] and r = [ag]
seq='gnra' with single quotes considers the letters to be letters, so n = n and r
= r.
Both 'xxx' and "xxx" are strings. But in the case of "xxx", the xxx is passed to
RM_str2seq() and any letters that are IUPAC codes are converted to char classes
in the stored string value.. In the case of 'xxx' the string value is xxx.
RM_str2seq() is at line 117 of rmlex.l in the code for processing "" strings. but
it is not used in the code for processing '' strings.
I'm pretty sure this is in the doc as I remember the Isis people thought the two
types of strings were pretty cool.
Hope this helps, if not ask more questions and I'll try again.

I'm embarassed (but not surprised) that I missed the difference in rmlex.l between single and double quoted strings. Plus, the distinction between single and double quotes is explained in the middle of p. 15 of rnamotif.pdf. But we should probably have a cross-reference to this explanation earlier in the document -- I'll work on that.

@qifei9
Copy link
Author

qifei9 commented Dec 16, 2021

Thank you very much for this software and for the reply. Sorry that I missed that part in the manual.

Is it OK to report/ask more issue/question in this repo? Perhaps it would also be misreading of manual...

@qifei9 qifei9 closed this as completed Dec 16, 2021
@dacase
Copy link
Owner

dacase commented Dec 16, 2021 via email

@dacase dacase reopened this Jan 6, 2022
@dacase
Copy link
Owner

dacase commented Jan 6, 2022

Reopening this issue so I don't forget my promise to update the Reference Manual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants