Re: [R] points marking

From: khush ........ <bioinfo.khush_at_gmail.com>
Date: Wed, 23 Jun 2010 10:02:49 +0530

Hej Gregory,

Thanks for your reply and sorry for late reply, actually I was busy with some other stuff but It helped me alot.
Thanks again sir.

Thanks to both of you.

Thank you
Jeet
On Wed, Jun 16, 2010 at 2:27 AM, Greg Snow <Greg.Snow_at_imail.org> wrote:

> OK, I did not see the website before, here is some code to replicate the
> example shown there (except I donít do 3D effects):
>
>
>
> library(TeachingDemos)
>
>
>
> plot( c(1,1000), c(1,5), type='n', xlab='', ylab='', yaxt='n',
> ylim=c(0.5,5.5) )
>
>
>
> tmpfun <- function( n, col, txt, cex=.5 ) {
>
> plot.window( c(-1,1), c(-1,1) )
>
> ms.filled.polygon( n=n, fg=col, bg=col, adj=0 )
>
> shadowtext(0,0, txt, cex=cex)
>
> }
>
>
>
> lines( c(1,700), c(1,1), col='grey', lwd=3 )
>
>
>
> lines( c(100,100,200,200), c(1,1.25,1.25,1) )
>
>
>
> lines( c(320,320), c(1,1.25), col='red' )
>
> points( 320, 1.25, pch=18, col='red' )
>
>
>
> subplot( tmpfun(400, 'grey15', 'MY'), c(50, 150), c(0.85,1.15) )
>
> subplot( tmpfun(5, 'green', 'DOM'), c(300, 400), c(0.85, 1.15) )
>
>
>
>
>
> Hope this helps get you started (this could all be wrapped into a single
> function if you want, additional proteins can be added at 2, 3, Ö),
>
>
>
> --
>
> Gregory (Greg) L. Snow Ph.D.
>
> Statistical Data Center
>
> Intermountain Healthcare
>
> greg.snow_at_imail.org
>
> 801.408.8111
>
>
>
> *From:* khush ........ [mailto:bioinfo.khush_at_gmail.com]
> *Sent:* Monday, June 14, 2010 11:21 PM
> *To:* Greg Snow
> *Cc:* Petr PIKAL
>
> *Subject:* Re: [R] points marking
>
>
>
> Dear Gregory ,
>
> Thanks for your kind reply, and consideration towards my query, well have
> you check with the link that I sent you the other day (
> http://www.expasy.ch/tools/mydomains/), in which you need to set the
> protein length first and then the domain data, with various shapes i.e 1-6
> and 4 different colors respectively.
>
> In the second part of the example,
>
> 50 ,150 , 2,4, MY
> 300 ,400 , 3,2, DOM
>
> I am drawing all the data with barplots as they are so many so I am using
> barplots, and they are of variuos length, as I mentioned in Dom (has all the
> protein lengths in it), now I wanted to draw various shapes to my data say
> on bar 1 of barplots segments 50-150 has shapes say x and color = red, adn
> its name is MY , and this could repeat for other bars of the plot but with
> different points .
>
> same like other if I want to plot the segments 300-400 with shapes say y
> and color = red and its name should be DOM
>
> I want to make a script which could take the length of the protein and draw
> corresponding domains on it. Hope you understand the way I am explaining you
> now. Please feel free to ask further if needed.
>
>
> Thank you
> Jeet
>
>
> On Mon, Jun 14, 2010 at 9:13 PM, Greg Snow <Greg.Snow_at_imail.org> wrote:
>
> I donít think that I would use a barplot as the base, but rather just set
> up the graph and add the lines where I wanted them. I still donít
> understand what you want your graph to look like, or what question you are
> trying to answer with it (part may be a language barrier). If you can give
> us a better example of what you are trying to accomplish, or a better
> description of what your data is like and what you are trying to get from
> the graph, we will have a better chance of being able to help you.
>
>
>
> --
>
> Gregory (Greg) L. Snow Ph.D.
>
> Statistical Data Center
>
> Intermountain Healthcare
>
> greg.snow_at_imail.org
>
> 801.408.8111
>
>
>
> *From:* khush ........ [mailto:bioinfo.khush_at_gmail.com]
> *Sent:* Saturday, June 12, 2010 5:38 AM
> *To:* Greg Snow
> *Cc:* r-help_at_r-project.org; Petr PIKAL
>
>
> *Subject:* Re: [R] points marking
>
>
>
> Hi,
>
> Well Thanks for letting me know that pch is of no use with segments petr. I
> am using lend as it suits to me more as gregory suggested , but I am not
> getting imite??? think I try to fix it with some other method also, as I
> have to deal more with the symbols in this case, But I want to the know one
> thing from you guys that the way I am using the code is good enough to
> start, as I am not much familiar with this suff or its dirty way to handle
> such task. please let me know.
>
> Thanks gregory and petr.
>
> Thank you
> Jeet
>
>
>
> On Fri, Jun 11, 2010 at 9:07 PM, Greg Snow <Greg.Snow_at_imail.org> wrote:
>
> Those graphs look like chromosome maps, if so, you may want to look into
> the bioconductor project, they may have some prewritten functions to do
> this. If not, the lend argument (see ?par) may be something to look at. If
> you really want points and segments you will need to plot the points with
> the points function and the segments separately. Segments can take vectors,
> so you donít need to separate things into multiple calls.
>
>
>
> --
>
> Gregory (Greg) L. Snow Ph.D.
>
> Statistical Data Center
>
> Intermountain Healthcare
>
> greg.snow_at_imail.org
>
> 801.408.8111
>
>
>
> *From:* khush ........ [mailto:bioinfo.khush_at_gmail.com]
> *Sent:* Friday, June 11, 2010 12:00 AM
> *To:* Greg Snow
> *Cc:* r-help_at_r-project.org
> *Subject:* Re: [R] points marking
>
>
>
> Dear Gregory ,
>
> Thnaks for your reply and help. I am explaining you my problems again,
> below is my script for the same .
>
> Dom <-c (195,568,559)
>
> fkbp <- barplot (Dom, col="black", xlab="", border = NA, space = 7,
> xlim=c(0,650), ylim =c(0, 87), las = 2, horiz = TRUE)
>
> axis (1, at = seq(0,600,10), las =2)
>
> 1. ==============Segments 1=================================
>
> segments(164,7.8,192,7.8, col = "green", pch=23, cex="9", lty="solid",
> lwd=20)
> segments(45,15.8,138,15.8, col = "green", pch=23, cex="9", lty="solid",
> lwd=20)
> segments(160,15.8,255,15.8, col = "green", pch=23, cex="9", lty="solid",
> lwd=20)
> segments(277,15.8,378,15.8, col = "green", pch=23, cex="9", lty="solid",
> lwd=20)
> segments(51,23.8,145,23.8, col = "green", pch=23, cex="9", lty="solid",
> lwd=20)
> segments(167,23.8,262,23.8, col = "green", pch=23, cex="9", lty="solid",
> lwd=20)
> segments(284,23.8,381,23.8, col = "green", pch=23, cex="9", lty="solid",
> lwd=20)
>
> 2. ==============Segments 2 ==================================
> segments(399,15.8,432,15.8, col = "blue", pch=21, cex="9", lty="solid",
> lwd=20)
> segments(448,15.8,475,15.8, col = "blue", pch=21, cex="9", lty="solid",
> lwd=20)
> segments(486,15.8,515,15.8, col = "blue", pch=21, cex="9", lty="solid",
> lwd=20)
> segments(401,23.8,434,23.8, col = "blue", pch=21, cex="9", lty="solid",
> lwd=20)
> segments(450,23.8,475,23.8, col = "blue", pch=21, cex="9", lty="solid",
> lwd=20)
> segments(486,23.8,517,23.8, col = "blue", pch=21, cex="9", lty="solid",
> lwd=20)
>
> I solved one part of my query i.e to mark points from one positions to
> other is ok and I found that its working fine but I have another issue now,
> as I am using using two segments data 1 and 2 , although I want to draw
> different shapes for segmants 2 as I am giving pch=21, but I it seems to
> give a solid line for both. I want to draw different shapes for every chunk
> of segments i.e is the whole point.
>
> I want to make script which can generate such figures, below is link to one
> of the tool.
> http://www.expasy.ch/tools/mydomains/
>
> Thank you
>
> Jeet
>
> On Thu, Jun 10, 2010 at 11:10 PM, Greg Snow <Greg.Snow_at_imail.org> wrote:
>
> Your question is not really clear, do either of these examples do what you
> want?
>
> with(anscombe, plot(x1, y2, ylim=range(y2,y3)) )
> with(anscombe, points(x1, y3, col='blue', pch=2) )
> with(anscombe, segments(x1, y2, x1, y3, col=ifelse( y2>y3, 'green','red')
> ) )
>
>
> with(anscombe, plot(x1, y2, ylim=range(y2,y3), type='n') )
> with(anscombe[order(anscombe$x1),], polygon( c( x1,rev(x1) ), c(y2,
> rev(y3)), col='grey' ) )
>
>
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow_at_imail.org
> 801.408.8111
>
>
>
> > -----Original Message-----
> > From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-
> > project.org] On Behalf Of khush ........
> > Sent: Thursday, June 10, 2010 7:48 AM
> > To: r-help_at_r-project.org
> > Subject: [R] points marking
> >
> > Hi,
> >
> > How to mark points on x axis of a graph keeping x axis as constant and
> > changing y from y1 to y2 respectively. I want to highlight the area
> > from y1
> > to y2.
> >
> > Any suggestions
> >
> > Thank you
> > Jeet
> >
>
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help_at_r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
>
>
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 23 Jun 2010 - 04:35:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jun 2010 - 05:20:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive