Date: Tue, 31 Mar 2009 16:01:02 -0400
Reply-To: msz03@albany.edu
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: Bar chart with xaxis on both the sides
Content-Type: text/plain;charset=iso-8859-1
hi ... very nice !!!
some suggestion ... if you try ...
* add a POSITION, revert to DATA coordinates fot both x and y (my own 'tweak' for text, take-it-or-leave-it)
Data Anno ;
retain position '8' xsys ysys '2' y 0 function 'label' text 'xx';
Set mbp (keep = mean c) ;
X = round(mean) ;
Text = cat(C);
Run;
and add ...
* make some room at the bottom
footnote1 ls=1;
I think that the x-axis labels get placed a bit better
also ...
symbol1 v=point r=22;
SAS will cycle through the same colors as you get with the 22 SYMBOL statements
and could try ...
symbol1 v=dot r=22;
to fill the areas a bit better
and (minutiae) ...
axis2 label = (angle=90 "-Log10(p)" )
the label is centered without J=C
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> On Tue, 31 Mar 2009 04:27:27 -0700, vrajeshrawal@gmail.com
> <vrajeshrawal@GMAIL.COM> wrote:
>
>>Thanks Kavin. I do nto want the plots for seprate chromosome...All I
>>wanted that lower x axis display genomic position and upper chromosome
>>in manhatten plot
>
> Thanks for the reference to Manhattan plots. That's some deference to the
> Big Apple. It might have been called city skyline plots. Anyway, this
> was an opportunity for me to play with GCHART, which I am using. I
> failed. I am posting my GPLOT suggested approach. I also got to play
> with ANNOTATE more. I am liking ANNOTATE more and more. Below the code,
> I leave some notes:
>
>
> data manhattan ;
>
> bp = 1 ;
>
> do c = 1 to 22 ;
> /* Fake data, but represents the decreasing size of the chromosomes */
> do _n_ = 1 to ( 1e6 - c * 10000 ) - 1 by 1000 ;
> /* Blah: uniform sized chromosomes in the graphs: namely, one unit */
> *bp = c + _n_ / 1e6 ;
> /* Stacked sizes. If part of the chromosome is missing, the size
> may not reflect it. I suggest obtaining the sizes from sites like
> the Marshfield Clinic or NCBI */
> bp + _n_ / 1e6 ;
> logp = -log( ranuni( 2 )) ;
> output ;
> end ;
> end ;
> run ;
>
> proc summary data = manhattan nways ;
> class c ;
> var bp ;
> output out = mbp mean = mean ;
> run ;
>
> Data Anno ;
>
> Set mbp ( keep = mean c ) ;
>
> XSys = "2" ;
> YSys = "3" ;
>
> Y = 2 ;
> X = round( mean ) ;
>
> Function = "Label" ;
> Text = Put( C , 8. -L ) ;
>
> Run ;
>
> goptions reset = all
> ;
>
> symbol1 v = point ;
> symbol2 v = point ;
> symbol3 v = point ;
> symbol4 v = point ;
> symbol5 v = point ;
> symbol6 v = point ;
> symbol7 v = point ;
> symbol8 v = point ;
> symbol9 v = point ;
> symbol10 v = point ;
> symbol11 v = point ;
> symbol12 v = point ;
> symbol13 v = point ;
> symbol14 v = point ;
> symbol15 v = point ;
> symbol16 v = point ;
> symbol17 v = point ;
> symbol18 v = point ;
> symbol19 v = point ;
> symbol20 v = point ;
> symbol21 v = point ;
> symbol22 v = point ;
>
>
> axis1 value = none
> major = none
> minor = none
> label = none
> ;
>
> axis2 label = ( angle = 90 j = c "-Log10(p)" )
> ;
>
> proc gplot data = manhattan ;
> plot logp * bp = c / haxis = axis1
> vaxis = axis2
> vref = 4
> annotate = anno
> nolegend
> ;
> run ;
> quit ;
>
>
> First, this needs a BUNCH of cleaning before it is ready for
> publication/presentation. I had making this look beautiful, not my forte,
> witness my hair.
>
> Notice in MANHATTAN how I constructed the BP (base-pairs). If you want
> the "columns" ("skyscrappers"?) to run together, you have to adjust them.
> Importantly, notice I commented out one expression-the chromosomes sizes
> were made uniform, which they are not.
>
> I potentially did not need the ANNOTATE dataset. Hopefully, those more
> skilled with graphing might offer solutions on how to center the
> chromosome number under the midpoint of the columns (notice that they are
> not now centered well). Including the ANNOTATE datasets, however, gives
> *you* the potential to highlight interesting loci or highlight all of the
> p-values that might be significant (after adjusting for the multiple
> tests). I did not provide code. You will need to include those points
> with a second set statement or by concatenating the datasets.
>
> You can change the colors using the SYMBOL statements; I left all 21 out.
>
> If this is along the lines of what you want, then post back to the list (I
> only access SAS-L through the web and never check this address). A guru
> will help you beautify it as needed.
>
> I attempted to initially using chart to avoid the uniform width and I was
> not sure points versus bar really mattered. Using Group = c and discrete
> caused width problems. I'd be interesting in suggestions concerning this
> issue.
>
> HTH,
>
> Kevin
>
>
|