[Bioperl-l] Fwd: SimpleAlign object

Chris Fields cjfields at illinois.edu
Fri May 22 21:11:11 UTC 2009


It sounds like Mgavi(Lomspace) wants a string alignment to store in a  
database vs the object itself, which Jason already indicated can be  
made via IO::String.  Or did I miss something?

chris

On May 22, 2009, at 11:23 AM, Jason Stajich wrote:

>
> please keep your questions on the list.
> I'm not sure what you want to do - please clarify or maybe someone  
> on the list will help.
>
> Begin forwarded message:
>
>> From: Mgavi Brathwaite <lsbrath at gmail.com>
>> Date: May 22, 2009 7:03:33 AM PDT
>> To: Jason Stajich <jason at bioperl.org>
>> Subject: Re: SimpleAlign object
>>
>> So, if I pass the alignment object to a database table field, when  
>> that
>> table.field is queried
>> will it return the alignment or an object? I want the actual  
>> alignment. I am
>> a little confuse about this.
>>
>> Thanks for your time and help!
>> LomSpace
>>
>>
>> On Thu, May 21, 2009 at 11:51 PM, Jason Stajich <jason at bioperl.org>  
>> wrote:
>>
>>> I'm not sure what you *want* to print in "alignment" section? you  
>>> have the
>>> "actual alignment" as an object. It looks like you already got that
>>> alignment object with get_aln() from your HSP- did you look at the
>>> documentation for that method?  You can also get the query/hit/ 
>>> homology
>>> strings with methods called on the HSP object.  The SearchIO HOWTO  
>>> describes
>>> this.
>>> See Bio::SearchIO::Writer::TextResultWriter if you want to  
>>> reformat a blast
>>> report.
>>>
>>> Or if you want to write it out in a Multiple alignment format  
>>> (multi-fasta,
>>> clustalw, phylip, etc)  with Bio::AlignIO
>>>
>>> You can use IO::String to write the sequence into a string instead  
>>> of to a
>>> file/STDOUT if you want to format things in your script
>>>
>>> my $str = IO::String->new;
>>> my $alnio = Bio::AlignIO->new(-format => 'clustalw', -fh => $str);
>>> $alnio->write_aln($str);
>>> The alignment formatted as a string is now in $str->string_ref so  
>>> you can
>>> access it from ${str->string_ref}
>>>
>>>
>>> On May 21, 2009, at 8:38 PM, Mgavi Brathwaite wrote:
>>>
>>> Hello,
>>>
>>> I am parsing a blast report. My script is returning the following  
>>> output
>>> to file:
>>>
>>> Name: 13414|HD
>>> Percent Identity:  100
>>> Alignment:  Bio::SimpleAlign=HASH(0x40d0ac4)
>>> How do I access " Bio::SimpleAlign=HASH(0x40d0ac4)" actual  
>>> alignment for
>>> this object?
>>>
>>> LomSpace
>>>
>>>
>>> Jason Stajich
>>> jason at bioperl.org
>>>
>>>
>>>
>>>
>>>
>
> Jason Stajich
> jason at bioperl.org
>
>
>
>
> _______________________________________________
> 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