\texttt{immunoSeqR} Analysis

Created r format(Sys.Date(),"%m/%d/%y")

require(immunoSeqR)
require(ggplot2)
require(gridExtra)
r <- function(){render('~/Documents/emj/ImmunoseqResults/immunoSeqR/scripts/mega_analysis.Rmd',output_dir='~/Desktop/out/')}
first_run <- TRUE
load('~/Documents/emj/ImmunoseqResults/mega/ds_agg.Rda')
load('~/Documents/emj/ImmunoseqResults/mega/dict.Rda')
load('~/Documents/emj/ImmunoseqResults/mega/stats.Rda')
total_ds <- ds
total_dict <- dict
total_stats <- stats
rm(ds)
rm(dict)
gc()

Background

Dataset

The data set contains r ncol(total_ds)-2 samples, of r length(levels(total_dict$type)) types. There are r format(nrow(total_ds),big.mark=',') unique TCRs, collapsed from r format(sum(total_ds$syn),big.mark=',') distinct productive CDR3 sequences. This represents an average synonymity of r summary(total_ds$syn)['Mean']. The maximum synonymity was r summary(total_ds$syn)['Max.'] (clone sequence r total_ds$aa[which.max(total_ds$syn)]).\par

Metadata

The available metadata fields in the total_dictionary are: r paste(names(total_dict)[-1],collapse=', '). The statistics computed are r paste(names(stats)[names(stats)!='fn'],collapse=', ').

\clearpage

Neoadjuvant Study

\includegraphics[width=\textwidth]{/home/ahopkins/Documents/emj/figures/J0810_timeline.pdf}

ds <- total_ds[,c(1,2,which(total_dict$experiment=='Neoadjuvant'))]
dict <- total_dict[which(total_dict$experiment=='Neoadjuvant'),]
dict <- refactor(dict)
stats <- total_stats[which(total_dict$experiment=='Neoadjuvant')-2,]
plot_ds <- merge(dict,stats)

r ncol(ds)-2 samples, of r length(levels(dict$type)) types.

x_val <- 'response'
metrics <- names(stats[names(stats)!='fn'])
types <- levels(plot_ds$type)
for(b in metrics){
    l <- vector('list')
    for(a in types){
        l[[a]] <- iseqr_plot_metrics(plot_ds,b,x_val,a)
    }
    do.call(grid.arrange,c(l,ncol=length(types)))
}

Adjuvant Study

\includegraphics[width=\textwidth]{/home/ahopkins/Documents/emj/figures/J9988_timeline.pdf}

ds <- total_ds[,c(1,2,which(total_dict$experiment=='Adjuvant'))]
dict <- total_dict[which(total_dict$experiment=='Adjuvant'),]
suppressWarnings(dict <- refactor(dict))
stats <- total_stats[which(total_dict$experiment=='Adjuvant')-2,]
plot_ds <- merge(dict,stats)

r ncol(ds)-2 samples, of r length(levels(dict$type)) types.

x_val <- 'response'
metrics <- names(stats[names(stats)!='fn'])
types <- levels(plot_ds$type)
for(b in metrics){
    l <- vector('list')
    for(a in types){
        l[[a]] <- iseqr_plot_metrics(plot_ds,b,x_val,a)
    }
    do.call(grid.arrange,c(l,ncol=length(types)))
}

Adjuvant-Neoadjuvant Comparison

dict <- total_dict[which(total_dict$experiment=='Adjuvant|Neoadjuvant'),]
dict <- refactor(dict)
stats <- total_stats[which(total_dict$experiment=='Adjuvant|Neadjuvant')-2,]
plot_ds <- merge(dict,stats)

SBRT Study

ds <- total_ds[,c(1,2,which(total_dict$experiment=='SBRT'))]
dict <- total_dict[which(total_dict$experiment=='SBRT'),]
dict <- refactor(dict)
stats <- total_stats[which(total_dict$experiment=='SBRT')-2,]
plot_ds <- merge(dict,stats)

r ncol(ds)-2 samples, of r length(levels(dict$type)) types.

x_val <- 'arm'
metrics <- names(stats[names(stats)!='fn'])
types <- levels(plot_ds$type)
for(b in metrics){
    l <- vector('list')
    for(a in types){
        l[[a]] <- iseqr_plot_metrics(plot_ds,b,x_val,a)
    }
    do.call(grid.arrange,c(l,ncol=length(types)))
}


ahopki14/immunoSeqR documentation built on May 7, 2019, 2:54 a.m.