Description Usage Arguments Details Value See Also Examples
Write the control file (in YAML needed
by read_cross2
for a set of QTL data.
1 2 3 4 5 | write_control_file(output_file, crosstype, geno_file, foundergeno_file,
gmap_file, pmap_file, pheno_file, covar_file, phenocovar_file, sex_file,
sex_covar, sex_codes, crossinfo_file, crossinfo_covar, crossinfo_codes,
linemap_file, linemap_covar, geno_codes, alleles, xchr, na.strings = c("-",
"NA"), comments)
|
output_file |
File name (with path) of the YAML file to be created, as a character string. |
crosstype |
Character string with the cross type. |
geno_file |
File name for genotype data. |
foundergeno_file |
File name for the founder genotype data. |
gmap_file |
File name for genetic map. |
pmap_file |
File name for the physical map. |
pheno_file |
File name for the phenotype data. |
covar_file |
File name for the covariate data. |
phenocovar_file |
File name for the phenotype covariate data (i.e., metadata about the phenotypes). |
sex_file |
File name for the individuals' sex. (Specify just
one of |
sex_covar |
Column name in the covariate data that corresponds
to sex. (Specify just one of |
sex_codes |
Named vector of character strings specifying the
encoding of sex. The names attribute should be the codes used in
the data files; the values within the vector should be
|
crossinfo_file |
File name for the |
crossinfo_covar |
Column name in the covariate data that
corresponds to the |
crossinfo_codes |
In the case that |
linemap_file |
File name for the |
linemap_covar |
Column name in the covariate data that
corresponds to the |
geno_codes |
Named vector specifying the encoding of genotypes. The names attribute has the codes used within the genotype and founder genotype data files; the values within the vector should be the integers to which the genotypes will be converted. |
alleles |
Vector of single-character codes for the founder alleles. |
xchr |
Character string with the ID for the X chromosome. |
na.strings |
Vector of character strings with codes to be treated as missing values. |
comments |
Vector of character strings to be inserted as comments at the top of the file, with each string as a line. |
This function takes a set of parameters and creates the control file (in YAML format) needed for the new input data file format for R/qtl2. See the sample data files and the vignette describing the input file format.
(Invisibly) The data structure that was written.
read_cross2
, sample data files at
http://kbroman.org/qtl2/pages/sampledata.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
# Control file for the sample dataset, grav2
write_control_file("~/my_data/grav2.yaml",
crosstype="riself",
geno_file="grav2_geno.csv",
gmap_file="grav2_gmap.csv",
pheno_file="grav2_pheno.csv",
phenocovar_file="grav2_phenocovar.csv",
geno_codes=c(L=1L, C=2L),
alleles=c("L", "C"),
na.strings=c("-", "NA"))
# Control file for the sample dataset, iron
write_control_file("~/my_data/iron.yaml",
crosstype="f2",
geno_file="iron_geno.csv",
gmap_file="iron_gmap.csv",
pheno_file="iron_pheno.csv",
covar_file="iron_covar.csv",
phenocovar_file="iron_phenocovar.csv",
geno_codes=c(SS=1L, SB=2L, BB=3L),
sex_covar="sex",
sex_codes=c(f="female", m="male"),
crossinfo_covar="cross_direction",
crossinfo_codes=c("(SxB)x(SxB)"=0L, "(BxS)x(BxS)"=1L),
xchr="X",
alleles=c("S", "B"),
na.strings=c("-", "NA"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.