in reply to Bioinformatics: Regex loop, no output
Using the power of map:
#! /usr/bin/perl -wl my @proteins = qw(DAAAAATTLTTTAMTTTTTTCKMMFRPPPPPGGGGGGGGGGGG ALTAMCMN +VWEITYHKGSDVNRRASFAQPPPQPPPPLLAIKPASDASD); my %seen = map {$_ => 1} @proteins; print "Peptide $_" for grep !$seen{$_}++, map {split /[KR]\K(?!P)/} @proteins;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Bioinformatics: Regex loop, no output
by AnomalousMonk (Archbishop) on Nov 15, 2015 at 23:33 UTC |