in reply to Re^2: how to combine these two scripts in perl?
in thread how to combine these two scripts in perl?

If you have unwanted files left over, the solution to that is easy.

# script 1 use strict; use warnings; use Storable; my $storable_file = 'store.file'; $var = complicated multilevel structure; store(\$var,$storable_file); # script 2 use strict; use warnings; use Storable; my $storable_file = 'store.file'; my $var = retrieve($storable_file); unlink $storable_file; open my $outfile,'>','output.file'; print $outfile $var; close $outfile;

Only file created will be output.file.

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Replies are listed 'Best First'.
Re^4: how to combine these two scripts in perl?
by dimitris852 (Acolyte) on Mar 15, 2016 at 16:25 UTC

    please excuse me for the confusion. I edited my previous comment. I have 3 different things in my mind:

    I want to highlight also that  $aln at the last line of the first script has the alignment.

    #I tried at first to pass this alignment to the my $alnio = Bio::AlignIO but didn't succeed it.

    ##My second try was changing  $factory and outputting a file(out_file) from my $factory = Bio::Tools::Run::Alignment::Clustalw->new(-matrix => 'BLOSUM','outfile' => 'out_file','outype'=clustalw); in order to use it in my $alnio = Bio::AlignIO->new('-file'=> 'out_file','-format' => 'clustalw');

    This is what I was searching to do through a variable and not a file

    ###Thrird, now I'm thinking of finding a way to delete the file out_file

    after it is used from

    my $alnio = Bio::AlignIO but seems me not the right way.

      I know nothing about bioinformatics but have you tried using the object returned by ->align in the iterator loop ?

      #!perl my $factory = Bio::Tools::Run::Alignment::Clustalw ->new(-matrix => 'BLOSUM'); . . . my $alnio = $factory->align($seq_array_ref); while( my $aln = $alnio->next_aln ) { . . }
      poj