Docker container built to run the deprecated R package synbreed https://synbreed.r-forge.r-project.org/
Download the Dockerfile
(you should also download Docker Desktop)
Create an image with the Dockerfile. Open terminal (or similar) and run the following:
docker build -t synbreed .
You must be inside of the directory containing the Dockerfile for this to work.
See image in you Docker Desktop app.
Click the RUN! button on the right side; name the container (optional).
Click the >_ button which will open the container in terminal.
Start R from within container.
R
Download docker image to be run with singluarity.
Load module first if necessary.
module load singularity
singularity pull synbreed.sif docker://finchnsnps/synbreed:synbreed
Open container as a shell with singularity.
singularity shell --cleanenv synbreed.sif
Start R from within container.
R
Test the synbreed package from within the docker container. For this test, we will convert allele format into genotype dosage format (0 = homozygous for the reference allele, 1 = heterozygous, 2 = homozygous for the alternate allele). For more information about functions available in the synbreed package see: https://synbreed.r-forge.r-project.org/synbreed-manual.pdf
Start R from within container.
R
Load synbreed library
library(synbreed)
Load test data
test<-read.csv("Docker_Rpackage_synbreed/synbreed_test_data.csv",header=1)
head(test)
synbreed requires a dataframe of loci (no sample names) and row names. So, we will make a new dataframe with the test data and make the sample names the row names for the synbreed data conversion.
locus<-test[c(2:ncol(test))]
head(locus)
Add row names
rownames(locus)<-test$ID
head(locus)
Use the create.gpData function. gp.Data is a special data format required by synbreed.
snps_gp<-create.gpData(geno=locus)
Convert allele to dosage genotype format with function codeGeno. This time without imputing. synbreed with impute data with impute=TRUE
geno<-codeGeno(snps_gp,impute=FALSE)
Save converted data in a new dataframe.
geno<-data.frame(geno$geno)
head(geno)