<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://statgen.us/index.php?action=history&amp;feed=atom&amp;title=GWAS_Controlling_for_Population_Substructure</id>
		<title>GWAS Controlling for Population Substructure - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://statgen.us/index.php?action=history&amp;feed=atom&amp;title=GWAS_Controlling_for_Population_Substructure"/>
		<link rel="alternate" type="text/html" href="http://statgen.us/index.php?title=GWAS_Controlling_for_Population_Substructure&amp;action=history"/>
		<updated>2026-04-05T20:08:10Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://statgen.us/index.php?title=GWAS_Controlling_for_Population_Substructure&amp;diff=622&amp;oldid=prev</id>
		<title>Zhihuiz at 15:35, 7 June 2018</title>
		<link rel="alternate" type="text/html" href="http://statgen.us/index.php?title=GWAS_Controlling_for_Population_Substructure&amp;diff=622&amp;oldid=prev"/>
				<updated>2018-06-07T15:35:08Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:35, 7 June 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__NOTITLE__&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==GWAS Controlling for Population Substructure==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;plink --file GWAS_clean4 --genome --cluster --mds-plot 10&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;plink --file GWAS_clean4 --genome --cluster --mds-plot 10&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhihuiz</name></author>	</entry>

	<entry>
		<id>http://statgen.us/index.php?title=GWAS_Controlling_for_Population_Substructure&amp;diff=598&amp;oldid=prev</id>
		<title>Serveradmin: Created page with &quot;&lt;pre&gt; plink --file GWAS_clean4 --genome --cluster --mds-plot 10 #### in R mydata &amp;#61; read.table(&quot;mds_components.txt&quot;, header&amp;#61;T) mydata$pch[mydata$Group&amp;#61;&amp;#61;1 ] &amp;lt;...&quot;</title>
		<link rel="alternate" type="text/html" href="http://statgen.us/index.php?title=GWAS_Controlling_for_Population_Substructure&amp;diff=598&amp;oldid=prev"/>
				<updated>2018-06-07T01:40:09Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; plink --file GWAS_clean4 --genome --cluster --mds-plot 10 #### in R mydata = read.table(&amp;quot;mds_components.txt&amp;quot;, header=T) mydata$pch[mydata$Group==1 ] &amp;lt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
plink --file GWAS_clean4 --genome --cluster --mds-plot 10&lt;br /&gt;
#### in R&lt;br /&gt;
mydata &amp;amp;#61; read.table(&amp;quot;mds_components.txt&amp;quot;, header&amp;amp;#61;T)&lt;br /&gt;
mydata$pch[mydata$Group&amp;amp;#61;&amp;amp;#61;1 ] &amp;amp;lt;-15&lt;br /&gt;
mydata$pch[mydata$Group&amp;amp;#61;&amp;amp;#61;2 ] &amp;amp;lt;-16&lt;br /&gt;
mydata$pch[mydata$Group&amp;amp;#61;&amp;amp;#61;3 ] &amp;amp;lt;-2&lt;br /&gt;
jpeg(&amp;quot;mds.jpeg&amp;quot;, height&amp;amp;#61;500, width&amp;amp;#61;500)&lt;br /&gt;
plot(mydata$C1, mydata$C2 ,pch&amp;amp;#61;mydata$pch)&lt;br /&gt;
dev.off()&lt;br /&gt;
q()&lt;br /&gt;
######&lt;br /&gt;
plink --file GWAS_clean4 --pheno pheno.txt --pheno-name Aff --logistic --adjust --out unadj&lt;br /&gt;
plink --file GWAS_clean4 --genome --cluster --pca 10 header&lt;br /&gt;
plink --file GWAS_clean4 --pheno pheno.txt --pheno-name Aff --covar plink.eigenvec --covar-name PC1 --logistic --adjust --out PC1&lt;br /&gt;
plink --file GWAS_clean4 --pheno pheno.txt --pheno-name Aff --covar plink.eigenvec --covar-name PC1-PC2 --logistic --adjust --out PC1-PC2&lt;br /&gt;
#### in R&lt;br /&gt;
broadqq &amp;amp;lt;-function(pvals, title)&lt;br /&gt;
{&lt;br /&gt;
    observed &amp;amp;lt;- sort(pvals)&lt;br /&gt;
    lobs &amp;amp;lt;- -(log10(observed))&lt;br /&gt;
    expected &amp;amp;lt;- c(1:length(observed))&lt;br /&gt;
    lexp &amp;amp;lt;- -(log10(expected / (length(expected)+1)))&lt;br /&gt;
    plot(c(0,7), c(0,7), col&amp;amp;#61;&amp;quot;red&amp;quot;, lwd&amp;amp;#61;3, type&amp;amp;#61;&amp;quot;l&amp;quot;, xlab&amp;amp;#61;&amp;quot;Expected (-logP)&amp;quot;, ylab&amp;amp;#61;&amp;quot;Observed (-logP)&amp;quot;, xlim&amp;amp;#61;c(0,max(lobs)), ylim&amp;amp;#61;c(0,max(lobs)), las&amp;amp;#61;1, xaxs&amp;amp;#61;&amp;quot;i&amp;quot;, yaxs&amp;amp;#61;&amp;quot;i&amp;quot;, bty&amp;amp;#61;&amp;quot;l&amp;quot;, main &amp;amp;#61; title)&lt;br /&gt;
    points(lexp, lobs, pch&amp;amp;#61;23, cex&amp;amp;#61;.4, bg&amp;amp;#61;&amp;quot;black&amp;quot;) }&lt;br /&gt;
jpeg(&amp;quot;qqplot_compare.jpeg&amp;quot;, height&amp;amp;#61;1000, width&amp;amp;#61;500)&lt;br /&gt;
par(mfrow&amp;amp;#61;c(2,1))&lt;br /&gt;
aff_unadj&amp;amp;lt;-read.table(&amp;quot;unadj.assoc.logistic&amp;quot;, header&amp;amp;#61;TRUE)&lt;br /&gt;
aff_unadj.add.p&amp;amp;lt;-aff_unadj[aff_unadj$TEST&amp;amp;#61;&amp;amp;#61;c(&amp;quot;ADD&amp;quot;),]$P&lt;br /&gt;
broadqq(aff_unadj.add.p,&amp;quot;Some Trait Unadjusted&amp;quot;)&lt;br /&gt;
aff_C1C2&amp;amp;lt;-read.table(&amp;quot;PC1-PC2.assoc.logistic&amp;quot;, header&amp;amp;#61;TRUE)&lt;br /&gt;
aff_C1C2.add.p&amp;amp;lt;-aff_C1C2[aff_C1C2$TEST&amp;amp;#61;&amp;amp;#61;c(&amp;quot;ADD&amp;quot;),]$P&lt;br /&gt;
broadqq(aff_C1C2.add.p, &amp;quot;Some Trait Adjusted for PC1 and PC2&amp;quot;)&lt;br /&gt;
dev.off()&lt;br /&gt;
gws_unadj &amp;amp;#61; aff_unadj[which(aff_unadj$P &amp;amp;lt; 0.0000001),]&lt;br /&gt;
gws_unadj&lt;br /&gt;
gws_adjusted &amp;amp;#61; aff_C1C2[which(aff_C1C2$P &amp;amp;lt; 0.0000001),]&lt;br /&gt;
gws_adjusted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Serveradmin</name></author>	</entry>

	</feed>