Skip to content

finchnSNPs/Docker_Rpackage_synbreed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Docker_Rpackage_synbreed

Docker container built to run the deprecated R package synbreed https://synbreed.r-forge.r-project.org/

Use with Docker

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.

Screen Shot 2022-03-21 at 2 04 57 PM

Click the RUN! button on the right side; name the container (optional).

Screen Shot 2022-03-21 at 2 06 45 PM

Click the >_ button which will open the container in terminal.

Start R from within container.

R

Use with Singularity (Apptainer)

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 container

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)

Screen Shot 2022-03-21 at 2 32 47 PM

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)

Screen Shot 2022-03-21 at 2 37 14 PM

Add row names

rownames(locus)<-test$ID

head(locus)

Screen Shot 2022-03-21 at 2 38 17 PM

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)

Screen Shot 2022-03-21 at 2 41 33 PM

About

Docker container built to run the deprecated R package synbreed https://synbreed.r-forge.r-project.org/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published