[Genabel-commits] r1173 - tutorials/GenABEL_general
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Mar 25 00:41:49 CET 2013
Author: lckarssen
Date: 2013-03-25 00:41:49 +0100 (Mon, 25 Mar 2013)
New Revision: 1173
Modified:
tutorials/GenABEL_general/dataimport.Rnw
Log:
GA tutorial: fixed some R code layout in the import appendix (it extended too far into the margins). And a few minor spelling fixes.
Modified: tutorials/GenABEL_general/dataimport.Rnw
===================================================================
--- tutorials/GenABEL_general/dataimport.Rnw 2013-03-24 00:22:30 UTC (rev 1172)
+++ tutorials/GenABEL_general/dataimport.Rnw 2013-03-24 23:41:49 UTC (rev 1173)
@@ -7,10 +7,11 @@
{\bf This section is outdated. By far the most used way is through the TPED}
-As described in section \ref{subs:gwaaclass}, \GA{} gwaa.data-class consist of
-phenotypic data frame and an object of snp.data-class, which contains all
-genetic data. To import data to \GA{}, you need to prepare two files: one
-containing the phenotypic, and the other containing genotypic data.
+As described in section \ref{subs:gwaaclass}, the \GA{}
+gwaa.data-class consists of phenotypic data frame and an object of
+snp.data-class, which contains all genetic data. To import data to
+\GA{}, you need to prepare two files: one containing the phenotypic,
+and the other containing genotypic data.
The phenotype file relates study subject IDs with values of covariates and
outcomes. In the phenotypic data file, the first line gives a description
@@ -48,20 +49,23 @@
"cd1005389" 1 28.21 1 0.35 3.90
\end{verbatim}
-This file tells us that, for example, person 325286 is female (0 in second column),
-and she has "1" (usually this means a "case") value for the trait "bt1", so on.
-Person 289982 has measurements only for sex, age and qt1, while other measurements
-are missing (NA, Not Available).
+This file tells us that, for example, person 325286 is female (0 in
+second column), and she has "1" (usually this means a "case") value
+for the trait "bt1", so on. Person 289982 has measurements only for
+sex, age and qt1, while the other measurements are missing (NA, Not
+Available).
-If you need to add pehnotypes to a \texttt{gwaa.data-class} object already
-created, you can use function \texttt{add.phdata}.
+If you need to add phenotypes to an already created
+\texttt{gwaa.data-class}, you can use the \texttt{add.phdata}
+function.
\index{add.phdata}
\index{adding phenotypic data}
\index{import!adding phenotypic data}
-This function allows you to add variables contained in some data frame to the
-existing \texttt{data at phdata} object. The data frame to be added should
-contain "id" variable, identical to that existing in the object, and \textbf{should
-not} contain any othe variables with names identical to these already existing.
+This function allows you to add variables contained in some data frame
+to the existing \texttt{data at phdata} object. The data frame to be
+added should contain an "id" variable, identical to that existing in the
+object, and \textbf{should not} contain any other variables with names
+identical to those that already exist.
The second file you need should contains genotypic data.
As described in section \ref{subs:gwaaclass} ("\nameref{subs:gwaaclass}",
@@ -115,7 +119,9 @@
the data to \GA{} raw format by
<<>>=
-convert.snp.illumina(inf="RData/gen0.illu",out="RData/gen0i.raw",strand="file")
+convert.snp.illumina(inf="RData/gen0.illu",
+ out="RData/gen0i.raw",
+ strand="file")
@
Here is the content of the converted file "gen0i.raw" -- internal raw data representation:
@@ -131,7 +137,9 @@
converted genotypic file in the raw \GA{} format is called "gen0i.raw". You can load
the data using the command
<<>>=
-df <- load.gwaa.data(phe="RData/phe0.dat",gen="RData/gen0i.raw",force=T)
+df <- load.gwaa.data(phe="RData/phe0.dat",
+ gen="RData/gen0i.raw",
+ force=TRUE)
@
\index{load.gwaa.data}
\index{loading the data}
@@ -143,7 +151,7 @@
<<>>=
df at phdata
@
-... and than check that the genotypes have imported right:
+\ldots than check that the genotypes have imported right:
<<>>=
g0 <- as.character(df at gtdata)
g0
@@ -156,7 +164,9 @@
\verbatiminput{RData/gen0.illuwos}
and the conversion command will be
<<>>=
-convert.snp.illumina(inf="RData/gen0.illuwos",out="RData/gen0iwos.raw",strand="+")
+convert.snp.illumina(inf="RData/gen0.illuwos",
+ out="RData/gen0iwos.raw",
+ strand="+")
@
In this particular data set, after conversion, the "+" strand will actually mean
not "forward", but TOP -- something you should remember for this particular data.
@@ -166,7 +176,9 @@
You can load the data with
<<>>=
-df <- load.gwaa.data(phe="RData/phe0.dat",gen="RData/gen0iwos.raw",force=T)
+df <- load.gwaa.data(phe="RData/phe0.dat",
+ gen="RData/gen0iwos.raw",
+ force=TRUE)
@
Obviously, the ''strand'' is always ''+'' (here it means TOP):
@@ -218,12 +230,17 @@
You can convert the data from PLINK TPED format to the \GA{} format
using command \texttt{convert.snp.tped}:
<<>>=
-convert.snp.tped(tped="RData/gen0.tped",tfam="RData/gen0.tfam",out="RData/gen0tped.raw",strand="+")
+convert.snp.tped(tped="RData/gen0.tped",
+ tfam="RData/gen0.tfam",
+ out="RData/gen0tped.raw",
+ strand="+")
@
\index{convert.snp.tped}
and load the data with
<<>>=
-df <- load.gwaa.data(phe="RData/phe0.dat",gen="RData/gen0tped.raw",force=T)
+df <- load.gwaa.data(phe="RData/phe0.dat",
+ gen="RData/gen0tped.raw",
+ force=TRUE)
@
Obviously, the ''strand'' is always ''+'' (meaning TOP):
@@ -276,12 +293,17 @@
The data can be converted to the internal \GA{} format with
<<>>=
-convert.snp.ped(pedfile="RData/gen0.ped",mapfile="RData/map0.dat",out="RData/gen0pedwos.raw",strand="+")
+convert.snp.ped(pedfile="RData/gen0.ped",
+ mapfile="RData/map0.dat",
+ out="RData/gen0pedwos.raw",
+ strand="+")
@
\index{convert.snp.ped}
and loaded with
<<>>=
-df <- load.gwaa.data(phe="RData/phe0.dat",gen="RData/gen0pedwos.raw",force=T)
+df <- load.gwaa.data(phe="RData/phe0.dat",
+ gen="RData/gen0pedwos.raw",
+ force=TRUE)
@
We can inspect the genotypic data and check that conversion results
@@ -305,13 +327,18 @@
The data can be converted to the internal \GA{} format with
<<>>=
-convert.snp.ped(pedfile="RData/gen0.ped",mapfile="RData/emap0.dat",out="RData/gen0ped.raw",strand="file")
+convert.snp.ped(pedfile="RData/gen0.ped",
+ mapfile="RData/emap0.dat",
+ out="RData/gen0ped.raw",
+ strand="file")
@
Note that option \texttt{strand==file} was used to specify
that the extended map format should be used. The data
can be loaded with
<<>>=
-df <- load.gwaa.data(phe="RData/phe0.dat",gen="RData/gen0ped.raw",force=T)
+df <- load.gwaa.data(phe="RData/phe0.dat",
+ gen="RData/gen0ped.raw",
+ force=TRUE)
@
We can inspect the genotypic data and check that conversion results
More information about the Genabel-commits
mailing list