Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use local FASTA files if available
Fall back to file from internet if file isn't available
  • Loading branch information
Paul Cochrane committed Apr 28, 2015
1 parent e2986dd commit 2168bf6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion categories/rosalind/mprt-grondilu.pl
Expand Up @@ -36,8 +36,12 @@
sub MAIN($input-file = Nil) {
my @input = $input-file ?? $input-file.IO.lines !! @default-data;
my $N-glycosylation = rx / N <-[P]> <[ST]> <-[P]> /;
my $base-path = $*PROGRAM_NAME.IO.dirname;
for @input -> $id {
my $fasta = qqx{wget -O - -q "http://www.uniprot.org/uniprot/$id.fasta"};
my $fasta-name = $base-path ~ "/$id.fasta";
my $fasta = $fasta-name.IO.e
?? $fasta-name.IO.slurp
!! qqx{wget -O - -q "http://www.uniprot.org/uniprot/$id.fasta"};
given join '', grep /^ <.alpha>+ $/, $fasta.split: "\n" {
if $N-glycosylation {
say $id;
Expand Down

0 comments on commit 2168bf6

Please sign in to comment.