diff --git a/DESCRIPTION b/DESCRIPTION index 1666f05..331e42e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: sigurd Type: Package Title: Single cell Genotyping Using RNA Data -Version: 0.2.61 +Version: 0.3.0 Authors@R: c( person(given = "Martin", family = "Grasshoff", diff --git a/README.md b/README.md index d09c440..08da216 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The mutation data was obtained from the Sanger Institute Catalogue Of Somatic Mu ``` -# Current Features v0.2.61 +# Current Features v0.3.0 - Loading data from VarTrix and MAEGATK. - Transforming the data to be compatible for joint analysis. diff --git a/docs/articles/BoneMarrow_SIGURD.html b/docs/articles/BoneMarrow_SIGURD.html index c4a6271..8bc728c 100644 --- a/docs/articles/BoneMarrow_SIGURD.html +++ b/docs/articles/BoneMarrow_SIGURD.html @@ -6,7 +6,7 @@ -BPDCN BoneMarrow SIGURD • sigurd +Analysis of Blastic Plasmacytoid Dendritic Cell Neoplasm (BPDCN) • sigurd @@ -41,7 +41,7 @@ diff --git a/vignettes/BoneMarrow_SIGURD.Rmd b/vignettes/BoneMarrow_SIGURD.Rmd new file mode 100644 index 0000000..d7fde70 --- /dev/null +++ b/vignettes/BoneMarrow_SIGURD.Rmd @@ -0,0 +1,78 @@ +--- +title: "Analysis of Blastic Plasmacytoid Dendritic Cell Neoplasm (BPDCN)" +author: Martin Grasshoff1, Ivan G. Costa1 +affiliations: 1. Institute for Computational Genomics, Faculty of Medicine, RWTH Aachen University, Aachen, 52074 Germany +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Analysis of Blastic Plasmacytoid Dendritic Cell Neoplasm (BPDCN)} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +header-includes: + - \usepackage[utf8]{inputenc} +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE, dev = "CairoPNG") +``` + +## Analysis of Blastic Plasmacytoid Dendritic Cell Neoplasm (BPDCN) + +Here, we compare the analysis of cells from a patient with BPDCN. + +The original script is available here: https://github.com/petervangalen/MAESTER-2021/blob/main/4_CH_sample/4.2_Variant_Selection.R + +In this setup, the cells are all from a single donor and do not have to be separated into categories. + +Then small clones that might characterize the clonal lineages in the sample are selected. + +## Loading necessary packages. + +We load the data from MAESTER. + +```{r Packages, warning = FALSE} +print("Libraries for SIGURD.") +suppressPackageStartupMessages(library(sigurd)) +suppressPackageStartupMessages(library(SummarizedExperiment)) +suppressPackageStartupMessages(library(ggplot2)) +``` + +## Loading the data using SIGURD. + +```{r Loading_SIGURD, warning = FALSE} +# The design matrix contains information for the genotyping data. +genotyping <- LoadingMAEGATK_typewise(patient = "BPDCN712", samples_file = "data/MAESTER_Reproduction.csv", type_use = "Amplicon_MT", verbose = FALSE) + +# Loading the scRNA-seq data. +scrna <- readRDS("/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/BPDCN712_Seurat_with_TCR_Renamed.rds") +``` + +## Generating a block list + +Variants that are also detected in the cell mixture data is treated as possible false positives. They are used as a blacklist and are removed from the results. + +```{r warning = FALSE} +# Loading the TenX Cell Mixture Genotyping. + +genotyping_tenx <- load_object("/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/TenX_CellMixture_Genotyping.rds.lz4") +blocklist <- AllelFrequencyFoldChange(genotyping_tenx, group_of_interest = "CellType", group1 = "K562", group2 = "BT142", maximum_foldchange = 5, minimum_coverage = 5, minimum_allele_freq = 0.001, maximum_allele_freq = 0.999)$Variant + +# We add the variant chrM_1583_A_G by hand. It is identified as misleading based on downstream analysis. +blocklist <- c(blocklist, "chrM_1583_A_G") +``` +## Selecting the Variants of Interest + +Now, we select the variants of interest from the loaded data. + +```{r warning = FALSE} +voi.ch.sigurd <- VariantSelection_TopCells(genotyping, min_coverage = 5, quantiles = 0.9, thresholds = 0, top_cells = 10, top_VAF = 0.5, min_quality = 30, remove_nocall = FALSE, verbose = FALSE) +voi.ch.sigurd <- voi.ch.sigurd[!voi.ch.sigurd %in% blocklist] +print(voi.ch.sigurd) +``` + +## Visualisation using SIGURD + +```{r Vis_SIGURD, fig.width = 6, fig.height = 4, warning = FALSE} +genotyping <- Filtering(SE = genotyping, cells_include = colnames(scrna)) +colData(genotyping)$CellType <- scrna$CellType +HeatmapVoi(SE = genotyping, voi = voi.ch.sigurd, annotation_trait = "CellType", sort_cells = TRUE, remove_empty_cells = TRUE, minimum_allele_freq = 0.01) +```