Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
this program is not fetching only 2 sequences at a time inside the loop, so when i want to pass only 2 sequences(@first and @second) to subroutine, i get mistakes. please give some suggestions.file1: string11 seq33 string123 seq334 string12 seq32 file2: >string11 AGCTAGCTG CAGAGTC >string123 AGCTGAAGA >string12 AGCGATTATCGA AGCATGAAGACC ACAGCATGACTA file3: >seq32 AGAAGCTCCTAGCT >seq334 AGCTGAAGA AAAGCTAGA >seq33 AGGATTCGA AAATATGA my program: open(FILE1,"file1.txt"); open(FILE2,"file2.txt") open(FILE3,"file3.txt") @ray1=<FILE2>;$join1=("",@ray1);@list1=split(">",$join1); @ray2=<FILE3>;$join2=("",@ray1);@list2=split(">",$join2); while($s=<FILE1>){ ($one,$two)=split("\s+",$s); @first=grep($one,@ray1); @second=grep($two,@ray2); #<ACTION - CALLING SUBROUTINE> #i should have only 2 sequences here for every loop. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: grep the whole element in an array
by perliff (Monk) on Apr 21, 2009 at 08:26 UTC | |
|
Re: grep the whole element in an array
by targetsmart (Curate) on Apr 21, 2009 at 07:31 UTC | |
|
Re: grep the whole element in an array
by Gangabass (Vicar) on Apr 21, 2009 at 07:33 UTC |