Skip to content

Commit

Permalink
Merge pull request #39 from CostaLab/devel
Browse files Browse the repository at this point in the history
Fixed vignettes
  • Loading branch information
grasshoffm authored Oct 3, 2024
2 parents a730466 + 7f9aaf1 commit 59ea4f0
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions docs/articles/BoneMarrow_SIGURD.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions vignettes/BoneMarrow_SIGURD.Rmd
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)
```

0 comments on commit 59ea4f0

Please sign in to comment.