Skip to content

Instantly share code, notes, and snippets.

@lmmx
Forked from TamaDP/Trying_printing.pl
Last active November 16, 2015 17:23
Show Gist options
  • Save lmmx/15ca4ae2445544f92394 to your computer and use it in GitHub Desktop.
Save lmmx/15ca4ae2445544f92394 to your computer and use it in GitHub Desktop.
Trying format for output
use strict;
use warnings;
my $n_missed_cleavages = 0;
my @proteins = qw(
DAAAAATTLTTTAMTTTTTTCKMMFRPPPPPGGGGGGGGGGGG
ALTAMCMNVWEITYHKGSDVNRRASFAQPPPQPPPPLLAIKPASDASD
DAAAAATTLTTTAMTTTTTTCK
);
my $n_proteins = scalar @proteins;
print "Processing $n_proteins proteins\n";
for my $i (0..$#proteins) {
my $printed_i = $i+1;
print "Protein: $printed_i\n";
my $protein = $proteins[$i];
my @peptides = split /(?<=[KR])(?!P)/, $protein;
my $j;
print scalar @peptides . " peptides for protein $printed_i\n";
for my $j (0..$#peptides) {
my $printed_j = $j+1;
print "> Protein: $printed_i|Peptide:$printed_j| $n_missed_cleavages cleavages\n";
print "$peptides[$j]\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment