Giter Site home page Giter Site logo

cdsr_biomarker's Introduction

cdsrbiomarker

cdsrbiomarker is an R toolkit for biomarker analysis. It includes helpful functions and standard reports.

Install

library(devtools)
devtools::install_github("broadinstitute/cdsr_models")
devtools::install_github("broadinstitute/cdsr_biomarker")

The package can then be loaded by calling

library(cdsrbiomarker)

Taiga

Many of the functions in the package use data which is stored on taiga. If you are at the Broad you can install taigr the taiga client for R by following the instructions here.

Functions

get_biomarkers

get_biomarkers is a wrapper around the discrete_test, lin_associations, and random_forest functions in cdsrmodels. It takes a response vector y and then loads features matricies from Taiga. The appropriate modeling functions are applied to each feature matrix and the results are returned and saved in the out_path directory if it is specified.

biomarker_results <- get_biomarkers(y, p_cutoff=0.1, out_path="~/Desktop/example")

Reports

The reports directory contains standard biomarker reports.

There are wrapper functions in cdsrbiomarker to automaticaly genenarate these reports. Here is an example using Achilles data for EGFR and PRISM data for a few EGFR inhibitors:

  1. Make a cell line by perturbation response matrix Y.
gene_effect <- load.from.taiga(data.name='depmap-a0ab',data.file='Achilles_gene_effect')[,"EGFR (1956)"] %>% 
  enframe(name = "arxspan_id",value = "xpr_egfr")
auc <- load.from.taiga(data.name='secondary-screen-15e6', data.file='secondary_merged_drc_parameters') %>% 
  filter(repurposing_name %in% c("erlotinib","gefitinib","lapatinib")) %>% 
  select(auc,repurposing_name,arxspan_id) %>% 
  spread(key = "repurposing_name",value = "auc")
Y <- full_join(gene_effect,auc, by = "arxspan_id") %>% column_to_rownames(var = "arxspan_id") %>% as.matrix()
corner(Y)
##               xpr_egfr erlotinib gefitinib lapatinib
## ACH-000004  0.16303435        NA        NA        NA
## ACH-000005  0.05234623        NA        NA        NA
## ACH-000007 -0.27242329 1.2249556 0.6756661 0.6937505
## ACH-000009 -0.78660538        NA        NA        NA
## ACH-000011 -0.10197377 0.7143025 0.7616728 0.7627777
  1. Make a meta data table which will be displayed in the report.
meta_data <- list(perturbation = colnames(Y), type = c("CRISPR","Drug","Drug","Drug")) %>% as_tibble()
meta_data
## # A tibble: 4 x 2
##   perturbation type  
##   <chr>        <chr> 
## 1 xpr_egfr     CRISPR
## 2 erlotinib    Drug  
## 3 gefitinib    Drug  
## 4 lapatinib    Drug
  1. Call the generate report function for the report you want. You will need to give it a file path to save the results to.
cdsrbiomarker::generate_multi_profile_biomarker_report("~/Desktop/example/","example_title",Y,meta_data)
  1. If you already have the biomarker results files and just want to generate the report you can do it like this.
cdsrbiomarker::generate_multi_profile_biomarker_report("~/Desktop/example","example")

cdsr_biomarker's People

Contributors

aboghossian avatar colganwi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

flywind2

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.