[Bioperl-l] Bio::DB::GFF::Segment trouble

Lincoln Stein lstein at cshl.edu
Thu Mar 11 13:08:10 EST 2004


Hi,

This is a very slight misconception.  You need to use the "contains" 
range type.  The range type is relative to the viewpoint of the 
segment.  You are looking for the features that the segment contains.  
The contained_in relationship works the other way around, and will 
find features that completely contain the segment.

Looking at your output, the contained_in relationship doesn't appear 
to be working properly, however.  I wonder which database adaptor you 
are using?

The target information is a special method called target().  It is not 
treated as an ordinary tag.

Lincoln

On Thursday 11 March 2004 12:21 pm, Rhazes Spell wrote:
> I am having trouble getting a list of features from a segment in my
> database.  I can pull out all of the features, but I can not limit
> the features returned to a specific range.  Following is a code
> excerpt and output.  Any assistance that you can provide would be
> great!
>
> CODE:
> my @segment = $db->segment(-name => 'amata',
> 			   -start => 1,
> 			   -end => 40000);
>
> foreach my $segment (@segment) {
>      my($start,$end) = ($segment->start,$segment->end);
>
> #Some debug info cuz I don't get it yet
>
>      print "\n*** Segment= ",$segment->asString();
>      print " Seg Source= ",$segment->sourceseq,"\t";
>      print "Reference= ",$segment->ref,"\t";
>      print "Abs Start= ",$segment->abs_start," :: ";
>      print "Abs End= ", $segment->abs_end,"\n";
>
> #Change the coordinate system to absolute if necessary
>      $segment->absolute(1) if (!($segment->sourceseq eq
> $segment->ref)); my @f = $segment->features(-types =>
> ['similarity:blastn'], -rangetype => 'contained_in');
>
>      foreach my $feat (@f) {
> 	print "\n\t",$feat->gff_string(),"\n";
> 	print "-Target == ";
> 	foreach ($feat->get_tag_values("Target")) {
> 	    print $_;
> 	}
> 	print "\n-description == ";
> 	foreach ($feat->get_tag_values("description")) {
> 	    print $_,"\n";
> 	}
>      }
> }
>
> OUTPUT:: (## = Added comment)
>
> *** Segment= amata:1,40000 Seg Source= amata    Reference= amata
> Abs Start= 1 :: Abs End= 40000
> ##This is the main segment and it should not have any blast
> similarities.
>
> *** Segment= amata:1,40000 Seg Source= amatalpha        Reference=
> amata        Abs Start= 14584 :: Abs End= 54583
> ## These are blast hits that have a hit on my segment.  I only want
> the hits that occur between 1 and 40000 on
> ##  the segment, amata
> ##  I have 2 questions:
> ## 1: Why are there any hits included with 'Target "Sequence:amata"
> start stop' where start or start is > 40000?
> ## 2: Why can't I access the members of the Target attribute tag as
> I can the description tag.
> ## Output follows
>
>
>          amatalpha       blastn  similarity      14584   14713
> 0.832061        +       .       Target "Sequence:a
> mata" 41056 41186 ; description "upstream of CAP1 - downstream of
> CAP1" -Target ==
> -description == upstream of CAP1 - downstream of CAP1
>
>          amatalpha       blastn  similarity      18722   18774
> 0.907407        +       .       Target "Sequence:a
> mata" 33568 33621 ; description "downstream of SPO14 - downstream
> of SPO14"
> -Target ==
> -description == downstream of SPO14 - downstream of SPO14
>
>          amatalpha       blastn  similarity      19199   19283
> 0.905882        +       .       Target "Sequence:a
> mata" 34087 34171 ; description "downstream of SPO14 - downstream
> of SPO14"
> -Target ==
> -description == downstream of SPO14 - downstream of SPO14
>
>          amatalpha       blastn  similarity      24823   24922  
> 0.83 +       .       Target "Sequence:amata" 39
> 695 39794 ; description "upstream of RPL22 - downstream of CAP1"
> -Target ==
> -description == upstream of RPL22 - downstream of CAP1
>
>          amatalpha       blastn  similarity      25099   25150
> 0.923077        +       .       Target "Sequence:a
> mata" 39971 40022 ; description "upstream of RPL22 - downstream of
> CAP1" -Target ==
> -description == upstream of RPL22 - downstream of CAP1
>
>
>
> Thanks,
> Rhazes
>
> **************************************
> Duke University
> Department of Biomedical Engineering
> Duke University Medical Center,
>   Center for Genome Technology
>
> 919.684.2720 (lab)
> ***************************************
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l

-- 
Lincoln D. Stein
Cold Spring Harbor Laboratory
1 Bungtown Road
Cold Spring Harbor, NY 11724
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20040311/b4ca293d/attachment.bin


More information about the Bioperl-l mailing list