Write a stockR dataset (Fost et al. submitted). Used internally in radiator and might be of interest for users.

write_stockr(data, filename = NULL, verbose = TRUE)

Arguments

data

(4 options) A file or object generated by radiator:

  • tidy data

  • Genomic Data Structure (GDS)

How to get GDS and tidy data ? Look into tidy_genomic_data, read_vcf or tidy_vcf.

filename

(optional) The stockr object is written in the working directory. The file is written with radiator_stockr_DATE@TIME.RData and can be open with readRDS. Default: filename = NULL.

verbose

(optional, logical) When verbose = TRUE the function is a little more chatty during execution. Default: verbose = TRUE.

Value

The object generated is a matrix with dimension: MARKERS x INDIVIDUALS. The genotypes are coded like PLINK: 0, 1 or 2 alternate allele. 0: homozygote for the reference allele, 1: heterozygote, 2: homozygote for the alternate allele. Missing genotypes have NA. The object also as 2 attributes. attributes(data)$grps with STRATA/POP_ID of the individuals and attributes(data)$sample.grps filled with INDIVIDUALS. Both attributes can be used inside stockR.

References

Foster et al. submitted

Author

Thierry Gosselin thierrygosselin@icloud.com