[Bioperl-l] Merging fragments in a simplealign
Mark A. Jensen
maj at fortinbras.us
Fri Jan 22 16:02:55 UTC 2010
http://www.bioperl.org/wiki/Merge_gapped_sequences_across_a_common_region
----- Original Message -----
From: "Chris Fields" <cjfields at illinois.edu>
To: "Mark A. Jensen" <maj at fortinbras.us>
Cc: "Albert Vilella" <avilella at gmail.com>; <bioperl-l at lists.open-bio.org>
Sent: Friday, January 22, 2010 8:40 AM
Subject: Re: [Bioperl-l] Merging fragments in a simplealign
> 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