Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: how can I combine into one method

by thunders (Priest)
on May 05, 2009 at 17:53 UTC ( #761996=note: print w/replies, xml ) Need Help??

in reply to how can I combine into one method

I think you want something more like this. I'm guessing a little on some of the code. Otherwise I factored out all the common code, which as far as I can tell is everything but the url.
sub blast_hu_parse { my($maid,$maid_dir) = @_; my $url_hu = "http://hu_seq/"; blast_parse($maid,$maid_dir,$url_hu); } sub blast_hd_parse { my($maid,$maid_dir) = @_; my $url_hd = "http://hd_seq/"; blast_parse($maid,$maid_dir,$url_hd); } sub blast_parse{ my($maid,$maid_dir,$url) = @_; my $h_file = get($url.$maid); my $ltvec_small = $maid_dir.$maid."Ltvec_small.fa"; #what is $hu where is it declared? #open ($hu); #what is $in where is it declared my $seq=<$in>; close($in); open (my $hu, ">".$maid.".fa"); print $hu ">$maid\n$seq"; close($hu); # syntax # bl2seq -p blastn -i nucleotide1 -j nucleotide2 -F F -D 1 my $command = "bl2seq -p blastn -i $ltvec_small -j $h_file -F F -D + +1"; print $command,"\n"; open OUTPUT, '>', "$maid_dir\\".$maid."_bl2seq.out" ; STDOUT->fdopen( \*OUTPUT, 'w'); system($command); bl2seq_parse(); }

update added some comment on the file handling stuff, which appears to have some errors, after looking over the original again

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://761996]
[robby_dobby]: What's the site for YAPC::EU?
[LanX]: Robby Dobby no IIRC Sinai is already part of Asia
[robby_dobby]: page for yapceu is out of date by 2 years
[robby_dobby]: LanX: Sharm-el-Sheikh is in Egypt
[robby_dobby]: Thanks, choroba
[LanX]: yes and Egypt (like Turkey and Russia) belongs to two continents
[choroba]: Also Europe and Asia are geographically one continent, the division is political
[robby_dobby]: I always thought everything on the other side of Suez to be Africa. That's an entire continent
[LanX]: Sinai_Peninsula

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2017-04-24 16:02 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (442 votes). Check out past polls.