lomSpace has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks!
I need some help to get me rolling on how to best combine
two methods into one for the sake of generalizing the code for
reuse.
I need some help to get me rolling on how to best combine
two methods into one for the sake of generalizing the code for
reuse.
Your wisdom is always acknowledged!sub blast_parse{ my($maid,$maid_dir) = @_; my $url_hu = "http://hu_seq/"; my $hu = get($url_hu.$maid); my $ltvec_small = $maid_dir.$maid."Ltvec_small.fa"; #=cut # convert the raw sequence to fasta open ($hu); my $seq=<$in>; close($in); open ($hu, ">".$maid.".fa"); print $hu_fa ">$maid\n$seq"; close($hu_fa); #=cut # syntax # bl2seq -p blastn -i nucleotide1 -j nucleotide2 -F F -D 1 my $command = "bl2seq -p blastn -i $ltvec_small -j $hu_fa -F F -D +1"; print $command,"\n"; open OUTPUT, '>', "$maid_dir\\".$maid."_bl2seq.out" ; STDOUT->fdopen( \*OUTPUT, 'w'); system($command); bl2seq_parse(); } # the next method sub blast_hd_parse{ my($maid,$maid_dir) = @_; my $url_hd = "http://hd_seq/"; my $hd = get($url_hd.$maid); my $ltvec_small = $maid_dir.$maid."Ltvec_small.fa"; # convert the raw sequence to fasta open ($hu); my $seq=<$in>; close($in); open ($hu, ">".$maid.".fa"); print $hu_fa ">$maid\n$seq"; close($hu_fa); my $command = "bl2seq -p blastn -i $ltvec_small -j $hd_fa -F F -D +1"; print $command,"\n"; open OUTPUT, '>', "$maid_dir\\".$maid."_bl2seq.out" ; STDOUT->fdopen( \*OUTPUT, 'w'); system($command); bl2seq_parse(); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how can I combine into one method
by gwadej (Chaplain) on May 05, 2009 at 17:28 UTC | |
Re: how can I combine into one method
by roboticus (Chancellor) on May 05, 2009 at 18:03 UTC | |
by lomSpace (Scribe) on May 05, 2009 at 18:33 UTC | |
Re: how can I combine into one method
by moritz (Cardinal) on May 05, 2009 at 18:09 UTC | |
Re: how can I combine into one method
by thunders (Priest) on May 05, 2009 at 17:53 UTC | |
Re: how can I combine into one method
by AnomalousMonk (Archbishop) on May 05, 2009 at 17:46 UTC |
Back to
Seekers of Perl Wisdom