[Bioperl-l] Merging fragments in a simplealign
Albert Vilella
avilella at gmail.com
Fri Jan 22 16:04:13 UTC 2010
Is there/should be a 'have_pairwise_overlap' method similar to this?
# $seq1 and $seq3 have matching ids
my $seq1 = $aln->each_seq_by_id($seq1->display_id);
my $seq3 = $aln->each_seq_by_id($seq3->display_id);
my $ret = $aln->have_pairwise_overlap($seq1,$seq3);
On Fri, Jan 22, 2010 at 1:40 PM, Chris Fields <cjfields at illinois.edu> wrote:
> May be something for the cook/scrapbook?
>
> chris
>
> On Jan 22, 2010, at 7:31 AM, Mark A. Jensen wrote:
>
> > Here's one of my favorite tricks for this: XOR mask on gap symbol.
> > MAJ
> >
> > use Bio::SeqIO;
> > use Bio::Seq;
> > use strict;
> > my $seqio = Bio::SeqIO->new( -fh => \*DATA );
> >
> > my $acc = $seqio->next_seq->seq ^ '-';
> > while ($_ = $seqio->next_seq ) {
> > $acc ^= ($_->seq ^ '-');
> > }
> > my $mrg = Bio::Seq->new( -id => 'merged',
> > -seq => $acc ^ '-' );
> > 1;
> >
> >
> > __END__
> >> seq2.234
> > QWERTYU-------------------
> >> seq2.345
> > ----------ASDFGH----------
> >> seq2.456
> > -------------------ZXCVBNM
> >
> > ----- Original Message ----- From: "Albert Vilella" <avilella at gmail.com>
> > To: <bioperl-l at lists.open-bio.org>
> > Sent: Friday, January 22, 2010 8:07 AM
> > Subject: [Bioperl-l] Merging fragments in a simplealign
> >
> >
> >> Hi,
> >> I would like to write a script that merges fragments in a
> Bio::SimpleAlign
> >> object on the basis of
> >> some $seq->display_name rule.
> >> I basically want to start with something like this:
> >> seq1.123 QWERTYUIOPASDFGHJKLZXCVBNM
> >> seq2.234 QWERTYU-------------------
> >> seq2.345 ----------ASDFGH----------
> >> seq2.456 -------------------ZXCVBNM
> >> And end with something like this:
> >> seq1.123 QWERTYUIOPASDFGHJKLZXCVBNM
> >> seq2.mrg QWERTYU---ASDFGH---ZXCVBNM
> >> Can people suggest any Bio::SimpleAlign methods that would help here?
> >> Cheers,
> >> Albert.
> >> _______________________________________________
> >> Bioperl-l mailing list
> >> Bioperl-l at lists.open-bio.org
> >> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> >>
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
More information about the Bioperl-l
mailing list