[Bioperl-l] Merging fragments in a simplealign

Chris Fields cjfields at illinois.edu
Fri Jan 22 19:22:43 UTC 2010


This could exist, but should go into a general Utilities module.  Part of the Align refactoring was to pull a good number of the methods into a general utilities module, so this would fit into that category.

chris

On Jan 22, 2010, at 11:50 AM, Albert Vilella wrote:

> Or to rephrase my answer, what is the closest way for the code below that
> already exists?
> 
> On Fri, Jan 22, 2010 at 4:04 PM, Albert Vilella <avilella at gmail.com> wrote:
> 
>> 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
>>> 
>>> 
>> 
> _______________________________________________
> 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