<?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>生信菜鸟团 &#187; cor.test</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/cor-test/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bio-info-trainee.com</link>
	<description>欢迎去论坛biotrainee.com留言参与讨论，或者关注同名微信公众号biotrainee</description>
	<lastBuildDate>Sat, 28 Jun 2025 14:30:13 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.33</generator>
	<item>
		<title>TCGA表达数据的多项应用之4–求指定基因在指定癌症里面的表达量相关性矩阵，与所有的基因比较。</title>
		<link>http://www.bio-info-trainee.com/2203.html</link>
		<comments>http://www.bio-info-trainee.com/2203.html#comments</comments>
		<pubDate>Wed, 28 Dec 2016 02:10:08 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[cancer]]></category>
		<category><![CDATA[cor.test]]></category>
		<category><![CDATA[correlation]]></category>
		<category><![CDATA[TCGA]]></category>
		<category><![CDATA[表达数据]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=2203</guid>
		<description><![CDATA[这个不出图，会给出TCGA里面涉及到的所有基因跟你指定的基因的表达量相关系数和P &#8230; <a href="http://www.bio-info-trainee.com/2203.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>这个不出图，会给出TCGA里面涉及到的所有基因跟你指定的基因的表达量相关系数和P值，分别你一次性的看清楚你感兴趣的基因跟体内其它基因在该癌症种类的相关性，当然，相关非因果，请谨慎应用！<span id="more-2203"></span></p>
<blockquote>
<div>rm(list=ls())</div>
<div></div>
<div><strong><span style="color: #ff0000;">searchGene = 'TP53';</span></strong></div>
<div><strong><span style="color: #ff0000;">searchTable='tumor_brca_rpkm';</span></strong></div>
<div></div>
<div>library(RMySQL)</div>
<div>con &lt;- dbConnect(MySQL(), host="127.0.0.1", port=3306, user="root", password="11111111")</div>
<div>dbSendQuery(con, "USE gse62944")</div>
<div>dbListTables(con)</div>
<div>query = paste0(' select * from ', searchTable ,' where genesymbol = ',shQuote(searchGene)) ;</div>
<div>expression_1=dbGetQuery(con,query)</div>
<div>expression_1=as.numeric(expression_1[,-1]);</div>
<div></div>
<div>query = paste0(' select geneSymbol from ', searchTable ) ;</div>
<div>allGenes=dbGetQuery(con,query)[,1]</div>
<div><span style="color: #ff0000;">## 重点就是获取这个数据，然后计算相关系数和p值</span></div>
<div><span style="color: #ff0000;">## 这个非常慢，可以考虑加并行，并且显示进度条，当然，这种循环所有的基因我不推荐用mysql来做！！！</span></div>
<div>cor_results &lt;- matrix(unlist(lapply(allGenes, function(x){</div>
<div>  thisGene=x</div>
<div>  query = paste0(' select * from ', searchTable ,' where genesymbol = ',shQuote(thisGene)) ;</div>
<div>  expression_2=dbGetQuery(con,query)</div>
<div>  expression_2=as.numeric(expression_2[,-1]);</div>
<div>  tmp=cor.test(expression_1,expression_2);#str(tmp)</div>
<div>  return(c(thisGene,tmp$estimate,tmp$p.value))</div>
<div>}) ## end for lapply</div>
<div>) ## end for unlist</div>
<div>,ncol = 3, byrow =T) ## end for matrix</div>
</blockquote>
<div></div>
<div></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/2203.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
