Create and using my own Docker image - bcb420-2024/Krutika_Joshi GitHub Wiki
Loading Docker
- First open Docker
- Create a text file in my BCB420 folder(i.e the one in my desktop)
- Name the text file Dockerfile
- Enter the following in the textile to extend the bcb420-base-image package
FROM risserlin/bcb420-base-image:winter2024-arm64
Loading libraries in Docker
- Input the following to add DESeq2 and pheatmap libraries to the image
RUN R -r 'install.packages(c(“pheatmap”))'
RUN R -e 'BiocManager::install("DESeq2")'
- Save the Dockerfile file
Running docker
- Create a new folder called projects in the BCB420 directory
- Type
docker build -t j1
, where j1 is the name of the image - Run the following command
docker run -e PASSWORD=changeit -v "$(pwd)":/home/rstudio/projects -p 8787:8787 j1
- Run http://localhost:8787/ (NOTE: Input rstudio as the username and changeit as the password)
- Create a markdown file as done in previous classes
- Create a 5X10 gene matrix with random values as taught in MGY441
Create a DESeq object
- First identify with columns are control and which are tests by using the function factor()
condition <- factor(c("A","A","A","A","A","B","B","B","B","B"))
- Second convert the current matrix to a DESeq object by using the function DESeqDataSetFromMatrix()
dds <- DESeqDataSetFromMatrix(matrix1, DataFrame(condition), ~ condition)
dds <- DESeq(dds)
- Calculate the fold change by using the results function
res <- results(dds)
Push files to the git Repository
- Go to my git hub page
- Click on code and then copy the ssh key
- In terminal type (Note: [email protected]:bcb420-2024/Krutika_Joshi.git is my SSH key)
git clone [email protected]:bcb420-2024/Krutika_Joshi.git
- Git add and commit
- Finally git push