c:\@Work\Perl\monks>perl -wMstrict -le
"my @proteins = qw(
DAAAAATTLTTTAMTTTTTTCKMMFRPPPPPGGGGGGGGGGGG
ALTAMCMNVWEITYHKGSDVNRRASFAQPPPQPPPPLLAIKPASDASD
AAAKAAA AAAKAAA XXXXXX
);
;;
my @new_peptides;
for my $protein (@proteins) {
if ($protein =~ s{ (?<= [KR]) (?! P) }{=}xmsg) {
push @new_peptides, split ('=', $protein);
}
}
;;
for my $peptide (@new_peptides) {
print qq{Peptide is '$peptide'};
}
"
Peptide is 'DAAAAATTLTTTAMTTTTTTCK'
Peptide is 'MMFRPPPPPGGGGGGGGGGGG'
Peptide is 'ALTAMCMNVWEITYHK'
Peptide is 'GSDVNR'
Peptide is 'R'
Peptide is 'ASFAQPPPQPPPPLLAIKPASDASD'
Peptide is 'AAAK'
Peptide is 'AAA'
Peptide is 'AAAK'
Peptide is 'AAA'
####
c:\@Work\Perl\monks>perl -wMstrict -le
"my @proteins = qw(
DAAAAATTLTTTAMTTTTTTCKMMFRPPPPPGGGGGGGGGGGG
ALTAMCMNVWEITYHKGSDVNRRASFAQPPPQPPPPLLAIKPASDASD
AAAKAAA AAAKAAA XXXXXX
);
;;
my $cleave = qr{ (?<= [KR]) (?! P) }xms;
;;
my @peptides =
map split($cleave),
grep m{ $cleave }xms,
@proteins
;
;;
print qq{Peptide is '$_'} for @peptides;
"
Peptide is 'DAAAAATTLTTTAMTTTTTTCK'
Peptide is 'MMFRPPPPPGGGGGGGGGGGG'
Peptide is 'ALTAMCMNVWEITYHK'
Peptide is 'GSDVNR'
Peptide is 'R'
Peptide is 'ASFAQPPPQPPPPLLAIKPASDASD'
Peptide is 'AAAK'
Peptide is 'AAA'
Peptide is 'AAAK'
Peptide is 'AAA'
####
my @peptides = # 4. and the pieces are peptides.
map split($cleave), # 3. split at each cleavage point...
grep m{ $cleave }xms, # 2. that can be cleaved, ...
@proteins # 1. for each protein...
;