Skip to content

Instantly share code, notes, and snippets.

View MahShaaban's full-sized avatar

Mahmoud Ahmed MahShaaban

View GitHub Profile
@MahShaaban
MahShaaban / ct_values.csv
Created April 3, 2019 04:44
Calculate relative expression using ddCt.
group GOI REF
control 32.37 16.05
control 31.76 15.1
control 31.8 15.76
treatment 30.1 18.56
treatment 29.78 15.64
treatment 29.88 14.76
@MahShaaban
MahShaaban / SummarizedExperiment_DiffBindcounts
Created January 22, 2019 01:30 — forked from rbronste/SummarizedExperiment_DiffBindcounts
Creating a Ranged Summarized Experiment object from DiffBind matrix output. R packages: DiffBind, BiocParallel
# Create a dba.count object
library("BiocParallel")
library("DiffBind")
parallel=TRUE
BPPARAM=MulticoreParam(4)
ATAC_adult_BNST<- dba(sampleSheet = "Adult_ATAC_BNST1.csv", config=data.frame(AnalysisMethod=DBA_DESEQ2, fragmentSize = 0, th=.05),peakFormat="narrow")
@MahShaaban
MahShaaban / test-reproduce_app.R
Last active September 24, 2018 11:29
Reproduce the output of colocr using only imager.
library(imager)
# download data
if(!file.exists('./stats.csv')) {
download.file('https://raw.githubusercontent.com/MahShaaban/colocr/master/inst/colocr_app/stats_18.09.02_05.15.01.csv',
destfile = './stats.csv')
}
if(!file.exists('./inputs.csv')) {
@MahShaaban
MahShaaban / Image0004_.jpg
Last active August 8, 2018 07:49
A simple script to show functionality of the colocr package
Image0004_.jpg
@MahShaaban
MahShaaban / draw_proteins.R
Last active May 3, 2018 05:48
Draw a protein schematic of Rat thik1; wild-type and turnicated
# load required libraries
library(tidyverse)
# load topology data and add ymin and ymax
thik1 <- read_csv('thik_features.csv')
thik1 <- thik1 %>%
mutate(ymin = as.numeric(as.factor(protein)) -.2,
ymax = as.numeric(as.factor(protein)) + .2)
# generate and save the figure
@MahShaaban
MahShaaban / CTFT_helper.R
Created May 17, 2017 10:41
A helper function to download a csv file of Cistrome Cancer Transcription Factor Targets.
#' Download Cancer Transcription Factor Targets data
#'
#' Download a coma separated file of Cistrome Cancer Transcription Factor Targets
#'
#' @param tf A character string of a transcription factor
#' @param file_type A character string of two options; 'cor' correlation to genes or 'rp' regulatory potential to genes
#' @param all A logical to whether to get only data for target genes or all genes
#' @param dir A character string for the directory to download data to
#'
#' @return A csv file
@MahShaaban
MahShaaban / TCGA_helpers.R
Created May 17, 2017 10:34
Helper functions to download The Cancer Genome Atlas (TCGA) data into a summarizedExperiment object or a tidy format.
#' Merge TCGA data
#'
#' Merge data.frames of TCGA data into one tidy table
#'
#' @param study_data genetic profiles of a TCGA study
#'
#' @return A tidy data.frame
#'
#' @export
study_merge <- function(study_data) {