I wonder why this code formats correctly in preview but not when posted?
I have a peptide like this
SNINNIING
Let's suppose that for 2 of the positions I have alternative amino acids. For example, the first "S" could be "T" and the last "G" could be "E". This means that I can have 3 alternative peptides
TNINNIING (S -> T)
SNINNIINE (G -> E)
TNINNIINE (both)
Is there a way to get these additional peptides using Perl? My problems begin when I have 3 or more alternative amino acids, because otherwise I could it by hand!
2 answers
Check if this thread helps:
http://stackoverflow.com/questions/10665538/perl-generate-all-matching-string-to-a-regex
use strict; use warnings; use Regexp::Genex qw(:all); my $regex="(T|S)NINNIIN(G|E)"; print $_,"\n" for strings($regex);
produces the following output:
TNINNIING
TNINNIINE
SNINNIING
SNINNIINE
Thanks Woa! I installed the module and worked like a charm!
Log in to answer this question.
The title of your question suggests that you want to know how to permute any peptide sequence to any other sequence of the same length. Is that correct?
Yes, but the permutations are not random. I know that, for example I only have T instead of S. It's like I have a peptide with ambiguities
and want to obtain all 4 possible combinations.
Not related to the question, but I can't see your entire comment Neilfws... If I go to my profile and then to messages, I see sentences that I can't see here.
Yes; original comment was different, I edited it but the old one still shows in message feeds. I don't know why.