Giter VIP home page Giter VIP logo

campp2_former_repository's Introduction

Cancer Systems Biology, Section of Bioinformatics, Department of Health and Technology, Technical University of Denmark, 2800, Lyngby, Copenhagen, Denmark

Cancer Structural Biology Group, Danish Cancer Society Research Center, Strandboulevarden 49, 2100, Copenhagen, Denmark

CAncer-bioMarker-Prediction-Pipeline - CAMPP2


Installation instructions

Installation from BioConductor

To install the CAMPP2 package from Bioconductor, you need to follow these steps:

  1. Install the Bioconductor package manager, BiocManager, if you don't have it already. You can do this by running the following command in your R console:

if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")

  1. Install the CAMPP2 package using BiocManager by running the following command:

BiocManager::install("CAMPP2")

Create and activate conda environment with R and devtools in your project directory

If you don't have access to conda please see the Miniconda installer page (https://docs.conda.io/en/latest/miniconda.html) on instructions on how to install Miniconda.

Remember to have installed BiocManager upfront before proceeding with the installation of CAMPP2. install.packages("BiocManager")

Once you have installed it:

conda create --prefix env -c conda-forge r-base=4.1.3 r-devtools
conda activate ./env

Install CAMPP2 from Github

open R console:
R

load devtools library
library(devtools)

install CAMPP2 from private Github repository (using your personal token and commit ID) devtools::install_github(repo = "ELELAB/CAMPP2",auth_token="<your personal token to github>")

CAMPP2 development environment

The CAMPP2 development environment is made available as Docker image, defined in a Dockerfile in this repository. It uses the Bioconductor devel Docker image as a base, and further downloads and installs the requirements for CAMPP2. In order to use it, please install Docker if you don't have it already, and follow these instructions:

  1. Clone the CAMPP2 GitHub repository in a local folder:
git clone https://www.github.com/ELELAB/CAMPP2.git
cd CAMPP2
  1. Build the container image:
docker build --pull -t campp2:devel-20230206 ./docker

We recommend tagging the container with a date consistent with the day it's been created, since it might contain different package versions depending on the date, as done in this example.

Notice that this needs to be done only once, as well as every time you intend to upgrade your image to account for the latest Bioconductor devel docker image (see below)

  1. Run a container from the image you just created:

In order to access the development environment via RStudio on browser, run:

docker run \
    --rm \
    -v /path/to/my/CAMPP2:/home/rstudio/CAMPP2 \
    -p 8787:8787 \
    -e PASSWORD=campp2 \
    campp2:devel-20230206

Open your web browser and head to http://localhost:8787. Log in using rstudio as username and campp2 as password. You should be able to access the CAMPP2 development folder from the Rstudio interface.

If you prefer running the R command line prompt (e.g. using R, it works in the same exacy way with Rscript):

docker run \
    --rm \
    -it \
    -v /path/to/my/CAMPP2:/home/rstudio/CAMPP2 \
    campp2:devel-20230206 \
    R

if you want to access the bash command line prompt of the container you can instead run:

docker run \
    --rm \
    -it \
    -v /path/to/my/CAMPP2:/home/rstudio/CAMPP2 \
    campp2:devel-20230206 \
    bash

Notice that in these commands:

  • the /path/to/my/CAMPP2 should be replaced by the actual absolute path to the CAMPP2 development folder, depending on where it is located in your computer
  • the container name should be changed to the actual name of the container that you built in step 2. If you're unsure what the container name or tag is, run docker image list, you should be able to find both (a container is specified as NAME:TAG)

We recommend to rebuild your image every few weeks to account for changes in the original BioConductor development image and in the CRAN/Bioconductor repositories. To do so, just repeat step 2 and adjust step 3 according to your new tag.

Running on an Apple Silicon Macs

If you are running the container on Apple Silicon (i.e. M1 and M2 at the time of writing) we currently recommend running the container under x86 emulation using Rosetta2. In order to do so,

  1. Install Rosetta2 by running on your terminal:
/usr/sbin/softwareupdate --install-rosetta
  1. Turn on the "Use Rosetta for x86/amd64 emulation on Apple Silicon" option in Docker, currently located in Settings, Features under development

Further, we recommend adding the --platform linux/amd64 option to the docker run command lines above, for example:

