[Bioperl-l] BIO::SearchIO HOWTO mistake?

Jason Stajich jason.stajich at duke.edu
Sun Jan 15 10:59:36 EST 2006


If you read the documentation for the seq_inds method you'll see the  
following options, I think you want conserved-not-identical.

Title             : seq_inds
Purpose     : Get a list of residue positions (indices) for all  
identical
                     : or conserved residues in the query or sbjct  
sequence.
  Example   : @s_ind = $hsp->seq_inds('query', 'identical');
                     : @h_ind = $hsp->seq_inds('hit', 'conserved');
                     : @h_ind = $hsp->seq_inds('hit', 'conserved-not- 
identical');
                     : @h_ind = $hsp->seq_inds('hit', 'conserved', 1);
Returns      : List of integers
                     : May include ranges if collapse is true.
Argument  : seq_type  = 'query' or 'hit' or 'sbjct'  (default = query)
                     :  ('sbjct' is synonymous with 'hit')
                     : class     = 'identical' or 'conserved' or  
'nomatch' or 'gap'
                     :              (default = identical)
                     :              (can be shortened to 'id' or 'cons')
                     :             or 'conserved-not-identical'
                     : collapse  = boolean, if true, consecutive  
positions are merged
                     :             using a range notation, e.g., "1 2  
3 4 5 7 9 10 11"
                     :             collapses to "1-5 7 9-11". This is  
useful for
                     :             consolidating long lists. Default  
= no collapse.
Throws    : n/a.
Comments  :


On Jan 14, 2006, at 11:50 AM, Anders Stegmann wrote:

> Hi!
>
> According to the Bio::SearchIO HOWTO this,
>
> $hsp->seq_inds('hit', 'conserved');
>
> should fetch ONLY the conserved residues in an alignment (not those
> identical).
>
> When I use:
>
> sub subject_seq_alignment_conserved_residues {
>
> my ($hsp_obj) = @_;
> my %subject_conserved_hash = ();
>
> my @subject_string = split , $$hsp_obj->hit_string;
>
> foreach ($$hsp_obj->seq_inds('hit', 'conserved')) {
>
> $subject_conserved_hash{$_} = $subject_string[$_ -1];
>
> }
>
> return %subject_conserved_hash;
>
> }
>
>
>
> I get all residues in the alignment inclusive those that are  
> identical!
>
> What's wrong?
>
> If the Bio::SearchIO HOWTO is wrong about this, is there an easy  
> way to
> fetch only the conserved residues?
>
> Anders.
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
Duke University
http://www.duke.edu/~jes12




More information about the Bioperl-l mailing list