-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from CostaLab/devel
Fixed vignettes
- Loading branch information
Showing
5 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
title: "Analysis of Blastic Plasmacytoid Dendritic Cell Neoplasm (BPDCN)" | ||
author: Martin Grasshoff<sup>1</sup>, Ivan G. Costa<sup>1</sup> | ||
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) | ||
``` |