Create and using my own Docker image - bcb420-2024/Krutika_Joshi GitHub Wiki

Loading Docker

  1. First open Docker
  2. Create a text file in my BCB420 folder(i.e the one in my desktop)
  3. Name the text file Dockerfile
  4. Enter the following in the textile to extend the bcb420-base-image package

FROM risserlin/bcb420-base-image:winter2024-arm64

Loading libraries in Docker

  1. 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")'

  1. Save the Dockerfile file

Running docker

  1. Create a new folder called projects in the BCB420 directory
  2. Type docker build -t j1, where j1 is the name of the image
  3. Run the following command

docker run -e PASSWORD=changeit -v "$(pwd)":/home/rstudio/projects -p 8787:8787 j1

  1. Run http://localhost:8787/ (NOTE: Input rstudio as the username and changeit as the password)
  2. Create a markdown file as done in previous classes
  3. Create a 5X10 gene matrix with random values as taught in MGY441

Create a DESeq object

  1. 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"))

  1. Second convert the current matrix to a DESeq object by using the function DESeqDataSetFromMatrix()

dds <- DESeqDataSetFromMatrix(matrix1, DataFrame(condition), ~ condition) dds <- DESeq(dds)

  1. Calculate the fold change by using the results function

res <- results(dds)

Push files to the git Repository

  1. Go to my git hub page
  2. Click on code and then copy the ssh key
  3. In terminal type (Note: [email protected]:bcb420-2024/Krutika_Joshi.git is my SSH key)

git clone [email protected]:bcb420-2024/Krutika_Joshi.git

  1. Git add and commit
  2. Finally git push