Learn R Programming

BIGr (version 0.6.2)

madc2gmat: Convert MADC Files to an Additive Genomic Relationship Matrix

Description

Scale and normalize MADC read count data and convert it to an additive genomic relationship matrix.

Usage

madc2gmat(
  madc_file,
  seed = NULL,
  method = "collapsed",
  ploidy,
  output.file = NULL
)

Value

data.frame or saved csv file

Arguments

madc_file

Path to the MADC file to be filtered

seed

Optional seed for random number generation (default is NULL)

method

Method to use for processing the MADC data. Options are "unique" or "collapsed". Default is "collapsed".

ploidy

Numeric. Ploidy level of the samples (e.g., 2 for diploid, 4 for tetraploid)

output.file

Path to save the filtered data (if NULL, data will not be saved)

Author

Alexander M. Sandercock

Details

This function reads a MADC file, processes it to remove unnecessary columns, and then converts it into an additive genomic relationship matrix using the first method proposed by VanRaden (2008). The resulting matrix can be used for genomic selection or other genetic analyses.

References

VanRaden, P. M. (2008). Efficient methods to compute genomic predictions. Journal of Dairy Science, 91(11), 4414-4423

Examples

Run this code
#Input variables
madc_file <- system.file("example_MADC_FixedAlleleID.csv", package="BIGr")

#Calculations
temp <- tempfile()

# Converting to additive relationship matrix
gmat <- madc2gmat(madc_file,
                 seed = 123,
                 ploidy=2,
                 output.file = NULL)

Run the code above in your browser using DataLab