From 50d726e773715168d48684e2e6f32125bdbb7f4d Mon Sep 17 00:00:00 2001
From: mgrasshoff
Date: Tue, 15 Oct 2024 15:20:19 +0200
Subject: [PATCH 1/7] Fixing correlation.
---
DESCRIPTION | 2 +-
R/CalculateCorrelationPValue.R | 20 ++++++++++++++------
R/VariantWiseCorrelation.R | 5 +++--
README.md | 2 +-
man/CalculateCorrelationPValue.Rd | 5 ++++-
man/VariantWiseCorrelation.Rd | 3 +++
6 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 6a5edfa..e124e5b 100755
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: sigurd
Type: Package
Title: Single cell Genotyping Using RNA Data
-Version: 0.3.6
+Version: 0.3.7
Authors@R: c(
person(given = "Martin",
family = "Grasshoff",
diff --git a/R/CalculateCorrelationPValue.R b/R/CalculateCorrelationPValue.R
index 0a0e947..6b0b79c 100755
--- a/R/CalculateCorrelationPValue.R
+++ b/R/CalculateCorrelationPValue.R
@@ -3,12 +3,13 @@
#'@description
#'We perform the correlation of SNVs and calculate the P values.
#'@importFrom stats cor.test
-#'@param variant_values The fraction values you are analysing. A vector.
+#'@param variant_values The fraction values you are analyzing. A vector.
#'@param other_mutation All other variants you have. A vector of variant names.
#'@param all_variants_list List of fraction values for all the variants you want to compare your variant with.
#'@param min_intersecting_cells Minimum number of intersecting cells. Correlations with less than this will not be performed.
+#'@param value_type Are we using consensus or other information?
#'@export
-CalculateCorrelationPValue <- function(variant_values, other_mutation, all_variants_list, min_intersecting_cells = 5){
+CalculateCorrelationPValue <- function(variant_values, other_mutation, all_variants_list, value_type = "consensus", min_intersecting_cells = 5){
other_variant_values <- all_variants_list[[other_mutation]]
if(sum(names(variant_values) %in% names(other_variant_values)) == 0){
#print("No intersection")
@@ -28,10 +29,17 @@ CalculateCorrelationPValue <- function(variant_values, other_mutation, all_varia
return(result)
} else if(length(variant_values) > 2){
result <- stats::cor.test(variant_values, other_variant_values)
- cells_som_alt <- sum(variant_values == 1)
- cells_som_ref <- sum(variant_values == 0)
- cells_MT_alt <- sum(other_variant_values == 1)
- cells_MT_ref <- sum(other_variant_values == 0)
+ if(value_type == "consensus"){
+ cells_som_alt <- sum(variant_values == 1)
+ cells_som_ref <- sum(variant_values == 0)
+ cells_MT_alt <- sum(other_variant_values == 1)
+ cells_MT_ref <- sum(other_variant_values == 0)
+ } else{
+ cells_som_alt <- sum(variant_values > 0)
+ cells_som_ref <- sum(variant_values == 0)
+ cells_MT_alt <- sum(other_variant_values > 0)
+ cells_MT_ref <- sum(other_variant_values == 0)
+ }
result <- c(result$p.value, result$estimate, cells_som_alt, cells_som_ref, cells_MT_alt, cells_MT_ref)
} else{
#print("We do not have more than 2 cells for the somatic variant.")
diff --git a/R/VariantWiseCorrelation.R b/R/VariantWiseCorrelation.R
index a9f6742..974d14c 100755
--- a/R/VariantWiseCorrelation.R
+++ b/R/VariantWiseCorrelation.R
@@ -8,8 +8,9 @@
#'@param n_cores Number of cores you want to use. Numeric.
#'@param p_value_adjustment Method for P value adjustment. See p.adjust for details.
#'@param verbose Should the function be verbose? Default = TRUE
+#'@param value_type Are we using consensus or other information?
#'@export
-VariantWiseCorrelation <- function(variants_list, n_cores = 1, p_value_adjustment = "fdr", verbose = TRUE){
+VariantWiseCorrelation <- function(variants_list, n_cores = 1, p_value_adjustment = "fdr", value_type = "consensus", verbose = TRUE){
# We correlate the somatic variants with each other and the MT variants.
# Since we have tens of thousands of MT variants, we do not correlate them with each other.
variants <- names(variants_list)
@@ -22,7 +23,7 @@ VariantWiseCorrelation <- function(variants_list, n_cores = 1, p_value_adjustmen
variants_values_use <- variants_list[[variant_use]]
variants_list_use <- variants_list[names(variants_list) != variant_use]
all_variants <- names(variants_list_use)
- results <- parallel::mclapply(X = all_variants, CalculateCorrelationPValue, variant_values = variants_values_use, all_variants_list = variants_list_use, mc.cores = n_cores)
+ results <- parallel::mclapply(X = all_variants, CalculateCorrelationPValue, variant_values = variants_values_use, all_variants_list = variants_list_use, mc.cores = n_cores, value_type = value_type)
results <- do.call("rbind", results)
results <- data.frame(Variant1 = variant_use, Variant2 = all_variants, P = results[,1], Corr = results[,2],
Cells_1_Alt = results[,3], Cells_1_Ref = results[,4], Cells_2_Alt = results[,5], Cells_2_Ref = results[,6])
diff --git a/README.md b/README.md
index d0d36ae..431f407 100755
--- 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.3.6
+# Current Features v0.3.7
- Loading data from VarTrix and MAEGATK.
- Transforming the data to be compatible for joint analysis.
diff --git a/man/CalculateCorrelationPValue.Rd b/man/CalculateCorrelationPValue.Rd
index 700f107..b32223c 100755
--- a/man/CalculateCorrelationPValue.Rd
+++ b/man/CalculateCorrelationPValue.Rd
@@ -8,16 +8,19 @@ CalculateCorrelationPValue(
variant_values,
other_mutation,
all_variants_list,
+ value_type = "consensus",
min_intersecting_cells = 5
)
}
\arguments{
-\item{variant_values}{The fraction values you are analysing. A vector.}
+\item{variant_values}{The fraction values you are analyzing. A vector.}
\item{other_mutation}{All other variants you have. A vector of variant names.}
\item{all_variants_list}{List of fraction values for all the variants you want to compare your variant with.}
+\item{value_type}{Are we using consensus or other information?}
+
\item{min_intersecting_cells}{Minimum number of intersecting cells. Correlations with less than this will not be performed.}
}
\description{
diff --git a/man/VariantWiseCorrelation.Rd b/man/VariantWiseCorrelation.Rd
index 410335b..1aa9e18 100755
--- a/man/VariantWiseCorrelation.Rd
+++ b/man/VariantWiseCorrelation.Rd
@@ -8,6 +8,7 @@ VariantWiseCorrelation(
variants_list,
n_cores = 1,
p_value_adjustment = "fdr",
+ value_type = "consensus",
verbose = TRUE
)
}
@@ -18,6 +19,8 @@ VariantWiseCorrelation(
\item{p_value_adjustment}{Method for P value adjustment. See p.adjust for details.}
+\item{value_type}{Are we using consensus or other information?}
+
\item{verbose}{Should the function be verbose? Default = TRUE}
}
\description{
From d42ee85bce994f12914e178b1dd7942604f6d24d Mon Sep 17 00:00:00 2001
From: mgrasshoff
Date: Tue, 15 Oct 2024 15:48:59 +0200
Subject: [PATCH 2/7] Fixing correlation with duplicative results.
---
R/VariantWiseCorrelation.R | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/R/VariantWiseCorrelation.R b/R/VariantWiseCorrelation.R
index 974d14c..6c2ef40 100755
--- a/R/VariantWiseCorrelation.R
+++ b/R/VariantWiseCorrelation.R
@@ -36,6 +36,10 @@ VariantWiseCorrelation <- function(variants_list, n_cores = 1, p_value_adjustmen
if(verbose) print("We remove the negative corrlated SNPs.")
results_total <- subset(results_total, Corr > 0)
+ if(verbose) print("Remove duplicative results.")
+ results_check <- apply(results_total[, c("Variant1", "Variant2")], 1, function(x) paste(sort(x), collapse = "_"))
+ results_total <- results_total[!duplicated(results_check), , drop = FALSE]
+
if(verbose) print(paste0("Adjusting P values using ", p_value_adjustment, "."))
results_total$P_adj <- stats::p.adjust(results_total$P, method = p_value_adjustment)
rownames(results_total) <- NULL
From 0d47563355ce05f0a0ffa0183f53ecf837385282 Mon Sep 17 00:00:00 2001
From: mgrasshoff
Date: Wed, 16 Oct 2024 11:55:00 +0200
Subject: [PATCH 3/7] Change group selection quantile subsetting.
---
DESCRIPTION | 2 +-
R/VariantSelection_Quantile.R | 12 ++++++------
README.md | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index e124e5b..417fefd 100755
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: sigurd
Type: Package
Title: Single cell Genotyping Using RNA Data
-Version: 0.3.7
+Version: 0.3.7.1
Authors@R: c(
person(given = "Martin",
family = "Grasshoff",
diff --git a/R/VariantSelection_Quantile.R b/R/VariantSelection_Quantile.R
index 680bc30..442c638 100755
--- a/R/VariantSelection_Quantile.R
+++ b/R/VariantSelection_Quantile.R
@@ -22,14 +22,14 @@ VariantSelection_Quantile <- function(SE, min_coverage = 2, quantiles = c(0.1, 0
SummarizedExperiment::assays(SE)[["fraction"]][nocall_check] <- NA
SummarizedExperiment::assays(SE)[["coverage"]][nocall_check] <- NA
}
-
+
if(verbose) print("Get the mean allele frequency and coverage.")
mean_af <- Matrix::rowMeans(SummarizedExperiment::assays(SE)[["fraction"]], na.rm = TRUE)
mean_cov <- Matrix::rowMeans(SummarizedExperiment::assays(SE)[["coverage"]], na.rm = TRUE)
-
+
if(verbose) print("Get the quantiles of the VAFs of each variant.")
quantiles <- lapply(quantiles, function(x) apply(SummarizedExperiment::assays(SE)[["fraction"]], 1, quantile, x, na.rm = TRUE))
-
+
# Apply min_quality filtering
if(!is.null(min_quality)){
vars <- data.frame(Mean_AF = mean_af, Mean_Cov = mean_cov, VariantQuality = SummarizedExperiment::rowData(SE)$VariantQuality, Quantile1 = quantiles[[1]], Quantile2 = quantiles[[2]])
@@ -37,9 +37,9 @@ VariantSelection_Quantile <- function(SE, min_coverage = 2, quantiles = c(0.1, 0
} else{
vars <- data.frame(Mean_AF = mean_af, Mean_Cov = mean_cov, Quantile1 = quantiles[[1]], Quantile2 = quantiles[[2]])
}
-
+
if(verbose) print("Thresholding using the quantile approach.")
- vois <- subset(vars, vars$Mean_AF > mean_allele_frequency & vars$Mean_Cov > min_coverage & vars$Quantile1 < thresholds[1] & vars$Quantile2 > thresholds[2])
-
+ vois <- subset(vars, vars$Mean_AF > mean_allele_frequency & vars$Mean_Cov > min_coverage & vars$Quantile1 <= thresholds[1] & vars$Quantile2 >= thresholds[2])
+
return(rownames(vois))
}
diff --git a/README.md b/README.md
index 431f407..21b2216 100755
--- 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.3.7
+# Current Features v0.3.7.1
- Loading data from VarTrix and MAEGATK.
- Transforming the data to be compatible for joint analysis.
From 26e54f1c63f7c50d340875130f4b4732e4747d1a Mon Sep 17 00:00:00 2001
From: mgrasshoff
Date: Mon, 11 Nov 2024 15:57:53 +0100
Subject: [PATCH 4/7] Fixed error for VMR selection.
---
DESCRIPTION | 2 +-
R/AllelFrequencyFoldChange.R | 0
R/AmpliconSupplementing.R | 0
R/CalculateAlleleFrequency.R | 0
R/CalculateAltReads.R | 0
R/CalculateConsensus.R | 0
R/CalculateCorrelationPValue.R | 0
R/CalculateCoverage.R | 0
R/CalculateFisherTestPValue.R | 0
R/CalculateQuality.R | 0
R/CalculateRefReads.R | 0
R/CalculateStrandCorrelation.R | 0
R/CallSupport.R | 0
R/ClonalDefinition.R | 0
R/ClonalDiversity.R | 0
R/CombineSEobjects.R | 0
R/Enrichment_Fisher.R | 0
R/Filtering.R | 0
R/GetCellInfoPerVariant.R | 0
R/GetVariantInfo.R | 0
R/HeatmapVOI.R | 0
R/LoadingMAEGATK_typewise.R | 0
R/LoadingRawMatrix_typewise.R | 0
R/LoadingVCF_typewise.R | 0
R/LoadingVarTrix_typewise.R | 0
R/Merging_SE_list.R | 0
R/RowWiseSplit.R | 0
R/SeparatingMatrixToList.R | 0
R/SetVariantInfo.R | 0
R/UMIQC.R | 0
R/UMI_seq.R | 0
R/VariantBurden.R | 0
R/VariantCloneSizeThresholding.R | 0
R/VariantCorrelationHeatmap.R | 0
R/VariantFisherTestHeatmap.R | 0
R/VariantQuantileThresholding_Combined.R | 0
R/VariantSelection_Group.R | 0
R/VariantSelection_Quantile.R | 0
R/VariantSelection_TopCells.R | 0
R/VariantSelection_VMR.R | 21 ++++++++++++++++-----
R/VariantWiseCorrelation.R | 0
R/VariantWiseFisherTest.R | 0
R/char_to_numeric.R | 0
R/combine_NAMES.R | 0
R/combine_SparseMatrix.R | 0
R/computeAFMutMatrix.R | 0
R/getAltMatrix.R | 0
R/getMutMatrix.R | 0
R/getReadMatrix.R | 0
R/getRefMatrix.R | 0
R/get_consensus.R | 0
R/load_object.R | 0
R/save_object.R | 0
R/sdiv.R | 0
README.md | 2 +-
55 files changed, 18 insertions(+), 7 deletions(-)
mode change 100755 => 100644 DESCRIPTION
mode change 100755 => 100644 R/AllelFrequencyFoldChange.R
mode change 100755 => 100644 R/AmpliconSupplementing.R
mode change 100755 => 100644 R/CalculateAlleleFrequency.R
mode change 100755 => 100644 R/CalculateAltReads.R
mode change 100755 => 100644 R/CalculateConsensus.R
mode change 100755 => 100644 R/CalculateCorrelationPValue.R
mode change 100755 => 100644 R/CalculateCoverage.R
mode change 100755 => 100644 R/CalculateFisherTestPValue.R
mode change 100755 => 100644 R/CalculateQuality.R
mode change 100755 => 100644 R/CalculateRefReads.R
mode change 100755 => 100644 R/CalculateStrandCorrelation.R
mode change 100755 => 100644 R/CallSupport.R
mode change 100755 => 100644 R/ClonalDefinition.R
mode change 100755 => 100644 R/ClonalDiversity.R
mode change 100755 => 100644 R/CombineSEobjects.R
mode change 100755 => 100644 R/Enrichment_Fisher.R
mode change 100755 => 100644 R/Filtering.R
mode change 100755 => 100644 R/GetCellInfoPerVariant.R
mode change 100755 => 100644 R/GetVariantInfo.R
mode change 100755 => 100644 R/HeatmapVOI.R
mode change 100755 => 100644 R/LoadingMAEGATK_typewise.R
mode change 100755 => 100644 R/LoadingRawMatrix_typewise.R
mode change 100755 => 100644 R/LoadingVCF_typewise.R
mode change 100755 => 100644 R/LoadingVarTrix_typewise.R
mode change 100755 => 100644 R/Merging_SE_list.R
mode change 100755 => 100644 R/RowWiseSplit.R
mode change 100755 => 100644 R/SeparatingMatrixToList.R
mode change 100755 => 100644 R/SetVariantInfo.R
mode change 100755 => 100644 R/UMIQC.R
mode change 100755 => 100644 R/UMI_seq.R
mode change 100755 => 100644 R/VariantBurden.R
mode change 100755 => 100644 R/VariantCloneSizeThresholding.R
mode change 100755 => 100644 R/VariantCorrelationHeatmap.R
mode change 100755 => 100644 R/VariantFisherTestHeatmap.R
mode change 100755 => 100644 R/VariantQuantileThresholding_Combined.R
mode change 100755 => 100644 R/VariantSelection_Group.R
mode change 100755 => 100644 R/VariantSelection_Quantile.R
mode change 100755 => 100644 R/VariantSelection_TopCells.R
mode change 100755 => 100644 R/VariantWiseCorrelation.R
mode change 100755 => 100644 R/VariantWiseFisherTest.R
mode change 100755 => 100644 R/char_to_numeric.R
mode change 100755 => 100644 R/combine_NAMES.R
mode change 100755 => 100644 R/combine_SparseMatrix.R
mode change 100755 => 100644 R/computeAFMutMatrix.R
mode change 100755 => 100644 R/getAltMatrix.R
mode change 100755 => 100644 R/getMutMatrix.R
mode change 100755 => 100644 R/getReadMatrix.R
mode change 100755 => 100644 R/getRefMatrix.R
mode change 100755 => 100644 R/get_consensus.R
mode change 100755 => 100644 R/load_object.R
mode change 100755 => 100644 R/save_object.R
mode change 100755 => 100644 R/sdiv.R
mode change 100755 => 100644 README.md
diff --git a/DESCRIPTION b/DESCRIPTION
old mode 100755
new mode 100644
index 417fefd..26976cc
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: sigurd
Type: Package
Title: Single cell Genotyping Using RNA Data
-Version: 0.3.7.1
+Version: 0.3.8
Authors@R: c(
person(given = "Martin",
family = "Grasshoff",
diff --git a/R/AllelFrequencyFoldChange.R b/R/AllelFrequencyFoldChange.R
old mode 100755
new mode 100644
diff --git a/R/AmpliconSupplementing.R b/R/AmpliconSupplementing.R
old mode 100755
new mode 100644
diff --git a/R/CalculateAlleleFrequency.R b/R/CalculateAlleleFrequency.R
old mode 100755
new mode 100644
diff --git a/R/CalculateAltReads.R b/R/CalculateAltReads.R
old mode 100755
new mode 100644
diff --git a/R/CalculateConsensus.R b/R/CalculateConsensus.R
old mode 100755
new mode 100644
diff --git a/R/CalculateCorrelationPValue.R b/R/CalculateCorrelationPValue.R
old mode 100755
new mode 100644
diff --git a/R/CalculateCoverage.R b/R/CalculateCoverage.R
old mode 100755
new mode 100644
diff --git a/R/CalculateFisherTestPValue.R b/R/CalculateFisherTestPValue.R
old mode 100755
new mode 100644
diff --git a/R/CalculateQuality.R b/R/CalculateQuality.R
old mode 100755
new mode 100644
diff --git a/R/CalculateRefReads.R b/R/CalculateRefReads.R
old mode 100755
new mode 100644
diff --git a/R/CalculateStrandCorrelation.R b/R/CalculateStrandCorrelation.R
old mode 100755
new mode 100644
diff --git a/R/CallSupport.R b/R/CallSupport.R
old mode 100755
new mode 100644
diff --git a/R/ClonalDefinition.R b/R/ClonalDefinition.R
old mode 100755
new mode 100644
diff --git a/R/ClonalDiversity.R b/R/ClonalDiversity.R
old mode 100755
new mode 100644
diff --git a/R/CombineSEobjects.R b/R/CombineSEobjects.R
old mode 100755
new mode 100644
diff --git a/R/Enrichment_Fisher.R b/R/Enrichment_Fisher.R
old mode 100755
new mode 100644
diff --git a/R/Filtering.R b/R/Filtering.R
old mode 100755
new mode 100644
diff --git a/R/GetCellInfoPerVariant.R b/R/GetCellInfoPerVariant.R
old mode 100755
new mode 100644
diff --git a/R/GetVariantInfo.R b/R/GetVariantInfo.R
old mode 100755
new mode 100644
diff --git a/R/HeatmapVOI.R b/R/HeatmapVOI.R
old mode 100755
new mode 100644
diff --git a/R/LoadingMAEGATK_typewise.R b/R/LoadingMAEGATK_typewise.R
old mode 100755
new mode 100644
diff --git a/R/LoadingRawMatrix_typewise.R b/R/LoadingRawMatrix_typewise.R
old mode 100755
new mode 100644
diff --git a/R/LoadingVCF_typewise.R b/R/LoadingVCF_typewise.R
old mode 100755
new mode 100644
diff --git a/R/LoadingVarTrix_typewise.R b/R/LoadingVarTrix_typewise.R
old mode 100755
new mode 100644
diff --git a/R/Merging_SE_list.R b/R/Merging_SE_list.R
old mode 100755
new mode 100644
diff --git a/R/RowWiseSplit.R b/R/RowWiseSplit.R
old mode 100755
new mode 100644
diff --git a/R/SeparatingMatrixToList.R b/R/SeparatingMatrixToList.R
old mode 100755
new mode 100644
diff --git a/R/SetVariantInfo.R b/R/SetVariantInfo.R
old mode 100755
new mode 100644
diff --git a/R/UMIQC.R b/R/UMIQC.R
old mode 100755
new mode 100644
diff --git a/R/UMI_seq.R b/R/UMI_seq.R
old mode 100755
new mode 100644
diff --git a/R/VariantBurden.R b/R/VariantBurden.R
old mode 100755
new mode 100644
diff --git a/R/VariantCloneSizeThresholding.R b/R/VariantCloneSizeThresholding.R
old mode 100755
new mode 100644
diff --git a/R/VariantCorrelationHeatmap.R b/R/VariantCorrelationHeatmap.R
old mode 100755
new mode 100644
diff --git a/R/VariantFisherTestHeatmap.R b/R/VariantFisherTestHeatmap.R
old mode 100755
new mode 100644
diff --git a/R/VariantQuantileThresholding_Combined.R b/R/VariantQuantileThresholding_Combined.R
old mode 100755
new mode 100644
diff --git a/R/VariantSelection_Group.R b/R/VariantSelection_Group.R
old mode 100755
new mode 100644
diff --git a/R/VariantSelection_Quantile.R b/R/VariantSelection_Quantile.R
old mode 100755
new mode 100644
diff --git a/R/VariantSelection_TopCells.R b/R/VariantSelection_TopCells.R
old mode 100755
new mode 100644
diff --git a/R/VariantSelection_VMR.R b/R/VariantSelection_VMR.R
index bc397d8..f97334c 100644
--- a/R/VariantSelection_VMR.R
+++ b/R/VariantSelection_VMR.R
@@ -18,7 +18,20 @@ VariantSelection_VMR <- function(SE, stabilize_variance = TRUE, low_coverage_thr
fraction[is.na(fraction)] <- 0
mean_af <- Matrix::rowSums(SummarizedExperiment::assays(SE)[["alts"]]) / Matrix::rowSums(SummarizedExperiment::assays(SE)[["coverage"]])
mean_af[is.na(mean_af)] <- 0
-
+
+ if(verbose) print("We calculate the concordance.")
+ reads_forward <- SummarizedExperiment::assays(SE)[["forward"]]
+ reads_reverse <- SummarizedExperiment::assays(SE)[["reverse"]]
+ dt <- merge(data.table::data.table(summary(reads_forward)),
+ data.table::data.table(summary(reads_reverse)),
+ by.x = c("i", "j"), by.y = c("i", "j"),
+ all = TRUE)
+ dt <- dt[dt[,x.x] > 0 | dt[,x.y] > 0,]
+ dt <- data.table::data.table(variant = rownames(SE)[dt[[1]]],
+ cell_id = dt[[2]],
+ fw = dt[[3]], rev = dt[[4]])
+ concordance <- dt[, .(cor = suppressWarnings(stats::cor(c(fw), c(rev), method = "pearson", use = "pairwise.complete"))), by = list(variant)]
+
if(stabilize_variance){
if(verbose) print("We stabilize the variance.")
coverage <- SummarizedExperiment::assays(SE)[["coverage"]]
@@ -42,7 +55,7 @@ VariantSelection_VMR <- function(SE, stabilize_variance = TRUE, low_coverage_thr
if(verbose) print(paste0("We check if a cells has more than ", minimum_fw_rev_reads, " reads."))
detected <- (SummarizedExperiment::assays(SE)[["forward"]] >= minimum_fw_rev_reads) + (assays(SE)[["reverse"]] >= minimum_fw_rev_reads)
-
+
voi <- data.frame(
variant = rownames(detected),
vmr = variants_variance / (mean_af + 0.00000000001),
@@ -50,11 +63,9 @@ VariantSelection_VMR <- function(SE, stabilize_variance = TRUE, low_coverage_thr
mean = round(mean_af, 7),
variance = round(variants_variance, 7),
cells_detected = Matrix::rowSums(detected == 2), # We only select cells that have enough reads for both directions.
- strand_correlation = SummarizedExperiment::rowData(SE)$Concordance,
+ strand_correlation = concordance$cor, #SummarizedExperiment::rowData(SE)$Concordance,
mean_coverage = Matrix::rowMeans(SummarizedExperiment::assays(SE)[["coverage"]]),
stringsAsFactors = FALSE, row.names = rownames(detected)
)
return(voi)
}
-
-
diff --git a/R/VariantWiseCorrelation.R b/R/VariantWiseCorrelation.R
old mode 100755
new mode 100644
diff --git a/R/VariantWiseFisherTest.R b/R/VariantWiseFisherTest.R
old mode 100755
new mode 100644
diff --git a/R/char_to_numeric.R b/R/char_to_numeric.R
old mode 100755
new mode 100644
diff --git a/R/combine_NAMES.R b/R/combine_NAMES.R
old mode 100755
new mode 100644
diff --git a/R/combine_SparseMatrix.R b/R/combine_SparseMatrix.R
old mode 100755
new mode 100644
diff --git a/R/computeAFMutMatrix.R b/R/computeAFMutMatrix.R
old mode 100755
new mode 100644
diff --git a/R/getAltMatrix.R b/R/getAltMatrix.R
old mode 100755
new mode 100644
diff --git a/R/getMutMatrix.R b/R/getMutMatrix.R
old mode 100755
new mode 100644
diff --git a/R/getReadMatrix.R b/R/getReadMatrix.R
old mode 100755
new mode 100644
diff --git a/R/getRefMatrix.R b/R/getRefMatrix.R
old mode 100755
new mode 100644
diff --git a/R/get_consensus.R b/R/get_consensus.R
old mode 100755
new mode 100644
diff --git a/R/load_object.R b/R/load_object.R
old mode 100755
new mode 100644
diff --git a/R/save_object.R b/R/save_object.R
old mode 100755
new mode 100644
diff --git a/R/sdiv.R b/R/sdiv.R
old mode 100755
new mode 100644
diff --git a/README.md b/README.md
old mode 100755
new mode 100644
index 21b2216..5f647af
--- 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.3.7.1
+# Current Features v0.3.8
- Loading data from VarTrix and MAEGATK.
- Transforming the data to be compatible for joint analysis.
From bbe8d7c45ee07c46251a95cc8eabe58d2ce021a4 Mon Sep 17 00:00:00 2001
From: mgrasshoff
Date: Tue, 12 Nov 2024 11:11:09 +0100
Subject: [PATCH 5/7] New vignette
---
docs/404.html | 2 +-
docs/ReadMe.html | 0
docs/_config.yml | 0
docs/articles/BoneMarrow_SIGURD.html | 2 +-
.../figure-html/Vis_SIGURD-1.pdf | Bin
.../figure-html/Vis_SIGURD-1.png | Bin
.../figure-html/unnamed-chunk-3-1.png | Bin
.../figure-html/unnamed-chunk-4-1.png | Bin
docs/articles/MPN_SIGURD.html | 72 ++++----
.../figure-html/DEGs_OrthoE_JAK2V617F-1.png | Bin 129424 -> 115500 bytes
.../figure-html/PlottingJAK2V617F-1.png | Bin 0 -> 144567 bytes
.../figure-html/PlottingLineages_MPN1-1.png | Bin 0 -> 29440 bytes
.../figure-html/unnamed-chunk-2-1.png | Bin
.../figure-html/unnamed-chunk-3-1.png | Bin
.../figure-html/unnamed-chunk-4-1.png | Bin 35354 -> 29440 bytes
docs/articles/SW_CellMixture_SIGURD.html | 2 +-
.../figure-html/unnamed-chunk-4-1.png | Bin
.../figure-html/unnamed-chunk-6-1.png | Bin
docs/articles/TenX_CellMixture_SIGURD.html | 2 +-
.../figure-html/unnamed-chunk-4-1.png | Bin
.../figure-html/unnamed-chunk-5-1.png | Bin
docs/articles/index.html | 2 +-
docs/authors.html | 6 +-
.../bootstrap-toc-1.0.1/bootstrap-toc.min.js | 0
.../deps/clipboard.js-2.0.11/clipboard.min.js | 0
docs/deps/data-deps.txt | 0
docs/deps/font-awesome-6.4.2/css/all.css | 0
docs/deps/font-awesome-6.4.2/css/all.min.css | 0
docs/deps/font-awesome-6.4.2/css/v4-shims.css | 0
.../font-awesome-6.4.2/css/v4-shims.min.css | 0
.../webfonts/fa-brands-400.ttf | Bin
.../webfonts/fa-brands-400.woff2 | Bin
.../webfonts/fa-regular-400.ttf | Bin
.../webfonts/fa-regular-400.woff2 | Bin
.../webfonts/fa-solid-900.ttf | Bin
.../webfonts/fa-solid-900.woff2 | Bin
.../webfonts/fa-v4compatibility.ttf | Bin
.../webfonts/fa-v4compatibility.woff2 | Bin
docs/deps/headroom-0.11.0/headroom.min.js | 0
.../headroom-0.11.0/jQuery.headroom.min.js | 0
.../search-1.0.0/autocomplete.jquery.min.js | 0
docs/deps/search-1.0.0/fuse.min.js | 0
docs/deps/search-1.0.0/mark.min.js | 0
docs/index.html | 4 +-
docs/katex-auto.js | 0
docs/lightswitch.js | 0
docs/link.svg | 0
docs/pkgdown.js | 0
docs/pkgdown.yml | 2 +-
docs/reference/AllelFrequencyFoldChange.html | 2 +-
docs/reference/AmpliconSupplementing.html | 2 +-
docs/reference/AmpliconSupplementing_big.html | 0
docs/reference/CalculateAlleleFrequency.html | 2 +-
docs/reference/CalculateAltReads.html | 2 +-
docs/reference/CalculateConsensus.html | 2 +-
.../reference/CalculateCorrelationPValue.html | 9 +-
docs/reference/CalculateCoverage.html | 2 +-
docs/reference/CalculateFisherTestPValue.html | 2 +-
.../reference/CalculateFisherTestPValue2.html | 0
docs/reference/CalculateForwardReads.html | 87 +++++++++
docs/reference/CalculateQuality.html | 2 +-
docs/reference/CalculateRefReads.html | 2 +-
docs/reference/CalculateReverseReads.html | 87 +++++++++
.../reference/CalculateStrandCorrelation.html | 2 +-
docs/reference/CallSupport.html | 2 +-
docs/reference/ClonalDefinition.html | 2 +-
docs/reference/ClonalDiversity.html | 2 +-
docs/reference/CombineSEobjects.html | 8 +-
docs/reference/CombineSEobjects_big.html | 0
docs/reference/Enrichment_FisherTest.html | 2 +-
docs/reference/Filtering.html | 2 +-
docs/reference/Filtering_big.html | 0
docs/reference/GetCellInfoPerVariant.html | 2 +-
docs/reference/GetVariantInfo.html | 2 +-
docs/reference/HeatmapVoi.html | 2 +-
docs/reference/LoadingMAEGATK_typewise.html | 2 +-
docs/reference/LoadingMGATK_typewise.html | 169 ++++++++++++++++++
docs/reference/LoadingRawMatrix_typewise.html | 2 +-
docs/reference/LoadingVCF_typewise.html | 2 +-
docs/reference/LoadingVarTrix.html | 0
docs/reference/LoadingVarTrix_ori.html | 0
docs/reference/LoadingVarTrix_typewise.html | 2 +-
.../LoadingVarTrix_typewise_big.html | 0
docs/reference/Merging_SE_list.html | 2 +-
docs/reference/RowWiseSplit.html | 20 ++-
docs/reference/Rplot001.png | Bin
docs/reference/SeparatingMatrixToList.html | 14 +-
docs/reference/SetVariantInfo.html | 2 +-
docs/reference/UMIQC.html | 2 +-
docs/reference/UMI_seq.html | 2 +-
docs/reference/VariantBurden.html | 2 +-
docs/reference/VariantBurden_big.html | 0
.../VariantCloneSizeThresholding.html | 2 +-
docs/reference/VariantCorrelationHeatmap.html | 2 +-
docs/reference/VariantFisherTestHeatmap.html | 2 +-
.../VariantQuantileThresholding.html | 0
.../VariantQuantileThresholding_Combined.html | 2 +-
docs/reference/VariantSelection_Group.html | 2 +-
docs/reference/VariantSelection_Quantile.html | 2 +-
docs/reference/VariantSelection_TopCells.html | 2 +-
docs/reference/VariantSelection_VMR.html | 108 +++++++++++
docs/reference/VariantWiseCorrelation.html | 7 +-
docs/reference/VariantWiseFisherTest.html | 2 +-
docs/reference/char_to_numeric.html | 2 +-
docs/reference/combine_NAMES.html | 2 +-
docs/reference/combine_SparseMatrix.html | 2 +-
docs/reference/computeAFMutMatrix.html | 2 +-
docs/reference/getAltMatrix.html | 2 +-
docs/reference/getMutMatrix.html | 2 +-
docs/reference/getReadMatrix.html | 2 +-
docs/reference/getRefMatrix.html | 2 +-
docs/reference/get_consensus.html | 2 +-
docs/reference/ggsci_pal.html | 0
docs/reference/index.html | 22 ++-
docs/reference/load_object.html | 2 +-
docs/reference/save_object.html | 2 +-
docs/reference/sdiv.html | 2 +-
docs/search.json | 2 +-
docs/sitemap.xml | 12 ++
119 files changed, 632 insertions(+), 101 deletions(-)
mode change 100755 => 100644 docs/404.html
mode change 100755 => 100644 docs/ReadMe.html
mode change 100755 => 100644 docs/_config.yml
mode change 100755 => 100644 docs/articles/BoneMarrow_SIGURD.html
mode change 100755 => 100644 docs/articles/BoneMarrow_SIGURD_files/figure-html/Vis_SIGURD-1.pdf
mode change 100755 => 100644 docs/articles/BoneMarrow_SIGURD_files/figure-html/Vis_SIGURD-1.png
mode change 100755 => 100644 docs/articles/BoneMarrow_SIGURD_files/figure-html/unnamed-chunk-3-1.png
mode change 100755 => 100644 docs/articles/BoneMarrow_SIGURD_files/figure-html/unnamed-chunk-4-1.png
mode change 100755 => 100644 docs/articles/MPN_SIGURD.html
mode change 100755 => 100644 docs/articles/MPN_SIGURD_files/figure-html/DEGs_OrthoE_JAK2V617F-1.png
create mode 100644 docs/articles/MPN_SIGURD_files/figure-html/PlottingJAK2V617F-1.png
create mode 100644 docs/articles/MPN_SIGURD_files/figure-html/PlottingLineages_MPN1-1.png
mode change 100755 => 100644 docs/articles/MPN_SIGURD_files/figure-html/unnamed-chunk-2-1.png
mode change 100755 => 100644 docs/articles/MPN_SIGURD_files/figure-html/unnamed-chunk-3-1.png
mode change 100755 => 100644 docs/articles/MPN_SIGURD_files/figure-html/unnamed-chunk-4-1.png
mode change 100755 => 100644 docs/articles/SW_CellMixture_SIGURD.html
mode change 100755 => 100644 docs/articles/SW_CellMixture_SIGURD_files/figure-html/unnamed-chunk-4-1.png
mode change 100755 => 100644 docs/articles/SW_CellMixture_SIGURD_files/figure-html/unnamed-chunk-6-1.png
mode change 100755 => 100644 docs/articles/TenX_CellMixture_SIGURD.html
mode change 100755 => 100644 docs/articles/TenX_CellMixture_SIGURD_files/figure-html/unnamed-chunk-4-1.png
mode change 100755 => 100644 docs/articles/TenX_CellMixture_SIGURD_files/figure-html/unnamed-chunk-5-1.png
mode change 100755 => 100644 docs/articles/index.html
mode change 100755 => 100644 docs/authors.html
mode change 100755 => 100644 docs/deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js
mode change 100755 => 100644 docs/deps/clipboard.js-2.0.11/clipboard.min.js
mode change 100755 => 100644 docs/deps/data-deps.txt
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/css/all.css
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/css/all.min.css
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/css/v4-shims.css
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/css/v4-shims.min.css
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf
mode change 100755 => 100644 docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2
mode change 100755 => 100644 docs/deps/headroom-0.11.0/headroom.min.js
mode change 100755 => 100644 docs/deps/headroom-0.11.0/jQuery.headroom.min.js
mode change 100755 => 100644 docs/deps/search-1.0.0/autocomplete.jquery.min.js
mode change 100755 => 100644 docs/deps/search-1.0.0/fuse.min.js
mode change 100755 => 100644 docs/deps/search-1.0.0/mark.min.js
mode change 100755 => 100644 docs/index.html
mode change 100755 => 100644 docs/katex-auto.js
mode change 100755 => 100644 docs/lightswitch.js
mode change 100755 => 100644 docs/link.svg
mode change 100755 => 100644 docs/pkgdown.js
mode change 100755 => 100644 docs/pkgdown.yml
mode change 100755 => 100644 docs/reference/AllelFrequencyFoldChange.html
mode change 100755 => 100644 docs/reference/AmpliconSupplementing.html
mode change 100755 => 100644 docs/reference/AmpliconSupplementing_big.html
mode change 100755 => 100644 docs/reference/CalculateAlleleFrequency.html
mode change 100755 => 100644 docs/reference/CalculateAltReads.html
mode change 100755 => 100644 docs/reference/CalculateConsensus.html
mode change 100755 => 100644 docs/reference/CalculateCorrelationPValue.html
mode change 100755 => 100644 docs/reference/CalculateCoverage.html
mode change 100755 => 100644 docs/reference/CalculateFisherTestPValue.html
mode change 100755 => 100644 docs/reference/CalculateFisherTestPValue2.html
create mode 100644 docs/reference/CalculateForwardReads.html
mode change 100755 => 100644 docs/reference/CalculateQuality.html
mode change 100755 => 100644 docs/reference/CalculateRefReads.html
create mode 100644 docs/reference/CalculateReverseReads.html
mode change 100755 => 100644 docs/reference/CalculateStrandCorrelation.html
mode change 100755 => 100644 docs/reference/CallSupport.html
mode change 100755 => 100644 docs/reference/ClonalDefinition.html
mode change 100755 => 100644 docs/reference/ClonalDiversity.html
mode change 100755 => 100644 docs/reference/CombineSEobjects.html
mode change 100755 => 100644 docs/reference/CombineSEobjects_big.html
mode change 100755 => 100644 docs/reference/Enrichment_FisherTest.html
mode change 100755 => 100644 docs/reference/Filtering.html
mode change 100755 => 100644 docs/reference/Filtering_big.html
mode change 100755 => 100644 docs/reference/GetCellInfoPerVariant.html
mode change 100755 => 100644 docs/reference/GetVariantInfo.html
mode change 100755 => 100644 docs/reference/HeatmapVoi.html
mode change 100755 => 100644 docs/reference/LoadingMAEGATK_typewise.html
create mode 100644 docs/reference/LoadingMGATK_typewise.html
mode change 100755 => 100644 docs/reference/LoadingRawMatrix_typewise.html
mode change 100755 => 100644 docs/reference/LoadingVCF_typewise.html
mode change 100755 => 100644 docs/reference/LoadingVarTrix.html
mode change 100755 => 100644 docs/reference/LoadingVarTrix_ori.html
mode change 100755 => 100644 docs/reference/LoadingVarTrix_typewise.html
mode change 100755 => 100644 docs/reference/LoadingVarTrix_typewise_big.html
mode change 100755 => 100644 docs/reference/Merging_SE_list.html
mode change 100755 => 100644 docs/reference/RowWiseSplit.html
mode change 100755 => 100644 docs/reference/Rplot001.png
mode change 100755 => 100644 docs/reference/SeparatingMatrixToList.html
mode change 100755 => 100644 docs/reference/SetVariantInfo.html
mode change 100755 => 100644 docs/reference/UMIQC.html
mode change 100755 => 100644 docs/reference/UMI_seq.html
mode change 100755 => 100644 docs/reference/VariantBurden.html
mode change 100755 => 100644 docs/reference/VariantBurden_big.html
mode change 100755 => 100644 docs/reference/VariantCloneSizeThresholding.html
mode change 100755 => 100644 docs/reference/VariantCorrelationHeatmap.html
mode change 100755 => 100644 docs/reference/VariantFisherTestHeatmap.html
mode change 100755 => 100644 docs/reference/VariantQuantileThresholding.html
mode change 100755 => 100644 docs/reference/VariantQuantileThresholding_Combined.html
mode change 100755 => 100644 docs/reference/VariantSelection_Group.html
mode change 100755 => 100644 docs/reference/VariantSelection_Quantile.html
mode change 100755 => 100644 docs/reference/VariantSelection_TopCells.html
create mode 100644 docs/reference/VariantSelection_VMR.html
mode change 100755 => 100644 docs/reference/VariantWiseCorrelation.html
mode change 100755 => 100644 docs/reference/VariantWiseFisherTest.html
mode change 100755 => 100644 docs/reference/char_to_numeric.html
mode change 100755 => 100644 docs/reference/combine_NAMES.html
mode change 100755 => 100644 docs/reference/combine_SparseMatrix.html
mode change 100755 => 100644 docs/reference/computeAFMutMatrix.html
mode change 100755 => 100644 docs/reference/getAltMatrix.html
mode change 100755 => 100644 docs/reference/getMutMatrix.html
mode change 100755 => 100644 docs/reference/getReadMatrix.html
mode change 100755 => 100644 docs/reference/getRefMatrix.html
mode change 100755 => 100644 docs/reference/get_consensus.html
mode change 100755 => 100644 docs/reference/ggsci_pal.html
mode change 100755 => 100644 docs/reference/index.html
mode change 100755 => 100644 docs/reference/load_object.html
mode change 100755 => 100644 docs/reference/save_object.html
mode change 100755 => 100644 docs/reference/sdiv.html
mode change 100755 => 100644 docs/search.json
mode change 100755 => 100644 docs/sitemap.xml
diff --git a/docs/404.html b/docs/404.html
old mode 100755
new mode 100644
index cdf7f65..793d306
--- a/docs/404.html
+++ b/docs/404.html
@@ -24,7 +24,7 @@
sigurd
- 0.3.2
+ 0.3.8
diff --git a/docs/ReadMe.html b/docs/ReadMe.html
old mode 100755
new mode 100644
diff --git a/docs/_config.yml b/docs/_config.yml
old mode 100755
new mode 100644
diff --git a/docs/articles/BoneMarrow_SIGURD.html b/docs/articles/BoneMarrow_SIGURD.html
old mode 100755
new mode 100644
index 72317d7..92e9777
--- a/docs/articles/BoneMarrow_SIGURD.html
+++ b/docs/articles/BoneMarrow_SIGURD.html
@@ -26,7 +26,7 @@
sigurd
- 0.3.2
+ 0.3.8
diff --git a/docs/articles/BoneMarrow_SIGURD_files/figure-html/Vis_SIGURD-1.pdf b/docs/articles/BoneMarrow_SIGURD_files/figure-html/Vis_SIGURD-1.pdf
old mode 100755
new mode 100644
diff --git a/docs/articles/BoneMarrow_SIGURD_files/figure-html/Vis_SIGURD-1.png b/docs/articles/BoneMarrow_SIGURD_files/figure-html/Vis_SIGURD-1.png
old mode 100755
new mode 100644
diff --git a/docs/articles/BoneMarrow_SIGURD_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/BoneMarrow_SIGURD_files/figure-html/unnamed-chunk-3-1.png
old mode 100755
new mode 100644
diff --git a/docs/articles/BoneMarrow_SIGURD_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/BoneMarrow_SIGURD_files/figure-html/unnamed-chunk-4-1.png
old mode 100755
new mode 100644
diff --git a/docs/articles/MPN_SIGURD.html b/docs/articles/MPN_SIGURD.html
old mode 100755
new mode 100644
index a9a1d02..e9d496c
--- a/docs/articles/MPN_SIGURD.html
+++ b/docs/articles/MPN_SIGURD.html
@@ -26,7 +26,7 @@
sigurd
- 0.3.2
+ 0.3.8
@@ -96,15 +96,18 @@
# Loading the scRNA-seq data.
-scrna <- load_object ( "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/scrna_MPN.rds.lz4" )
+scrna <- load_object ( "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/Paper_Figures/ZenodoFiles/Zenodo_Seurat_Object.rds" )
# Loading the genotyping data.
-genotyping <- LoadingVarTrix_typewise ( patient = "MPN" , samples_file = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/DesignMatrix_VarTrix.csv" , min_reads = 0 , vcf_path = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/CosmicSubset_JAK2V617F.vcf" , type_use = "scRNAseq_Somatic" , min_cells = 0 , verbose = FALSE )
-amplicon <- LoadingVarTrix_typewise ( patient = "MPN" , samples_file = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/DesignMatrix_Amplicon.csv" , min_reads = 0 , vcf_path = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/CosmicSubset_UCSC_JAK2V617F.vcf" , type_use = "scRNAseq_Amplicon" , min_cells = 0 , verbose = FALSE )
-genotyping <- AmpliconSupplementing ( scRNAseq = genotyping , amplicon = amplicon , verbose = FALSE )
+# genotyping <- LoadingVarTrix_typewise(patient = "MPN", samples_file = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/DesignMatrix_VarTrix.csv", min_reads = 0, vcf_path = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/CosmicSubset_JAK2V617F.vcf", type_use = "scRNAseq_Somatic", min_cells = 0, verbose = FALSE)
+# amplicon <- LoadingVarTrix_typewise(patient = "MPN", samples_file = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/DesignMatrix_Amplicon.csv", min_reads = 0, vcf_path = "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/CosmicSubset_UCSC_JAK2V617F.vcf", type_use = "scRNAseq_Amplicon", min_cells = 0, verbose = FALSE)
+# genotyping <- AmpliconSupplementing(scRNAseq = genotyping, amplicon = amplicon, verbose = FALSE)
# Filtering the genotyping object to remove false positives.
-genotyping <- Filtering ( genotyping , min_cells_per_variant = 0 , fraction_threshold = 0.21 , cells_include = colnames ( scrna ) , min_variants_per_cell = 1 , reject_value = "NoCall" , verbose = FALSE )
+# genotyping <- Filtering(genotyping, min_cells_per_variant = 0, fraction_threshold = 0.21, cells_include = colnames(scrna), min_variants_per_cell = 1, reject_value = "NoCall", verbose = FALSE)
+
+# We load the provided genotyping object.
+genotyping <- load_object ( "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/MPN_JAK2V617F_Genotyping.rds" )
Selecting variants of interest for all samples
@@ -244,18 +256,18 @@ Selecting variants of in
# Determining the clonal lineages. This takes very long. We use parallel computing to process all samples simultaneously.
genotyping_mt_all <- parallel :: mclapply ( 1 : length ( mt_vois_all ) , function ( x ) {
sample_use <- names ( mt_vois_all ) [ x ]
- clones <- sigurd :: ClonalDefinition ( se = genotyping_mt_all [[ sample_use ] ] , mt_vois_all [ sample_use ] , verbose = FALSE )
+ clones <- ClonalDefinition ( se = genotyping_mt_all [[ sample_use ] ] , mt_vois_all [ sample_use ] , verbose = FALSE )
return ( clones )
} , mc.cores = length ( mt_vois_all ) )
names ( genotyping_mt_all ) <- patients
-save_object ( genotyping_mt_all , "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/sigurd/data/genotyping_mt_all.rds.lz4" , "lz4" )
+save_object ( genotyping_mt_all , "/data/MPN/exp/scRNA/MPN_mutations/SIGURD_paper/Paper_Figures/ZenodoFiles/genotyping_mt_all.rds.lz4" , "lz4" )