[Bioperl-l] how not to use Files when file handlers are required
Guoneng Zhong
Guoneng.Zhong@med.nyu.edu
Tue, 19 Feb 2002 09:34:37 -0500
--Apple-Mail-1--685143998
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
Hi,
I am starting to use Bioperl and I notice that often files are used as
keepers of sequences and reports. Either a file name is supplied as
input or some file handler is required for input or output. Case in
point is the following example I copied from the tutorial:
use Bio::Tools::pSW;
$factory = new Bio::Tools::pSW( '-matrix' => 'blosum62.bla',
'-gap' => 12,
'-ext' => 2, );
$factory->align_and_show($seq1, $seq2, STDOUT);
$aln = $factory->pairwise_alignment($seq1, $seq2);
My problem is that I don't work with files very much; I get my sequence
either from someone's website or from a database. So in the above
example, how would I supply the matrix as a string if I don't have a
file? Do I have to write the string to a file first and then tell it?
Same for the STDOUT; what if I want to use a String instead? I come
from a java background, and it has a String IO Stream reader/writer. I
wonder in Perl there is something like that or if Bioperl accommodates
for this.
Thanks,
Guoneng
--Apple-Mail-1--685143998
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
charset=US-ASCII
Hi,
I am starting to use Bioperl and I notice that often files are used as
keepers of sequences and reports. Either a file name is supplied as
input or some file handler is required for input or output. Case in
point is the following example I copied from the tutorial:
<fixed><fontfamily><param>Courier New</param>use Bio::Tools::pSW;
$factory = new Bio::Tools::pSW( '-matrix' => 'blosum62.bla',
'-gap' => 12,
'-ext' => 2, );
$factory->align_and_show($seq1, $seq2, STDOUT);
$aln = $factory->pairwise_alignment($seq1, $seq2);</fontfamily></fixed>
My problem is that I don't work with files very much; I get my
sequence either from someone's website or from a database. So in the
above example, how would I supply the matrix as a string if I don't
have a file? Do I have to write the string to a file first and then
tell it? Same for the STDOUT; what if I want to use a String instead?
I come from a java background, and it has a String IO Stream
reader/writer. I wonder in Perl there is something like that or if
Bioperl accommodates for this.
Thanks,
Guoneng
--Apple-Mail-1--685143998--