Bijgom has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I am new to perl and to this forum...
I would hihly appreciate if anyone could help with the problem I encountered:
In the following script (matching a string +peptide sequence+ to a protein sequence), why at the end when I print the results I cannot see which string (peptide) matches which protein sequence. In practice, when I do: print "found '$peptide' in $test_prot_id\n"; it says : "found '' in blala" (so $peptide remain blank) in other words it reports the protein sequence ID but not the matching string. Thank you in advanvce for your help,
while(<MYFILE2>) { chomp ($_); push(@peptide, $_); #adds each line to an array print "peptides: @peptide\n"; foreach my $test_prot_id (keys %proteins) { my $test_prot_seq = $proteins{$test_prot_id}; if ($test_prot_seq =~/($peptide)/) { print "found $peptide in $test_prot_id\n"; $results{$test_prot_id} ++; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching &printing S variable of an array
by CountZero (Bishop) on Feb 23, 2015 at 17:28 UTC | |
|
Re: matching &printing S variable of an array
by toolic (Bishop) on Feb 23, 2015 at 16:46 UTC | |
|
Re: matching &printing S variable of an array
by FreeBeerReekingMonk (Deacon) on Feb 23, 2015 at 18:36 UTC | |
by Bijgom (Initiate) on Feb 24, 2015 at 08:49 UTC |