Skip to content

Instantly share code, notes, and snippets.

@TamaDP
Created November 16, 2015 16:24
Show Gist options
  • Save TamaDP/0d990c348f62d0bb5e66 to your computer and use it in GitHub Desktop.
Save TamaDP/0d990c348f62d0bb5e66 to your computer and use it in GitHub Desktop.
Trying format for output
#!/usr/bin/perl -w
use strict;
use warnings;
my (@proteins, @peptides);
my ($protein, $i, $j);
@proteins = qw(
DAAAAATTLTTTAMTTTTTTCKMMFRPPPPPGGGGGGGGGGGG
ALTAMCMNVWEITYHKGSDVNRRASFAQPPPQPPPPLLAIKPASDASD
DAAAAATTLTTTAMTTTTTTCK
);
for $protein (@proteins) {
@peptides = split /(?<=[KR])(?!P)/, $protein;
}
for (@proteins){
for ($i=0, $i<@proteins, $i++){
print "> Protein: $i|Peptide: | No cleavages\n";
print "$_\n" for @peptides;
}
}
#Prints 9 times:
#> Protein: 1|Peptide: | No cleavages
#DAAAAATTLTTTAMTTTTTTCK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment