nanxstats / protr

🧬 Toolkit for generating various numerical features of protein sequences
https://nanx.me/protr/
Other
52 stars 13 forks source link

extractMoreauBroto return NA's when nlag is greater than the length of the sequence, fixes #2 #3

Closed koefoed closed 8 years ago

koefoed commented 9 years ago

I changed extractMoreauBroto() to return NA's for every lag >= nchar(x) and issue a warning when the length of the sequence, nchar(x), is less than or equal to nlag. Fixes #2

koefoed commented 9 years ago

One could also just use stop instead of warning to halt execution with an error. I am using the function from a script that calls it on a diverse set of sequences, so I prefer to have NA's.