<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bioinformatic MA plot in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855295#M338066</link>
    <description>&lt;P&gt;Thank you very much for your response. &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;You already did a lot of for me&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;A column missed, it is the pvalue (table test).&lt;/P&gt;
&lt;P&gt;I obtain a graph but&amp;nbsp; with the pvalue missing, I don't know if it is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here, is a code in R.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generate a plot of log fold change versus mean expression (MA plot)&lt;/P&gt;
&lt;PRE&gt;## S4 method for signature 'data.frame'
plotMA( object, ylim = NULL,
  colNonSig = "gray32", colSig = "red3", colLine = "#ff000080",
  log = "x", cex=0.45, xlab="mean expression", ylab="log fold change", ... )
&lt;/PRE&gt;
&lt;H3&gt;Arguments&lt;/H3&gt;
&lt;TABLE summary="R argblock"&gt;
&lt;TBODY&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;object&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;A &lt;CODE&gt;data.frame&lt;/CODE&gt; with (at least) three columns, the first containing the mean expression values (for the x-axis), the second the logarithmic fold change (for the-y axis) and the third a logical vector indicating significance (for the colouring of the dots).&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;ylim&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The limits for the y-axis. If missing, an attempt is made to choose a sensible value. Dots exceeding the limits will be displayed as triangles at the limits, pointing outwards.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;colNonSig&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;colour to use for non-significant data points.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;colSig&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;colour to use for significant data points.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;colLine&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;colour to use for the horizontal (y=0) line.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;log&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;which axis/axes should be logarithmic; will be passed to &lt;CODE&gt;plot&lt;/CODE&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;cex&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The &lt;CODE&gt;cex&lt;/CODE&gt; parameter for &lt;CODE&gt;plot&lt;/CODE&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;xlab&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The x-axis label.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;ylab&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The y-axis label.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;...&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Further parameters to be passed through to &lt;CODE&gt;plot&lt;/CODE&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Tue, 24 Jan 2023 09:30:40 GMT</pubDate>
    <dc:creator>Nathalie1</dc:creator>
    <dc:date>2023-01-24T09:30:40Z</dc:date>
    <item>
      <title>Bioinformatic MA plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855162#M338006</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I work as beginner in bioinformatics. I must do a MA plot. It is possible with R. But I'm not an experimented user of R.&lt;/P&gt;
&lt;P&gt;Can I realize with SAS ?&lt;/P&gt;
&lt;P&gt;I don't find any response in the community.&lt;/P&gt;
&lt;P&gt;Thank you for help.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 18:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855162#M338006</guid>
      <dc:creator>Nathalie1</dc:creator>
      <dc:date>2023-01-23T18:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Bioinformatic MA plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855165#M338007</link>
      <description>&lt;P&gt;Can you point us to at least an example of an "MA" plot?&lt;/P&gt;
&lt;P&gt;MA is jargon for your field. It may be known as something else to us not in bioinformatics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Be prepared to discuss, as in provide examples, of your data. Dummy data is okay as long as it provides similar information to what you have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 18:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855165#M338007</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-23T18:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Bioinformatic MA plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855172#M338009</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;
&lt;P&gt;The MA plot is on this picture. Axis X = LogCPM (Average Mean) and axis Y = edgemyoFC (Log2 Fold Change).&lt;/P&gt;
&lt;P&gt;I insert a table with the two variables. Each point is a gene.&lt;/P&gt;
&lt;P&gt;I &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MA plot.png" style="width: 531px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79643i0BAC6C0BA27E90E6/image-dimensions/531x366?v=v2" width="531" height="366" role="button" title="MA plot.png" alt="MA plot.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 18:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855172#M338009</guid>
      <dc:creator>Nathalie1</dc:creator>
      <dc:date>2023-01-23T18:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Bioinformatic MA plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855223#M338037</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/358396"&gt;@Nathalie1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you will need a third variable defining the color of the scatter points. Below is an example using an arbitrarily defined variable &lt;FONT face="courier new,courier"&gt;r&lt;/FONT&gt; just for demonstration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/p1lcbd3lhs3t3bn1jk6d8sjt2yqx.htm" target="_blank" rel="noopener"&gt;SCATTER statement&lt;/A&gt; of PROC SGPLOT with &lt;FONT face="courier new,courier"&gt;LogCPM&lt;/FONT&gt; as the x variable, &lt;FONT face="courier new,courier"&gt;edgemyoFC&lt;/FONT&gt; as the y variable and the third variable as the group variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create sample data for demonstration */

data have;
set test;
if n(edgemyofc,logcpm)=2;
length r $4;
r=choosec(sign(round(edgemyofc*exp(logcpm/3)))+2,'Down','None','Up'); /* arbitrary definition */
label logcpm='Average Expression'
      edgemyofc='Log2 Fold Change'
      r='Regulated';
run;

proc sort data=have;
by r;
run;

title 'Average Expression vs. Log2 Fold Change';

