Skip to content

Commit

Permalink
Merge pull request #31 from CostaLab/devel
Browse files Browse the repository at this point in the history
Fixed loading bug after updating to R4.4.
  • Loading branch information
grasshoffm authored Jul 10, 2024
2 parents 00a3f3a + 6d5fd62 commit 48149c4
Show file tree
Hide file tree
Showing 74 changed files with 771 additions and 369 deletions.
27 changes: 14 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Package: sigurd
Type: Package
Title: Single cell Genotyping Using RNA Data
Version: 0.2.51
Version: 0.2.52
Authors@R: c(
person(given = "Martin",
family = "Grasshoff",
role = c("aut", "cre"),
email = "[email protected]"),
person(given = "Ivan Costa",
family = "Gesteira",
person(given = "Ivan",
family = "Costa",
role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-2890-8697")))
Expand All @@ -26,31 +26,32 @@ Imports:
data.table,
dplyr,
DropletUtils,
fastmatch,
GenomeInfoDb,
ggplot2,
grid,
Matrix,
MatrixGenerics,
magrittr,
methods,
parallel,
rcompanion,
S4Vectors,
Seurat,
SummarizedExperiment,
scales,
tibble,
tidyr,
tidyverse,
VariantAnnotation
RoxygenNote: 7.2.3
VariantAnnotation,
vegan
RoxygenNote: 7.3.2
Suggests:
GenomicRanges,
fastmatch,
ggplot2,
IRanges,
knitr,
magrittr,
MatrixGenerics,
rcompanion,
rmarkdown,
SeuratObject,
testthat (>= 3.0.0)
testthat (>= 3.0.0),
tidyr,
tidyverse
VignetteBuilder: knitr
Config/testthat/edition: 3
16 changes: 8 additions & 8 deletions R/CalculateStrandCorrelation.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ CalculateStrandCorrelation <- function(SE, chromosome_prefix = "chrM"){
dt <- merge(data.table::data.table(summary(reads_A_fw)),
data.table::data.table(summary(reads_A_rev)),
by.x = c("i", "j"), by.y = c("i", "j"),
all = TRUE)[x.x >0 | x.y >0]
all = TRUE)
dt <- dt[dt[,x.x] > 0 | dt[,x.y] > 0,]
dt <- data.table::data.table(variant = variants_A[dt[[1]]],
cell_id = dt[[2]],
fw = dt[[3]], rev = dt[[4]])
Expand All @@ -34,14 +35,11 @@ CalculateStrandCorrelation <- function(SE, chromosome_prefix = "chrM"){
rownames(reads_C_rev) <- paste0(chromosome_prefix, "_", 1:nrow(reads_C_rev), "_", ref_allele, "_C")
reads_C_fw <- reads_C_fw[ref_allele != "C",]
reads_C_rev <- reads_C_rev[ref_allele != "C",]
# dt <- merge(data.table::data.table(summary(reads_C_fw)),
# data.table::data.table(summary(reads_C_rev)),
# by.x = c("i", "j"), by.y = c("i", "j"),
# all = TRUE)[x.x > 0 | x.y > 0]
dt <- merge(data.table::data.table(summary(reads_C_fw)),
data.table::data.table(summary(reads_C_rev)),
by.x = c("i", "j"), by.y = c("i", "j"),
all = TRUE)[!!dplyr::sym("x.x") > 0 | !!dplyr::sym("x.y") > 0]
all = TRUE)
dt <- dt[dt[,x.x] > 0 | dt[,x.y] > 0,]
dt <- data.table::data.table(variant = variants_C[dt[[1]]],
cell_id = dt[[2]],
fw = dt[[3]], rev = dt[[4]])
Expand All @@ -58,7 +56,8 @@ CalculateStrandCorrelation <- function(SE, chromosome_prefix = "chrM"){
dt <- merge(data.table::data.table(summary(reads_G_fw)),
data.table::data.table(summary(reads_G_rev)),
by.x = c("i", "j"), by.y = c("i", "j"),
all = TRUE)[x.x >0 | x.y >0]
all = TRUE)
dt <- dt[dt[,x.x] > 0 | dt[,x.y] > 0,]
dt <- data.table::data.table(variant = variants_G[dt[[1]]],
cell_id = dt[[2]],
fw = dt[[3]], rev = dt[[4]])
Expand All @@ -75,7 +74,8 @@ CalculateStrandCorrelation <- function(SE, chromosome_prefix = "chrM"){
dt <- merge(data.table::data.table(summary(reads_T_fw)),
data.table::data.table(summary(reads_T_rev)),
by.x = c("i", "j"), by.y = c("i", "j"),
all = TRUE)[x.x >0 | x.y >0]
all = TRUE)
dt <- dt[dt[,x.x] > 0 | dt[,x.y] > 0,]
dt <- data.table::data.table(variant = variants_T[dt[[1]]],
cell_id = dt[[2]],
fw = dt[[3]], rev = dt[[4]])
Expand Down
5 changes: 0 additions & 5 deletions R/LoadingMAEGATK_typewise.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ LoadingMAEGATK_typewise <- function(samples_file, samples_path = NULL, patient,
coverage_depth_per_cell <- gsub("_._.$", "", coverage_depth_per_cell)
coverage_depth_per_cell <- !duplicated(coverage_depth_per_cell)
coverage_depth_per_cell <- coverage[coverage_depth_per_cell,]
cell_ids <- colnames(coverage_depth_per_cell)
variant_names <- rownames(coverage_depth_per_cell)
coverage_depth_per_cell <- suppressWarnings(matrix(coverage, nrow = length(variant_names), ncol = length(cell_ids)))
colnames(coverage_depth_per_cell) <- cell_ids
rownames(coverage_depth_per_cell) <- variant_names
coverage_depth_per_variant <- rowMeans(coverage)
coverage_depth_per_cell <- colMeans(coverage_depth_per_cell)
meta_data_col <- data.frame(Cell = colnames(consensus), Patient = patient, Sample = substr(x = colnames(consensus), start = 1, stop = nchar(colnames(consensus))-(cellbarcode_length+1)), AverageCoverage = coverage_depth_per_cell)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ We employ a imputation approach that utilizes the correlation between mitochondr
You can install sigurd using the following code. The vignette requires data that is currently not published, but is provided as a reference.

```{r}
install.packages("devtools")
devtools::install_github("https://github.com/CostaLab/sigurd.git", build_vignettes = FALSE)
require(sigurd)
```

# SiGURD
# SIGURD

We have provided a small example data set for SiGURD. It consists of chromosome 9 and MT for one MPN sample.
The mutation data was obtained from the Sanger Institute Catalogue Of Somatic Mutations In Cancer web site, http://cancer.sanger.ac.uk/cosmic Bamford et al (2004) The COSMIC (Catalogue of Somatic Mutations in Cancer) database and website. Br J Cancer, 91,355-358.
Expand All @@ -32,7 +33,7 @@ The mutation data was obtained from the Sanger Institute Catalogue Of Somatic Mu
```

# Current Features v0.2.51
# Current Features v0.2.52

- Loading data from VarTrix and MAEGATK.
- Transforming the data to be compatible for joint analysis.
Expand Down
18 changes: 8 additions & 10 deletions docs/404.html

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

Loading

0 comments on commit 48149c4

Please sign in to comment.