Skip to contents

This function is part of the heart of the package. format_qtl_input formats genotype, map, and phenotype data for QTL analysis in R/qtl. It allows the user to specify whether the genotype data should be converted from dosage to ABH format or used as is.

Usage

format_qtl_input(geno, map, pheno, numeric = TRUE)

Arguments

geno

A dataframe containing genotype data with markers as rows and individuals as columns.

map

A dataframe containing the genetic map with columns: marker, chrom, and position.

pheno

A dataframe containing phenotype data with an ID column corresponding to individual/sample names.

numeric

A logical value (TRUE or FALSE) indicating whether to convert dosages to R/qtl ABH format (default = TRUE).

Value

A dataframe combining genotype, map, and phenotype data in R/qtl format and ready for read.cross after saving it as csv.

Note

Formats input data for the read.cross function of R/qtl.

Examples

if (FALSE) { # \dontrun{
# Example usage:
 result <- format_qtl_input(geno2, map2, pheno2, numeric = TRUE)

# Write as CSV
write.csv(result, file = "formatted_qtl_data.csv", row.names = FALSE)

# Read into a cross object (R/qtl)
library(qtl)
cross_data <- read.cross(format = "csv",
                         file = "formatted_qtl_data.csv",
                         genotypes = c("A", "H", "B"),
                         estimate.map = FALSE)
} # }