Bijgom has asked for the wisdom of the Perl Monks concerning the following question:
Question: How could I avoid this? Here is my script:Protein sequence:STARTXXXXX Protein Sequence: XXXXXXXXX Protein sequence: XXXXXXEND
Many thanks in advance.use warnings; my %database; my $protein_id = ""; my $line = ""; my $datbase_filename=""; my $start=">DDB"; my $end=""; #input1: open the file containg the protein sequences. print"Please enter the path to the fasta file of protein sequences \n" +; #put the file name into $filenam $database_filename=<STDIN>; #remove newline chomp($database_filename); #open the file containing protein sequences in fasta format open(MYFILE1,"<$database_filename") or die "Unable to open $database_f +ilename: $!\n"; while(<MYFILE1>) { #remove newline chomp; $line=$_; #print "Line i: $_\n"; #test if (($line=~m/^>DDB/) and ($line=~ m/to\s\d+$/)) { $protein_id = $line; #print "protein ID: $protein_id\n";#test } else { $proteins{$protein_id} = $line;# associating the prote +in sequence in my %proteins to its ID print "sequence: $line\n";#test } } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing fasta sequences from Hash
by biohisham (Priest) on Feb 25, 2015 at 03:14 UTC | |
by Bijgom (Initiate) on Feb 25, 2015 at 09:07 UTC | |
|
Re: printing fasta sequences from Hash
by Laurent_R (Canon) on Feb 24, 2015 at 18:46 UTC | |
by AnomalousMonk (Archbishop) on Feb 24, 2015 at 21:28 UTC | |
|
Re: printing fasta sequences from Hash
by kroach (Pilgrim) on Feb 24, 2015 at 21:04 UTC | |
by AnomalousMonk (Archbishop) on Feb 24, 2015 at 21:25 UTC | |
by Bijgom (Initiate) on Feb 24, 2015 at 23:03 UTC |