[Bioperl-l] Drawing sequences in the "other" direction
hz5 at njit.edu
hz5 at njit.edu
Mon Jun 20 22:58:30 EDT 2005
Hi Michael,
I have the cooresponding code here, hope it will help:
foreach my $p(@allpanel){
my $tim = GD::Image->new($p->width(), $p->height());
$p->gd($tim);
$gdImg->copy($tim, $0, $hid, 0, 0, $p->width(), $p->height());
$hid += $p->height();
}
my $pngData = $gdImg->png();
haibo
//cheers
Quoting "michael watson (IAH-C)" <michael.watson at bbsrc.ac.uk>:
> Hi Haibo
>
> Sorry, is "copy" a bioperl function or a linux/windows one? I tried
> this using an external linux command, but it had trouble figuring out
> what size the images were
>
> Mick
>
> -----Original Message-----
> From: hz5 at njit.edu [mailto:hz5 at njit.edu]
> Sent: 20 June 2005 03:20
> To: michael watson (IAH-C)
> Cc: bioperl-l at portal.open-bio.org
> Subject: RE: [Bioperl-l] Drawing sequences in the "other" direction
>
>
> Michael,
> This is what I did to solve this problem:
> I will have one panel render +1 seq, then use another panel to render
> the -1
> seq in the "flipped" direction, then use copy to join the 2 panel into
> one
> picture.
>
> haibo
>
> Quoting "michael watson (IAH-C)" <michael.watson at bbsrc.ac.uk>:
>
> >
> >
> > Hi Lincoln, List
> >
> > Yeah, flip works great on the whole panel, but I have my top track
> > which is a genome in the +1 direction, then I want to add another
> > track which is a second genome, aligned to the first, but it runs in
>
> > the -1 direction, I want to flip the second track but not the
> first...
> >
> > Would running through all the features and re-jigging the
> co-ordinates
>
> > of all the features work? I was hoping to avoid it... though I guess
>
> > somewhere buried in the guts of Bio::Graphics::Panel, this code must
>
> > already be written...?
> >
> > Mick
> >
> >
> >
> > -----Original Message-----
> > From: Lincoln Stein [mailto:lstein at cshl.edu]
> > Sent: Sun 19/06/2005 6:12 PM
> > To: bioperl-l at portal.open-bio.org
> > Cc: michael watson (IAH-C)
> > Subject: Re: [Bioperl-l] Drawing sequences in the "other"
> direction
> >
> > Hi Michael,
> >
> > Have you tried passing -flip=>1 to Bio::Graphics::Panel->new()?
> >
> > Lincoln
> >
> > On Tuesday 24 May 2005 08:16 am, michael watson (IAH-C) wrote:
> > > Hi
> > >
> > > I'm trying to draw images of bits of aligned bacterial genomes
> with
> > the
> > > genes marked on as features. Reasonably often a gene in one
> species
> > is
> > > on the +1 strand, and in another species it's on the -1 strand. I
> > want
> > > to draw an image of these genes "aligned", one on top of the
> other,
> > both
> > > facing in the same direction (obviously those that I have flipped
> I
> > will
> > > annotate as such).
> > >
> > > I have been drawing images using Bio::Graphics::Panel and the
> > add_track
> > > method, but I can't figure out how to draw the sequence, and all
> > it's
> > > features, running in the opposite direction. In fact, I doubt
> there
> > is
> > > one unless someone can point it out?
> > >
> > > I did think of drawing them in the right orientation and using the
> > linux
> > > "convert" command to flip the image, but then all the text is
> > backwards!
> > >
> > > Any help appreciated
> > >
> > > Mick
> > >
> > > _______________________________________________
> > > 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
> >
> >
> >
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at portal.open-bio.org
> > http://portal.open-bio.org/mailman/listinfo/bioperl-l
> >
>
>
>
> =========================================================
> Haibo Zhang, PhD
> Computational Biology
> http://www.cyberpostdoc.org/
> Share postdoc information in cyberspace. Welcome your stories,
> suggestions and
> advice!
>
=========================================================
Haibo Zhang, PhD
Computational Biology
http://www.cyberpostdoc.org/
Share postdoc information in cyberspace. Welcome your stories, suggestions and
advice!
More information about the Bioperl-l
mailing list