Skip to content

Instantly share code, notes, and snippets.

Avatar

Yann Abraham yannabraham

  • Janssen Pharmaceutical Companies of Johnson & Johnson
  • Beerse (BE)
View GitHub Profile
@yannabraham
yannabraham / 20220110_AI4Health_WinterSchool_Poster.Rmd
Last active Dec 14, 2021
The source code supporting my poster for the Winter School of AI for Health (2022-01-10)
View 20220110_AI4Health_WinterSchool_Poster.Rmd
---
title: "AI for Health Winter School Poster"
author: "Yann Abraham"
date: "2022-01-10"
params:
fold.lim:
label: the limit applied to absolute fold change
value: 1
input: numeric
sig.lim:
@yannabraham
yannabraham / README.md
Created Oct 21, 2021
Cytobank2Freeviz
View README.md
View 20211105_NextGenOmicsTalk.Rmd
---
title: "NextGen OMICS 2021 - The Polyfunctionality Challenge"
author: "Yann Abraham"
date: "2021-11-05"
params:
fold.lim:
label: the limit applied to absolute fold change
value: 1
input: numeric
sig.lim:
@yannabraham
yannabraham / FontLineGenomicsTalk.R
Last active Jun 29, 2021
The source code to my presentation "Embracing complexity: From discrete analysis to multivariate visualizations" (2021-06-24 - Front Line Genomics)
View FontLineGenomicsTalk.R
#
# Author: ABRAHYA1
###############################################################################
rm(list=ls())
graphics.off()
## libraries
library(ggplot2)
library(Radviz)
@yannabraham
yannabraham / inverted_fan_plots.R
Created Oct 30, 2019
Classically one can use fan plots to visualize the full profile of a given population over a set of conditions, but if you are interested in the effect of treatment on a given channel, you can `pivot` or `invert` the fan plot and visualize the effect of treatment over all populations
View inverted_fan_plots.R
library(ggplot2)
library(dplyr)
library(tidyr)
library(cytofan)
library(bodenmiller)
## let's prepare some data:
cur.mat <- cbind(rbind(refPhenoMat,untreatedPhenoMat),
rbind(refFuncMat,untreatedFuncMat))
cur.annot <- bind_rows(refAnnots %>%
@yannabraham
yannabraham / andrews.R
Last active May 29, 2018
Plotting Andrews curves using dplyr and ggplot2
View andrews.R
## https://en.wikipedia.org/wiki/Andrews_plot
library(dplyr)
library(ggplot2)
do.andrews <- function(x,breaks=30) {
require(reshape2)
t <- seq(-pi, pi, pi/breaks)
m<-nrow(x)
n<-ncol(x)
@yannabraham
yannabraham / cdlist_parser.R
Last active Sep 2, 2016
This script parses the (very useful but broken) list of CD markers and associated genes from Uniprot found at http://www.uniprot.org/docs/cdlist.txt
View cdlist_parser.R
library(stringr)
screwed <- readLines(con='http://www.uniprot.org/docs/cdlist.txt')
screwed <- screwed[76:521]
parser <- c(0,8,21,29,37,55,1000000L) # use fixed length parsing
screwed <- lapply(screwed,function(scr) {
sapply(seq(length(parser)-1),function(i) str_trim(substr(scr,parser[i]+1,parser[i+1])))
}
@yannabraham
yannabraham / complex_summary_w_tapply.R
Created Aug 2, 2016
Using tapply to return multiple values as an array
View complex_summary_w_tapply.R
data(warpbreaks)
my.summary <- function(vals) {
return(c(avg=mean(vals),sd=sd(vals)))
}
sum.warpbreaks <- with(warpbreaks,tapply(breaks,list(tension,wool),my.summary))
sum.warpbreaks <- array(unlist(sum.warpbreaks),
dim=c(length(sum.warpbreaks[1,1][[1]]),dim(sum.warpbreaks)),
@yannabraham
yannabraham / cytometry_fan.R
Last active Oct 30, 2019
Fan plots are an attractive method to visualize trends in complex data such as those generated in Flow and Mass Cytometry experiments. Using ggplot2, one can easily treillis the different conditions to observe trends in the data.
View cytometry_fan.R
## build a fan plot from scratch using dplyr & ggplot2 for visualization of Flow data
## after an original idea by Guy J. Abel
## http://gjabel.wordpress.com/category/r/fanplot/
## libraries
library(flowCore)
library(reshape2)
library(dplyr)
library(ggplot2)
library(RColorBrewer)
@yannabraham
yannabraham / createFlowFrame.R
Last active May 31, 2022
A quick way to create FCS files from CSV
View createFlowFrame.R
library(Biobase)
library(flowCore)
library(flowViz)
# simply replace the dummy dta below with your CSV data
dta <- matrix(rnorm(10000),ncol=10)
dimnames(dta)[[2]] <- LETTERS[1:10]
head(dta)