Last updated: 2020-06-24
Checks: 7 0
Knit directory: MINTIE-paper-analysis/
This reproducible R Markdown analysis was created with workflowr (version 1.4.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20200415)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: analysis/cache/
Ignored: data/RCH_B-ALL/
Ignored: data/leucegene/salmon_out/
Ignored: data/leucegene/sample_info/KMT2A-PTD_8-2.fa.xls
Ignored: output/Leucegene_gene_counts.tsv
Ignored: packrat/lib-R/
Ignored: packrat/lib-ext/
Ignored: packrat/lib/
Ignored: packrat/src/
Untracked files:
Untracked: update_results.sh
Unstaged changes:
Modified: code/leucegene_helper.R
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX332633_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX332645_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX332646_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX332659_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX381852_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX381854_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX381865_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX957223_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX957230_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958844_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958873_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958906_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958907_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958922_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958932_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958945_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958959_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958961_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958963_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX958974_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX959001_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX959044_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX959060_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/AML_controls/SRX959061_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX332633_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX332645_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX332646_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX332659_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX381852_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX381854_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX381865_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX957223_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX957230_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958844_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958873_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958906_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958907_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958922_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958932_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958945_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958959_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958961_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958963_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX958974_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX959001_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX959044_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX959060_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls/SRX959061_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX332633_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX332645_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX332646_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX332659_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX381852_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX381854_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX381865_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX957223_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX957230_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958844_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958873_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958906_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958907_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958922_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958932_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958945_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958959_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958961_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958963_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX958974_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX959001_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX959044_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX959060_results.tsv.gz
Modified: data/leucegene/KMT2A-PTD_results/normal_controls_reduced/SRX959061_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/bc/SRX372044_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/bc/SRX372045_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/bc/SRX372046_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/gran/SRX372044_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/gran/SRX372045_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/gran/SRX372046_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/mono/SRX372044_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/mono/SRX372045_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/mono/SRX372046_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/tc/SRX372044_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/tc/SRX372045_results.tsv.gz
Modified: data/leucegene/normals_controls_test_results/tc/SRX372046_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372044_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372045_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372046_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372047_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372048_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372049_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372050_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372051_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372052_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372053_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372054_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372055_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372056_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372057_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372058_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372059_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372060_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372061_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372063_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372064_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372065_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372066_results.tsv.gz
Modified: data/leucegene/normals_results/SRX372067_results.tsv.gz
Modified: data/leucegene/validation_results/SRX332627_results.tsv.gz
Modified: data/leucegene/validation_results/SRX332635_results.tsv.gz
Modified: data/leucegene/validation_results/SRX332667_results.tsv.gz
Modified: data/leucegene/validation_results/SRX381851_results.tsv.gz
Modified: data/leucegene/validation_results/SRX381861_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729580_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729581_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729582_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729583_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729585_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729586_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729587_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729588_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729589_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729590_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729591_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729592_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729602_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729603_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729604_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729605_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729606_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729607_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729608_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729609_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729610_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729611_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729612_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729615_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729616_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729617_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729618_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729619_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729620_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729621_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729622_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729623_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729624_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729625_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729626_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729627_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729628_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729629_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729630_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729631_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729632_results.tsv.gz
Modified: data/leucegene/validation_results/SRX729633_results.tsv.gz
Modified: data/leucegene/validation_results/SRX958856_results.tsv.gz
Modified: data/leucegene/validation_results/SRX958862_results.tsv.gz
Modified: data/leucegene/validation_results/SRX958915_results.tsv.gz
Modified: data/leucegene/validation_results/SRX958987_results.tsv.gz
Modified: data/leucegene/validation_results/SRX959058_results.tsv.gz
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view them.
File | Version | Author | Date | Message |
---|---|---|---|---|
html | 0b21347 | Marek Cmero | 2020-06-11 | Build site. |
html | eb3203f | Marek Cmero | 2020-05-27 | Build site. |
Rmd | 36880a4 | Marek Cmero | 2020-05-12 | Fixed capitalisation for file paths. Added B-ALLs link to site. |
html | a166ab8 | Marek Cmero | 2020-05-08 | Build site. |
html | a600688 | Marek Cmero | 2020-05-07 | Build site. |
html | 5c045b5 | Marek Cmero | 2020-05-07 | Build site. |
html | 90c7fd9 | Marek Cmero | 2020-05-06 | Build site. |
html | 358aa53 | Marek Cmero | 2020-05-04 | Build site. |
Rmd | 453d754 | Marek Cmero | 2020-05-04 | Added controls comparison in normals analysis. Added variant class collation function. Added variant summary for |
html | 4a5d6ae | Marek Cmero | 2020-05-01 | Build site. |
html | 3c9c389 | Marek Cmero | 2020-04-30 | Added missing files from workflowr build |
html | 784838b | Marek Cmero | 2020-04-30 | Build site. |
Rmd | c4c3844 | Marek Cmero | 2020-04-30 | Added leucegene gene expression notebook |
html | 14a7a7b | Marek Cmero | 2020-04-27 | Update index |
html | 535d418 | Marek Cmero | 2020-04-27 | Added missing figures |
html | 6a17444 | Marek Cmero | 2020-04-27 | Build site. |
Rmd | 3fa0082 | Marek Cmero | 2020-04-27 | Fixed subject/query bugs in get_hits functions. Fixed background gene numbers. Added hg19 coords to truth file. |
html | 3fa0082 | Marek Cmero | 2020-04-27 | Fixed subject/query bugs in get_hits functions. Fixed background gene numbers. Added hg19 coords to truth file. |
html | 663689c | Marek Cmero | 2020-04-23 | Build site. |
Rmd | e57763b | Marek Cmero | 2020-04-23 | Initial commit |
html | e57763b | Marek Cmero | 2020-04-23 | Initial commit |
# util
library(data.table)
library(dplyr)
library(here)
# plotting
library(ggplot2)
# bioinformatics helpers
library(GenomicRanges)
library(Rsamtools)
source(here("code/simu_helper.R"))
source(here("code/plot.R"))
options(stringsAsFactors = FALSE)
Here we analyse the results on a simulated data set of 1,500 variants containing fusions, transcribed structural variants and novel splice variants, across 8 methods: MINTIE, TAP, Barnacle, SQUID, JAFFA, Arriba, StringTie and KisSplice.
The plots show the number of variants detected from each category and the number of false positives. The number of background genes detected in the false positives in displayed as printed output.
fus_truth <- read.delim(here("data/simu/truth/allvars_fusions_simulated.tsv"))
tsv_nsv_truth <- read.delim(here("data/simu/truth/allvars_tsvs_splice_simulated.tsv"))
all_gene_locs <- read.delim(gzfile(here("data/ref/all_gene_locs.tsv.gz")))
bg_gene_ref <- read.delim(here("data/simu/truth/bg_gene_ref.tsv"))
# extract truth and background gene names
var_genes_truth <- unique(c(fus_truth$gene1, fus_truth$gene2, tsv_nsv_truth$gene))
var_genes_truth <- var_genes_truth[var_genes_truth != ""]
bg_genes <- bg_gene_ref$gene
# make Genomic Ranges objects from data
fus_grx <- get_granges(fus_truth)
tsv_nsv_grx <- get_granges(tsv_nsv_truth)
bgenes_grx <- get_granges(bg_gene_ref, convert_chrom = TRUE, add_chr = FALSE)
all_gene_grx <- get_granges(all_gene_locs, convert_chrom = TRUE, add_chr = FALSE)
# create results object
nsv_names <- c("Extended exon",
"Novel exon",
"Retained intron",
"Truncated exon",
"Unknown splice")
tsv_names <- c("Deletion",
"Insertion",
"Internal tandem duplication",
"Partial tandem duplication",
"Inversion")
fus_names <- c("Fusion (canonical)",
"Fusion (EE)",
"Fusion (NE)",
"Fusion (insertion)",
"Fusion (unpartnered)")
vartypes <- c("False positive", nsv_names, tsv_names, fus_names)
classes <- c("False positive",
"Novel splice variant",
"Transcribed structural variant",
"Fusion")
results <- data.frame(vartype = factor(vartypes, levels = vartypes),
class = factor(c(classes[1], rep(classes[2:4], each=5)),
levels = classes[4:1]),
row.names = c("FP", "EE", "NE", "RI", "NEJ", "US",
"DEL", "INS", "ITD", "PTD", "INV",
"canonical_fusion", "EE_fusion",
"NE_fusion", "INS_fusion", "unpartnered_fusion"))
cols <- c("#87649aff", "#bdd888ff", "#e7d992ff", "#636363")
names(cols) <- c("Fusion", "Transcribed structural variant", "Novel splice variant", "False positive")
# load data
mintie_results <- read.delim(here("data/simu/results/MINTIE/allvars-case_results.tsv"))
mintie_results <- mintie_results[mintie_results$logFC > 5,]
# extract genes
mintie_vargenes <- sapply(mintie_results$overlapping_genes, function(x){strsplit(x, "\\||:")[[1]]})
mvg <- unlist(mintie_vargenes)
# count found fusions, TSVs and NSVs
found_fus <- table(fus_truth$fusion_type[fus_truth$gene1 %in% mvg | fus_truth$gene2 %in% mvg])
found_tsv <- table(tsv_nsv_truth$vartype[tsv_nsv_truth$gene %in% mvg])
# count false positives genes
fp <- sapply(mintie_vargenes, function(x){!any(x %in% var_genes_truth)})
fp_genes <- unlist(sapply(mintie_results$overlapping_genes[fp], function(x){strsplit(x, "\\||:")}))
fp_genes <- fp_genes[fp_genes != ""]
n_fp <- length(unique(fp_genes))
results <- append_results(results, "MINTIE", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", sum(unique(fp_genes) %in% bg_genes)))
[1] "Background genes in FPs: 1"
plot_simu_benchmarking(results, "MINTIE")
Version | Author | Date |
---|---|---|
1096df5 | Marek Cmero | 2020-04-24 |
# load result data
tap_svs <- read.delim(here("data/simu/results/TAP/sv.bedpe"), sep = "\t", skip = 2)
tap_nsv <- read.delim(here("data/simu/results/TAP/novel_splicing.bedpe"), sep = "\t", skip = 2)
# extract variant genes
tap_vargenes <- Reduce(union, list(tap_svs$gene1, tap_svs$gene2, tap_nsv$gene))
# count found fusions, TSVs and NSVs
found_fus <- table(fus_truth$fusion_type[fus_truth$gene1 %in% tap_vargenes | fus_truth$gene2 %in% tap_vargenes])
found_tsv <- table(tsv_nsv_truth$vartype[tsv_nsv_truth$gene %in% tap_vargenes])
# count false positives genes
fp_svs <- tap_svs[!tap_svs$gene1 %in% var_genes_truth & !tap_svs$gene2 %in% var_genes_truth,]
fp_nsv <- tap_nsv[!tap_nsv$gene1 %in% var_genes_truth & !tap_nsv$gene2 %in% var_genes_truth,]
fp_genes <- unique(c(fp_svs$gene1, fp_svs$gene2, fp_nsv$gene1, fp_nsv$gene2))
n_fp <- length(fp_genes)
results <- append_results(results, "TAP", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", sum(fp_genes %in% bg_genes)))
[1] "Background genes in FPs: 2"
plot_simu_benchmarking(results, "TAP")
# build hg19 version of truth data
# fusions
hg19_fus_truth <- fus_truth
hg19_fus_truth$loc1 <- hg19_fus_truth$hg19_loc1
hg19_fus_truth$loc2 <- hg19_fus_truth$hg19_loc2
hg19_fus_truth$loc1[hg19_fus_truth$loc1 == ""] <- "chrZ:1-2" #dummy record for blanks
hg19_fus_truth$loc2[hg19_fus_truth$loc2 == ""] <- "chrZ:1-2"
# TSVs/NSVs
hg19_tsv_nsv_truth <- tsv_nsv_truth
hg19_tsv_nsv_truth$loc <- hg19_tsv_nsv_truth$hg19_loc
hg19_tsv_nsv_truth$loc[hg19_tsv_nsv_truth$loc == ""] <- "chrZ:1-2"
# make Genomic Ranges objects
hg19_fus_grx <- get_granges(hg19_fus_truth, convert_chrom = FALSE)
hg19_tsv_nsv_grx <- get_granges(hg19_tsv_nsv_truth, convert_chrom = FALSE)
hg19_bg_gene_ref <- read.delim(here("data/simu/truth/hg19_bg_gene_ref.tsv"))
hg19_bgenes_grx <- get_granges(bg_gene_ref, convert_chrom = FALSE)
# load barnacle results and make Genomic Ranges objects
barnacle_results <- read.delim(here("data/simu/results/Barnacle/allvars-case.barnacle.data"), header=FALSE)$V1
barnacle_results <- barnacle_results[grep("OVERLAPPING", barnacle_results)]
barnacle_grx_a <- get_barnacle_grx(barnacle_results)
barnacle_grx_b <- get_barnacle_grx(barnacle_results, side_A = FALSE)
# extract hits
hits <- get_hits(barnacle_grx_a, barnacle_grx_b,
hg19_fus_grx[[1]], hg19_fus_grx[[2]],
hg19_tsv_nsv_grx, hg19_bgenes_grx)
found_fus <- table(hg19_fus_truth[hits$fus_truth_hits,]$fusion_type)
found_tsv <- table(hg19_tsv_nsv_truth[hits$tsv_nsv_truth_hits,]$vartype)
fps <- !1:length(barnacle_grx_a) %in% unique(hits$caller_hits)
n_fp <- sum(fps)
results <- append_results(results, "Barnacle", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", sum(hits$bg_hits %in% which(fps))))
[1] "Background genes in FPs: 3"
plot_simu_benchmarking(results, "Barnacle")
# load data
squid_results <- read.delim(here("data/simu/results/SQUID/results_sv.txt"))
# make GRanges objects
chr1 <- sapply(squid_results$X..chrom1, convert_chrom, add_chr=FALSE)
loc1_grx <- GRanges(seqnames = chr1,
ranges = IRanges(start = squid_results$start1, end = squid_results$end1))
chr2 <- sapply(squid_results$chrom2, convert_chrom, add_chr=FALSE)
loc2_grx <- GRanges(seqnames = chr2,
ranges = IRanges(start = squid_results$start2, end = squid_results$end2))
# get hits
hits <- get_hits(loc1_grx, loc2_grx, fus_grx[[1]], fus_grx[[2]], tsv_nsv_grx, bgenes_grx)
found_fus <- table(fus_truth[hits$fus_truth_hits,]$fusion_type)
found_tsv <- table(tsv_nsv_truth[hits$tsv_nsv_truth_hits,]$vartype)
# get false positives
fps <- squid_results[!1:nrow(squid_results) %in% hits$caller_hits,]
fps <- fps[!(fps$X..chrom1 %like% "alt" | fps$chrom2 %like% "alt"),]
n_fp <- nrow(fps)
results <- append_results(results, "SQUID", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", sum(hits$bg_hits %in% as.numeric(rownames(fps)))))
[1] "Background genes in FPs: 0"
plot_simu_benchmarking(results, "SQUID")
# load data
jaffa_results <- read.delim(here("data/simu/results/JAFFA/jaffa_results.csv"), sep = ",")
# make GRanges objects
chr1 <- sapply(jaffa_results$chrom1, convert_chrom, add_chr=FALSE)
loc1_grx <- GRanges(seqnames = chr1,
ranges = IRanges(start = jaffa_results$base1, end = jaffa_results$base1))
chr2 <- sapply(jaffa_results$chrom1, convert_chrom, add_chr=FALSE)
loc2_grx <- GRanges(seqnames = chr2,
ranges = IRanges(start = jaffa_results$base2, end = jaffa_results$base2))
# get hits
hits <- get_hits(loc1_grx, loc2_grx, fus_grx[[1]], fus_grx[[2]], tsv_nsv_grx, bgenes_grx)
found_fus <- table(fus_truth[hits$fus_truth_hits,]$fusion_type)
found_tsv <- table(tsv_nsv_truth[hits$tsv_nsv_truth_hits,]$vartype)
# get false positives
fps <- jaffa_results[!rownames(jaffa_results) %in% hits$caller_hits,]
fps <- fps[!(fps$chrom1 %like% "alt" | fps$chrom2 %like% "alt"),]
fp_genes <- unlist(sapply(fps$fusion.genes, strsplit, split=":"))
n_fp <- length(unique(fp_genes))
results <- append_results(results, "JAFFA", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", sum(hits$bg_hits %in% as.numeric(rownames(fps)))))
[1] "Background genes in FPs: 0"
plot_simu_benchmarking(results, "JAFFA")
# load data
arriba_results <- read.delim(here("data/simu/results/Arriba/fusions.tsv"))
# extract variasnt genes
arriba_vargenes1 <- sapply(arriba_results$X.gene1, get_arriba_genes)
arriba_vargenes2 <- sapply(arriba_results$gene2, get_arriba_genes)
avg <- unlist(list(arriba_vargenes1, arriba_vargenes2))
# tally results
found_tsv <- table(tsv_nsv_truth[tsv_nsv_truth$gene %in% avg,]$vartype)
found_fus <- table(fus_truth[fus_truth$gene1 %in% avg | fus_truth$gene2 %in% avg,]$fusion_type)
# get false positives
fp1 <- sapply(arriba_vargenes1, function(x){!any(x %in% var_genes_truth)})
fp2 <- sapply(arriba_vargenes2, function(x){!any(x %in% var_genes_truth)})
fp_genes1 <- arriba_vargenes1[fp1 & fp2]
fp_genes2 <- arriba_vargenes2[fp1 & fp2]
fp_genes <- unique(union(fp_genes1, fp_genes2))
n_fp <- length(fp_genes)
results <- append_results(results, "Arriba", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", sum(fp_genes%in% bgenes_grx$genes)))
[1] "Background genes in FPs: 0"
plot_simu_benchmarking(results, "Arriba")
Version | Author | Date |
---|---|---|
1096df5 | Marek Cmero | 2020-04-24 |
# load data and extract transcripts marked as novel
stringtie_results <- read.delim(here("data/simu/results/StringTie/fullsimu.gtf"), comment="#", header=F)
stringtie_results <- stringtie_results[!stringtie_results$V9 %like% "ref_gene_id",]
stringtie_results <- stringtie_results[stringtie_results$V3 == "transcript",]
chrom <- sapply(stringtie_results$V1, convert_chrom, add_chr = FALSE)
stringtie_grx <- GRanges(seqnames = chrom,
ranges = IRanges(start = stringtie_results$V4,
end = stringtie_results$V5))
hits <- get_hits_oneloc(stringtie_grx, fus_grx[[1]], fus_grx[[2]], tsv_nsv_grx, bgenes_grx)
found_fus <- table(fus_truth[hits$fus_truth_hits,]$fusion_type)
found_tsv <- table(tsv_nsv_truth[hits$tsv_nsv_truth_hits,]$vartype)
# get false positives
fp_grx <- stringtie_grx[!1:length(hits$caller_hits) %in% hits$caller_hits]
fp_gene_hits <- all_gene_grx[subjectHits(findOverlaps(fp_grx, all_gene_grx))]
n_fp <- length(unique(fp_gene_hits$genes))
results <- append_results(results, "StringTie", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", sum(unique(fp_gene_hits$genes) %in% bgenes_grx$genes)))
[1] "Background genes in FPs: 1"
plot_simu_benchmarking(results, "StringTie")
# regenerate gene ranges objects "chr" prefix
# (this is required as KisSplice"s bam was aligned
# to a genome with chr prefixes)
fus_grx <- get_granges(fus_truth, convert_chrom = TRUE)
tsv_nsv_grx <- get_granges(tsv_nsv_truth, convert_chrom = TRUE)
bgenes_grx <- get_granges(bg_gene_ref, convert_chrom = FALSE)
# extract hits im fusion and TSV/NSV gene regions
bam <- here("data/simu/results/KisSplice/results.bam")
fus1_hits <- get_kissplice_hits(bam, fus_grx[[1]])
fus2_hits <- get_kissplice_hits(bam, fus_grx[[2]])
tsv_nsv_hits <- get_kissplice_hits(bam, tsv_nsv_grx)
# remame row names to match locations from results
rownames(fus_truth) <- sapply(fus_truth$loc1, convert_chrom)
rownames(tsv_nsv_truth) <- sapply(tsv_nsv_truth$loc, convert_chrom)
# tally results
found_fus <- table(fus_truth[names(fus1_hits)[fus1_hits | fus2_hits],]$fusion_type)
found_tsv <- table(tsv_nsv_truth[names(tsv_nsv_hits[tsv_nsv_hits]),]$vartype)
# count number of FP hits in background genes
# first, get all reads that we counted as "hits"
param <- ScanBamParam(which = c(fus_grx[[1]], fus_grx[[2]], tsv_nsv_grx),
what = c("pos"))
all_hits <- scanBam(bam, param = param)
all_hits <- unique(unlist(all_hits))
# now get all reads in the results and count all
# reads that were not counted as hits
param <- ScanBamParam(what = "pos")
all_results <- unique(scanBam(bam, param = param)[[1]]$pos)
fps <- all_results[!all_results %in% all_hits]
n_fp <- length(fps)
# count the numner of FPs in background genes
param <- ScanBamParam(which = bgenes_grx, what = c("pos"))
bg_hits <- scanBam(bam, param = param)
bg_hits <- bg_hits[as.numeric(bg_hits) %in% fps]
results <- append_results(results, "KisSplice", found_fus, found_tsv, n_fp)
print(paste("Background genes in FPs:", length(bg_hits)))
[1] "Background genes in FPs: 0"
plot_simu_benchmarking(results, "KisSplice")
Version | Author | Date |
---|---|---|
1096df5 | Marek Cmero | 2020-04-24 |
MINTIE paper Figure 3 containing results from all benchmarked methods.
mr <- melt(results, id.vars = c("vartype", "class"), variable.name = "method")
mr$method <- factor(mr$method,
levels=c("MINTIE", "TAP", "Barnacle", "SQUID", "JAFFA", "Arriba", "KisSplice", "StringTie"))
plot_all_simu_benchmarks(mr)
sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS: /config/RStudio/R/3.6.1/lib64/R/lib/libRblas.so
LAPACK: /config/RStudio/R/3.6.1/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8
[5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8
[7] LC_PAPER=en_AU.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] Rsamtools_2.0.1 Biostrings_2.52.0 XVector_0.24.0
[4] GenomicRanges_1.36.1 GenomeInfoDb_1.20.0 IRanges_2.18.3
[7] S4Vectors_0.22.1 BiocGenerics_0.30.0 ggplot2_3.3.1
[10] here_0.1 dplyr_1.0.0 data.table_1.12.6
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 plyr_1.8.4 pillar_1.4.4
[4] compiler_3.6.1 git2r_0.26.1 workflowr_1.4.0
[7] zlibbioc_1.30.0 bitops_1.0-6 tools_3.6.1
[10] digest_0.6.21 evaluate_0.14 lifecycle_0.2.0
[13] tibble_3.0.1 gtable_0.3.0 pkgconfig_2.0.3
[16] rlang_0.4.6 yaml_2.2.0 xfun_0.10
[19] GenomeInfoDbData_1.2.1 withr_2.1.2 stringr_1.4.0
[22] knitr_1.25 generics_0.0.2 fs_1.4.1
[25] vctrs_0.3.1 rprojroot_1.3-2 grid_3.6.1
[28] tidyselect_1.1.0 glue_1.4.1 R6_2.4.0
[31] BiocParallel_1.18.1 rmarkdown_1.16 reshape2_1.4.3
[34] farver_2.0.3 purrr_0.3.2 magrittr_1.5
[37] whisker_0.4 backports_1.1.4 scales_1.1.1
[40] ellipsis_0.3.0 htmltools_0.4.0 colorspace_1.4-1
[43] labeling_0.3 stringi_1.4.3 RCurl_1.95-4.12
[46] munsell_0.5.0 crayon_1.3.4