[Bioperl-l] Again, boxes in heterogenious segments
Marco Aurelio Valtas Cunha
mavcunha at gordon.fmrp.usp.br
Fri Feb 21 09:40:23 EST 2003
Hi all,
I'm replying myself because I'm really in trouble here. We have to decide if
is possible to use Bio::Graphics or not to continue the project, or we have to
develop another way to render the graphics we want. So if somebody has a thought
it will help a lot.
Marco.
Marco Aurelio Valtas Cunha wrote:
> Hi all,
>
> I'm trapped trying to call $graphics->boxes on a heterogeneous_segments
> track, how this is supose to work? How to get the coordenates of
> sub_SeqFeaures?
> Just to add, I'm trying to make a box with some snps in it, instead of
> arrows bellow the box.
> The code is similar to this:
>
> --snip
>
> $gene = Bio::SeqFeature::Generic->new(-primary_tag=> 'region', -start=>
> 0, -end=> 200, -source=>'region');
>
> foreach(@my_snps){
>
> my($snp_name,$coord) = @{$_};
>
> $snp =
> Bio::SeqFeature::Generic->new(-primary_tag=>"$snp_name",-start=>$coord,
> -end=>$coord, -source=>'snp');
>
> $gene->add_sub_SeqFeature($snp);
> }
>
> $graphics = Bio::Graphics::Panel->new(-segment=> $gene, -width=> '200');
> $graphics->add_track( heterogeneous_segments => $gene,
> -fgcolor => \&snp_color,
> -exon_color =>'blue',
> -intron_color =>'red',
> -heigth => 15,
> );
> # Now calling boxes!!
> my @boxes = $graphics->boxes;
>
> # This always print the gene coords...
> print "$_->[0]->primary_tag.$_->[1].$_->[2].$_->[3].$_->[4]\n"
> foreach(@boxes);
>
> exit(0);
> --snip
>
> Marco.
>
--
Marco A Valtas Cunha http://scarecrow.fmrp.usp.br/~mavcunha/
Lab de Bioinformatica http://bit.fmrp.usp.br
Hemocentro de Rib Preto http://ctc.fmrp.usp.br
Fax: 55 16 3963-9309 Tel: 55 16 3963-9300 R:9603
More information about the Bioperl-l
mailing list