[Bioperl-l] Arrays of BioSeq and TCoffee

Jason Stajich jason@cgt.mc.duke.edu
Thu Jan 16 20:28:14 EST 2003


On Thu, 16 Jan 2003, James Wasmuth wrote:

> Hi people,
>
> I have a number of fasta format sequences in one string, which I wish to
> align using T-Coffee, without writing the sequences to a file first.
>
> According to doc for T-Coffee module, the align method will take a
> filename or an array of references for Bio::Seq objects...
>
> I've tried the following script but it fails, I am informed that the
> first Bio::Seq object contains less than 2 sequences.  Well of course it
> does, its a Bio::Seq object...  Can anyone see my error...
>

> my @fasta_seq = qw/  >seq1\nFTTATT  >seq2\nFTTGTT  >seq3\nFTATTT /;
> my @seq;
> foreach (@fasta_seq)    {
>         my $stringfh = new IO::String($_);
>         my $seqio = new Bio::SeqIO(-fh => $stringfh, -format => 'fasta');
>         push @seq ($seqio_obj->next_seq);
>     }
> # here I know that @seq is an array of Bio::Seq objects
>
Ye gods, that is scary
It would seem simplier to me


my $fastaseq =<<EOF
>seq1
TTACATA
>seq2
TGACCAT
>seq3
ATAGT
EOF
;

my $iostring = new IO::String($fastaseq);
my $seqio = new Bio::SeqIO(-fh => $stringfh,-format =>'fasta');
my @seq;
while( my $seq = $seqio->next_seq) { push @seq,$seq }



> my @params = (some params);
> my $factory = new Bio::Tools::Run::Alignment::TCoffee (@params);
> my $aln = $factory->align(@seq);
>
You want an array reference here:
my $aln = $factory->align(\@seq);

I think this is in the docs though...

>
> Can a Bio::Seq object hold more than one sequence? Is that my problem
>
> Many Thanks
>
> J
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu



More information about the Bioperl-l mailing list