proc sgplot data=have;
styleattrs datacontrastcolors=(lime gray red);
scatter x=logcpm y=edgemyofc / group=r markerattrs=(symbol=circlefilled size=5pt);
keylegend / position=right noborder valueattrs=(size=8);
run;

title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 21:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855223#M338037</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-01-23T21:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Bioinformatic MA plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855295#M338066</link>
      <description>&lt;P&gt;Thank you very much for your response. &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;You already did a lot of for me&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;A column missed, it is the pvalue (table test).&lt;/P&gt;
&lt;P&gt;I obtain a graph but&amp;nbsp; with the pvalue missing, I don't know if it is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here, is a code in R.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generate a plot of log fold change versus mean expression (MA plot)&lt;/P&gt;
&lt;PRE&gt;## S4 method for signature 'data.frame'
plotMA( object, ylim = NULL,
  colNonSig = "gray32", colSig = "red3", colLine = "#ff000080",
  log = "x", cex=0.45, xlab="mean expression", ylab="log fold change", ... )
&lt;/PRE&gt;
&lt;H3&gt;Arguments&lt;/H3&gt;
&lt;TABLE summary="R argblock"&gt;
&lt;TBODY&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;object&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;A &lt;CODE&gt;data.frame&lt;/CODE&gt; with (at least) three columns, the first containing the mean expression values (for the x-axis), the second the logarithmic fold change (for the-y axis) and the third a logical vector indicating significance (for the colouring of the dots).&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;ylim&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The limits for the y-axis. If missing, an attempt is made to choose a sensible value. Dots exceeding the limits will be displayed as triangles at the limits, pointing outwards.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;colNonSig&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;colour to use for non-significant data points.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;colSig&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;colour to use for significant data points.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;colLine&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;colour to use for the horizontal (y=0) line.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;log&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;which axis/axes should be logarithmic; will be passed to &lt;CODE&gt;plot&lt;/CODE&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;cex&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The &lt;CODE&gt;cex&lt;/CODE&gt; parameter for &lt;CODE&gt;plot&lt;/CODE&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;xlab&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The x-axis label.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;ylab&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;The y-axis label.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR valign="top"&gt;
&lt;TD&gt;&lt;CODE&gt;...&lt;/CODE&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Further parameters to be passed through to &lt;CODE&gt;plot&lt;/CODE&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 24 Jan 2023 09:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855295#M338066</guid>
      <dc:creator>Nathalie1</dc:creator>
      <dc:date>2023-01-24T09:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Bioinformatic MA plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855296#M338067</link>
      <description>&lt;P&gt;Thanks for providing the missing third variable. It is not obvious (at least to me) what values of &lt;FONT face="courier new,courier"&gt;edgemyoPV&lt;/FONT&gt;&amp;nbsp;indicate "significance", because -- contrary to my expectations --&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;edgemyoPV&lt;/FONT&gt;&amp;nbsp;takes values from 0 to 74.4 with a mean of 2.3&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;edgemyoPV&lt;/FONT&gt;&amp;nbsp;has a significant &lt;EM&gt;positive&lt;/EM&gt; correlation with the absolute value of &lt;FONT face="courier new,courier"&gt;edgemyoFC&lt;/FONT&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;But once you know the criterion for "significant"&amp;nbsp;&lt;FONT face="courier new,courier"&gt;edgemyoPV&lt;/FONT&gt; values, the implementation is easy: Just replace the assignment statement &lt;FONT face="courier new,courier"&gt;r=choosec(...)&lt;/FONT&gt; in my suggested DATA step by&lt;/P&gt;
&lt;PRE&gt;if &lt;FONT color="#993366"&gt;&lt;EM&gt;criterion for significant edgemyoPV&lt;/EM&gt;&lt;/FONT&gt;
then r=choosec(sign(edgemyofc)+2,'Down','None','Up');
else r='None';&lt;/PRE&gt;
&lt;P&gt;where "&lt;FONT color="#993366"&gt;&lt;EM&gt;&lt;FONT face="courier new,courier"&gt;criterion for significant edgemyoPV&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&amp;nbsp;" stands for a logical expression involving &lt;FONT face="courier new,courier"&gt;edgemyoPV&lt;/FONT&gt;, for example&amp;nbsp;&lt;FONT face="courier new,courier"&gt;edgemyoPV&amp;gt;=1&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Edit: Made the definition of &lt;FONT face="courier new,courier"&gt;r&lt;/FONT&gt;&amp;nbsp;more similar to the earlier suggestion.)&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 11:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855296#M338067</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-01-24T11:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Bioinformatic MA plot</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855303#M338070</link>
      <description>Thank you very much for your help. It is OK for me.</description>
      <pubDate>Tue, 24 Jan 2023 11:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bioinformatic-MA-plot/m-p/855303#M338070</guid>
      <dc:creator>Nathalie1</dc:creator>
      <dc:date>2023-01-24T11:51:06Z</dc:date>
    </item>
  </channel>
</rss>

