<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Autarchy of the Private Cave &#187; Affymetrix</title> <atom:link href="https://bogdan.org.ua/tags/affymetrix/feed" rel="self" type="application/rss+xml" /><link>https://bogdan.org.ua</link> <description>Tiny bits of bioinformatics, [web-]programming etc</description> <lastBuildDate>Wed, 28 Dec 2022 16:09:04 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=3.8.27</generator> <item><title>R script to filter probesets with log-expression values below the lowest spike-in</title><link>https://bogdan.org.ua/2010/01/27/r-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html</link> <comments>https://bogdan.org.ua/2010/01/27/r-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html#comments</comments> <pubDate>Wed, 27 Jan 2010 12:44:02 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[Bioinformatics]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Science]]></category> <category><![CDATA[Affymetrix]]></category> <category><![CDATA[filter]]></category> <category><![CDATA[log-expression]]></category> <category><![CDATA[microarray]]></category> <category><![CDATA[probeset]]></category> <category><![CDATA[R]]></category> <category><![CDATA[spike-in]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=985</guid> <description><![CDATA[Sometimes there is a need to remove all the probesets, which have expression values below the minimal spike-in intensity on the Affymetrix microarray. The reasoning behind this procedure is simple: minimal-expression spike-ins represent the bottom margin of microarray sensitivity, and anything below that margin cannot be reliably quantified &#8211; which also means that both fold-change [&#8230;]]]></description> <content:encoded><![CDATA[<p>Sometimes there is a need to remove all the probesets, which have expression values below the minimal spike-in intensity on the <a
href="http://www.affymetrix.com/">Affymetrix</a> microarray. The reasoning behind this procedure is simple: minimal-expression spike-ins represent the bottom margin of microarray sensitivity, and anything below that margin cannot be reliably quantified &#8211; which also means that both fold-change and p-value of expression variance will be unreliable for these probesets.</p><p>Here&#8217;s a simple <a
href="http://www.r-project.org/">R</a> script to do just that. It is abundantly commented, and also contains an optional (commented out) fragment which allows the removal of more low-variance, low-intensity probesets.</p><p><span
id="more-985"></span><br
/> <em>Hint: click the &#8220;plain text&#8221; box header to be able to right-click the code, &#8220;Select All&#8221;, and then &#8220;Copy&#8221;.</em><br
/> [CODE]<br
/> filter_below_spikes = function(eset) {<br
/> # Finds max(lowest) AFFX/spike-in intensity, and removes rows consisting entirely of values below max(lowest).<br
/> # @param eset<br
/> # ExpressionSet<br
/> # @returns<br
/> # exprs(ExpressionSet), filtered</p><p> # Without Biobase exprs() will not work.<br
/> require(Biobase)<br
/> expr = exprs(eset)</p><p> # &#8216;expr&#8217; sample:<br
/> #                  1<br
/> # 1367452_at 10.880208<br
/> # 1367453_at 10.554647</p><p> cat(nrow(expr), &#8220;rows before filtering.\n&#8221;)</p><p> # Make a vector of spike row names.<br
/> spikes = grep(&#8220;AFFX&#8221;, rownames(expr), value = TRUE)<br
/> cat(&#8220;Expression matrix has&#8221;, length(spikes), &#8220;spike-in rows.\n&#8221;)<br
/> cat(&#8220;Summary of spike-in values distribution follows:\n&#8221;)<br
/> print(summary(expr[spikes, ]))</p><p> # Find max(lowest) spike-in values.<br
/> minval_max = max(as.double(substr(grep(&#8220;Min&#8221;, summary(expr[spikes, ]), value = TRUE), 10, 14)))<br
/> cat(&#8220;max(minimal spike-in log-intensity values) =&#8221;, minval_max, &#8220;\n&#8221;)</p><p> # Remove spike-ins from expr.<br
/> expr = expr[grep("AFFX", rownames(expr), value = TRUE, invert = TRUE), ]</p><p> nospike_rows = nrow(expr)<br
/> cat(nospike_rows, &#8220;rows remaining after the removal of&#8221;, length(spikes), &#8220;spike-in probesets.\n&#8221;)</p><p> # Optional: calculate max(SD) of all removed rows.<br
/> #bad_sds_max = max(apply(expr[!apply((expr > minval_max), 1, any),], 1, sd))</p><p> # Now remove all rows, where each value is <= minval_max.
expr = expr[!apply((expr <= minval_max), 1, all), ]
cat(nrow(expr), "rows remaining after filtering out", nospike_rows - nrow(expr), "probesets with all values below", minval_max, "\n")
#cat(bad_sds_max, "is max(SD) of all", nospike_rows - nrow(expr), "filtered probesets with all values below", minval_max, "\n")
# Optional: Remove *some* of the rows, which have at least one value below minval_max, and row_SD <= bad_sds_max.
#pre_final_rows = nrow(expr)
#expr = expr[(apply(expr, 1, sd) > bad_sds_max) | (apply(expr, 1, min) > minval_max), ]<br
/> #cat(pre_final_rows-nrow(expr), &#8220;rows with SD <=", bad_sds_max, "and min(row) <=", minval_max, "were removed.\n")
#cat(nrow(expr), "final rows returned.\n")
return(expr)
}
[/CODE]
Sample use:<blockquote> > source(&#8220;script.R&#8221;)<br
/> > expr.filtered = filter_below_spikes(eset)</p></blockquote><p>Comments and suggestions are welcome.</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F27%2Fr-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html&amp;linkname=R%20script%20to%20filter%20probesets%20with%20log-expression%20values%20below%20the%20lowest%20spike-in" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F27%2Fr-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html&amp;linkname=R%20script%20to%20filter%20probesets%20with%20log-expression%20values%20below%20the%20lowest%20spike-in" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F27%2Fr-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html&amp;linkname=R%20script%20to%20filter%20probesets%20with%20log-expression%20values%20below%20the%20lowest%20spike-in" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F27%2Fr-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html&amp;linkname=R%20script%20to%20filter%20probesets%20with%20log-expression%20values%20below%20the%20lowest%20spike-in" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F27%2Fr-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html&amp;linkname=R%20script%20to%20filter%20probesets%20with%20log-expression%20values%20below%20the%20lowest%20spike-in" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2010%2F01%2F27%2Fr-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html&#038;title=R%20script%20to%20filter%20probesets%20with%20log-expression%20values%20below%20the%20lowest%20spike-in" data-a2a-url="https://bogdan.org.ua/2010/01/27/r-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html" data-a2a-title="R script to filter probesets with log-expression values below the lowest spike-in"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2010/01/27/r-script-to-filter-probesets-with-log-expression-values-below-the-lowest-spike-in.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to create custom Affymetrix CDF file</title><link>https://bogdan.org.ua/2009/03/23/how-to-create-custom-affymetrix-cdf-file.html</link> <comments>https://bogdan.org.ua/2009/03/23/how-to-create-custom-affymetrix-cdf-file.html#comments</comments> <pubDate>Mon, 23 Mar 2009 12:01:41 +0000</pubDate> <dc:creator><![CDATA[Bogdan]]></dc:creator> <category><![CDATA[how-to]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Science]]></category> <category><![CDATA[affy]]></category> <category><![CDATA[Affymetrix]]></category> <category><![CDATA[annotation]]></category> <category><![CDATA[CDF]]></category> <category><![CDATA[R]]></category> <guid
isPermaLink="false">http://bogdan.org.ua/?p=631</guid> <description><![CDATA[First, learn about custom CDFs and why they are needed. The aroma.affymetrix R package google group has a how-to: create a CDF annotation file from scratch. Also useful: how to convert CDF into an R package, which has all CDF data available (as a PDF with more details).]]></description> <content:encoded><![CDATA[<p>First, learn about <a
href="http://brainarray.mbni.med.umich.edu/Brainarray/Database/CustomCDF/cdfreadme.htm#Reasons_for_generating_custom_CDF_files_for_Affymetrix_GeneChips_">custom <abbr
title="Chip Description File">CDF</abbr>s</a> and why they are needed.</p><p>The <a
href="http://groups.google.com/group/aroma-affymetrix">aroma.affymetrix R package</a> google group has a <a
href="http://aroma-project.org/node/40" class="broken_link" rel="nofollow">how-to: create a CDF annotation file from scratch</a>.</p><p>Also useful: <a
href="http://rss.acs.unt.edu/Rdoc/library/makecdfenv/html/make.cdf.package.html" class="broken_link" rel="nofollow">how to convert CDF into an R package</a>, which has all CDF data available (as a PDF with <a
href="http://www.bioconductor.org/packages/2.3/bioc/vignettes/makecdfenv/inst/doc/makecdfenv.pdf">more details</a>).</p><p><a
class="a2a_button_citeulike" href="https://www.addtoany.com/add_to/citeulike?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F23%2Fhow-to-create-custom-affymetrix-cdf-file.html&amp;linkname=How%20to%20create%20custom%20Affymetrix%20CDF%20file" title="CiteULike" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F23%2Fhow-to-create-custom-affymetrix-cdf-file.html&amp;linkname=How%20to%20create%20custom%20Affymetrix%20CDF%20file" title="Pocket" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_kindle_it" href="https://www.addtoany.com/add_to/kindle_it?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F23%2Fhow-to-create-custom-affymetrix-cdf-file.html&amp;linkname=How%20to%20create%20custom%20Affymetrix%20CDF%20file" title="Kindle It" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_evernote" href="https://www.addtoany.com/add_to/evernote?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F23%2Fhow-to-create-custom-affymetrix-cdf-file.html&amp;linkname=How%20to%20create%20custom%20Affymetrix%20CDF%20file" title="Evernote" rel="nofollow noopener" target="_blank"></a><a
class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F23%2Fhow-to-create-custom-affymetrix-cdf-file.html&amp;linkname=How%20to%20create%20custom%20Affymetrix%20CDF%20file" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a
class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fbogdan.org.ua%2F2009%2F03%2F23%2Fhow-to-create-custom-affymetrix-cdf-file.html&#038;title=How%20to%20create%20custom%20Affymetrix%20CDF%20file" data-a2a-url="https://bogdan.org.ua/2009/03/23/how-to-create-custom-affymetrix-cdf-file.html" data-a2a-title="How to create custom Affymetrix CDF file"><img
src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded> <wfw:commentRss>https://bogdan.org.ua/2009/03/23/how-to-create-custom-affymetrix-cdf-file.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>