docker run \
    --rm \
    -it \
    -v /path/to/my/CAMPP2:/home/rstudio/CAMPP2 \
    --platform linux/amd64 \
    campp2:devel-20230206 \
    bash

Example data

The data for testing the functions and workflow includes 2 BRCA datasets (campp2_brca_1, campp2_brca_2) and the associated metadata (campp2_brca_1_meta, campp2_brca_2_meta). Each dataset is represented by raw read counts (10000 genes) for 30 samples: 20 tumours which are divided into 4 subtypes (each subtype has 5 samples), and 10 normals. Metadata includes information about diagnosis, age, vital status, days to death, outcome time, tumor stage, subtype, outcome and survival.

Both, raw read counts and metadata were extracted from TCGA BReast CAncer dataset (TCGA-BRCA) Level 3 data.

Test data (gene counts and metadata for 2 data sets) are integrated into CAMPP2 package and accessible as campp2_brca_1, campp2_brca_2, campp2_brca_1_meta, campp2_brca_2_meta variables once the package is installed. Results from intermediate steps (not described here) are also integrated and used as an input for running the examples of the functions. R data object files (.rda) are available on https://github.com/ELELAB/CAMPP2/tree/main/data.

Example run

Default settings can be executed in R using:

library(CAMPP2)

Test data are already part of the CAMPP2 package so user doesn't need to download them. In case you want to load .rda objects manually from the cloned repository, you can use this code:

load("./data/campp2_brca_1.rda")
load("./data/campp2_brca_1_meta.rda")
load("./data/campp2_brca_2.rda")
load("./data/campp2_brca_2_meta.rda")

Default workflow could be run using this command:
runCampp2(batches=c("tumor_stage","tumor_stage"),prefix="test_CAMPP2", data1=campp2_brca_1, data2=campp2_brca_2, metadata1=campp2_brca_1_meta,metadata2=campp2_brca_2_meta, groups=c("IDs", "diagnosis","IDs", "diagnosis"), technology=c("seq","seq"))

For testing the functions, you can consider the code present in campp2_example_Run.R (git repository).

For more details, see help page of the main function runCampp2.

campp2_former_repository's People

Contributors

nikolatom avatar mathildewbech avatar mtiberti avatar elenapapaleo avatar monanourbakhsh avatar mona-n avatar

Watchers

 avatar  avatar  avatar

campp2_former_repository's Issues

Warnings when building documentation

we have some warnings while building documentation during install:

Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/ModuleIC.Rd:28: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/ModuleIC.Rd:30: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/ModuleIC.Rd:32: unexpected section header '\description'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/ModuleIC.Rd:35: unexpected section header '\examples'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/ModuleIC.Rd:40: unexpected END_OF_INPUT '
'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:97: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:99: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:101: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:103: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:105: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:107: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:109: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:111: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:113: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:115: unknown macro '\item'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:117: unexpected section header '\value'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:120: unexpected section header '\description'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:123: unexpected section header '\examples'
Advarsel: /private/var/folders/17/dw4tsv4s1bd9bz2vb2vz8_0128wl6j/T/Rtmp11exr7/R.INSTALL10aa65ec07eef/CAMPP2/man/parseArguments.Rd:128: unexpected END_OF_INPUT '

Rtools missing when installing on Windows

when installing on windows with R version 4 we noticed that an error can arise for Rtools missing. This might need to be installed by CRAN on Windows and would need to be installed by conda:

conda install -c r rtools

Revise structure and naming of the results

For now, we define only "prefix" which represents also the name of the results folder. It might be better to create a dir like "results_sample".
We should also revise formatting and structure of all the outputs.

Save intermediate results

Save results from intermediate steps - replacing NAs, fixing zeros, normalization, batch correction, etc., is missing.

vignette - example for replacing zeros

To fix:

  • when running the example after conda activate /data/user/nikola/CAMPP2_forEle/env_240622 on bioinfo01

n<-10000
Na_dataset1<-apply (campp2_brca_1, 2, function(x) {x[sample( c(1:n), floor(n/10))] <- NA; x} )

doesn't work and complain that
object ‘campp2_brca_1’ not found

  • Do/Add a full example if you expect the user to load the rda data first.
  • And in case correct in the readme and documentation since as it is written now it is implied that there is an option when they are automatically load so one would expect it to work. We can either remove it or add it
  • explain in the vignette what n is meant to

random forest

to port to the bioconductor part the random forest

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.