#!/usr/bin/perl # http://perlmonks.org/?node_id=1147731 use strict; use warnings; my @new_peptides; my @proteins=qw( DAAAAATTLTTTAMTTTTTTCKMMFRPPPPPGGGGGGGGGGGG ALTAMCMNVWEITYHKGSDVNRRASFAQPPPQPPPPLLAIKPASDASD ); for my $protein (@proteins) { if ($protein =~ m/[KR](?!P)/) { $protein =~ s/[KR]\K(?!P)/=/g; push @new_peptides, split ('=',$protein); } } for (@new_peptides) { print "The peptide is $_\n"; }
In reply to Re: Bioinformatics: Regex loop, no output
by Anonymous Monk
in thread Bioinformatics: Regex loop, no output
by TamaDP
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |