#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper;
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper; __DATA__ A2Z669 B5ZC00 P07204_TRBM_HUMAN P20840_SAG1_YEAST
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper; while (my $protein = <DATA>) { chomp $protein; } __DATA__ A2Z669 B5ZC00 P07204_TRBM_HUMAN P20840_SAG1_YEAST
#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper; use LWP::Simple; while (my $protein = <DATA>) { chomp $protein; my $fasta = get("http://www.uniprot.org/uniprot/$protein.fasta"); $fasta =~ s/.*$//m; $fasta =~ s/[ \n]//g; my @matches; while ($fasta =~ /(N[^P][ST][^P])/g) { push @matches, pos($fasta) - 3; pos($fasta) = pos($fasta) - 3; } say "$protein\n@matches" if @matches; } __DATA__ A2Z669 B5ZC00 P07204_TRBM_HUMAN P20840_SAG1_YEAST
$ mprt.pl mprt.in
Oops!
#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper; use LWP::Simple; while (my $protein = <DATA>) { chomp $protein; my $fasta = get("http://www.uniprot.org/uniprot/$protein.fasta"); $fasta =~ s/.*$//m; $fasta =~ s/[ \n]//g; my @matches; while ($fasta =~ /(N[^P][ST][^P])/g) { push @matches, pos($fasta) - 3; pos($fasta) = pos($fasta) - 3; } say "$protein\n@matches" if @matches; } __DATA__ A2Z669 B5ZC00 P07204_TRBM_HUMAN P20840_SAG1_YEAST
#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper; use LWP::Simple; while (my $protein = <>) { chomp $protein; my $fasta = get("http://www.uniprot.org/uniprot/$protein.fasta"); $fasta =~ s/.*$//m; $fasta =~ s/[ \n]//g; my @matches; while ($fasta =~ /(N[^P][ST][^P])/g) { push @matches, pos($fasta) - 3; pos($fasta) = pos($fasta) - 3; } say "$protein\n@matches" if @matches; } __DATA__ A2Z669 B5ZC00 P07204_TRBM_HUMAN P20840_SAG1_YEAST
#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper; use LWP::Simple; *ARGV = *DATA unless @ARGV || ! -t; while (my $protein = <>) { chomp $protein; my $fasta = get("http://www.uniprot.org/uniprot/$protein.fasta"); $fasta =~ s/.*$//m; $fasta =~ s/[ \n]//g; my @matches; while ($fasta =~ /(N[^P][ST][^P])/g) { push @matches, pos($fasta) - 3; pos($fasta) = pos($fasta) - 3; } say "$protein\n@matches" if @matches; } __DATA__ A2Z669 B5ZC00 P07204_TRBM_HUMAN P20840_SAG1_YEAST
#! /usr/bin/perl use warnings; use strict; use feature qw{ say }; use Data::Dumper; use LWP::Simple; use ARGV::OrDATA; while (my $protein = <>) { chomp $protein; my $fasta = get("http://www.uniprot.org/uniprot/$protein.fasta"); $fasta =~ s/.*$//m; $fasta =~ s/[ \n]//g; my @matches; while ($fasta =~ /(N[^P][ST][^P])/g) { push @matches, pos($fasta) - 3; pos($fasta) = pos($fasta) - 3; } say "$protein\n@matches" if @matches; } __DATA__ A2Z669 B5ZC00 P07204_TRBM_HUMAN P20840_SAG1_YEAST
PerlCon | 2019 |