Skip to content

Commit

Permalink
Merge pull request #144 from umccr/add_ppl
Browse files Browse the repository at this point in the history
Copy gpgr ppl_cnv_som_gene_read over
  • Loading branch information
pdiakumis authored Mar 22, 2024
2 parents 01d556d + 0527291 commit 47856a2
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 253 deletions.
6 changes: 2 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ License: MIT + file LICENSE
Depends:
R (>= 4.1.0)
Remotes:
umccr/gpgr,
umccr/RNAsum.data
Imports:
AnnotationDbi,
Expand All @@ -31,12 +30,11 @@ Imports:
DT,
EDASeq,
edgeR,
EnsDb.Hsapiens.v86,
ensembldb,
fs,
ggforce,
ggplot2,
glue,
gpgr,
htmltools,
htmlwidgets,
knitr,
Expand Down Expand Up @@ -68,5 +66,5 @@ Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE,
roclets = c("namespace", "rd", "roxytest::testthat_roclet"))
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
LazyData: true
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export(pca)
export(pcgr_expr)
export(pcgr_tiers_tsv_read)
export(perc_rank)
export(ppl_cnv_som_gene_read)
export(prepare2write)
export(purple_cnv_summary)
export(rcircos_cyto_info38)
Expand Down
32 changes: 31 additions & 1 deletion R/sample_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ read_wgs_data <- function(p) {
purple_gene_tsv <- .read(
p = p,
subdir = "purple", pat = "purple\\.cnv\\.gene\\.tsv$",
nm = "purple_gene_tsv", func = gpgr::purple_cnv_som_gene_read
nm = "purple_gene_tsv", func = ppl_cnv_som_gene_read
)

manta_tsv <- .read(
Expand Down Expand Up @@ -324,3 +324,33 @@ immune_summary <- function(tbl_imarkers, tbl_igram = NULL, igram_param = TRUE) {
res <- unique(c(res1, res2)) |> stats::na.omit()
res
}

#' Read PURPLE CNV Gene File
#'
#' Reads the `purple.cnv.gene.tsv` file, which summarises copy number
#' alterations of each gene in the HMF panel
#' (see https://github.com/hartwigmedical/hmftools/tree/master/purple#gene-copy-number-file).
#'
#' @param x Path to `purple.cnv.gene.tsv` file.
#'
#' @return The input file as a tibble.
#'
#' @export
ppl_cnv_som_gene_read <- function(x) {
nm <- c(
"chromosome" = "c", "start" = "i", "end" = "i", "gene" = "c",
"minCopyNumber" = "d", "maxCopyNumber" = "d",
"unused" = "c", "somaticRegions" = "d", "germlineHomDeletionRegions" = "d",
"germlineHetToHomDeletionRegions" = "d",
"transcriptId" = "c", "transcriptVersion" = "c", "chromosomeBand" = "c",
"minRegions" = "d", "minRegionStart" = "i", "minRegionEnd" = "i",
"minRegionStartSupport" = "c", "minRegionEndSupport" = "c",
"minRegionMethod" = "c", "minMinorAlleleCopyNumber" = "d"
)

ctypes <- paste(nm, collapse = "")
purple_cnv_gene <- readr::read_tsv(x, col_types = ctypes)
assertthat::assert_that(ncol(purple_cnv_gene) == length(nm))
assertthat::assert_that(all(colnames(purple_cnv_gene) == names(nm)))
purple_cnv_gene
}
10 changes: 4 additions & 6 deletions deploy/conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ requirements:
- bioconductor-annotationfilter
- r-assertthat
- r-conflicted
- r-dt
- r-dplyr
- r-dt
- bioconductor-edaseq ==2.28.0
- bioconductor-ensdb.hsapiens.v86
- bioconductor-edger ==3.36.0
- bioconductor-ensembldb
- r-fs
- r-ggforce
- r-ggplot2
- r-glue
- umccr::r-gpgr
- r-here
- r-htmltools
- r-htmlwidgets
- r-knitr
Expand Down Expand Up @@ -61,17 +60,16 @@ requirements:
- bioconductor-annotationfilter
- r-assertthat
- r-conflicted
- r-dt
- r-dplyr
- r-dt
- bioconductor-edaseq ==2.28.0
- bioconductor-ensdb.hsapiens.v86
- bioconductor-edger ==3.36.0
- bioconductor-ensembldb
- r-fs
- r-ggforce
- r-ggplot2
- r-glue
- umccr::r-gpgr
- r-here
- r-htmltools
- r-htmlwidgets
- r-knitr
Expand Down
2 changes: 1 addition & 1 deletion inst/rmd/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rnasum.html
rnasum_files/
rnasum.md
/html/
240 changes: 0 additions & 240 deletions inst/rmd/WTS_WGS_samples_mapping.Rmd

This file was deleted.

19 changes: 19 additions & 0 deletions man/ppl_cnv_som_gene_read.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-roxytest-testexamples-sample_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test_that("Function read_sample_data() @ L27", {
})


test_that("Function read_wgs_data() @ L103", {
test_that("Function read_wgs_data() @ L107", {

p <- list(
umccrise = system.file("rawdata/test_data/umccrised/test_sample_WGS", package = "RNAsum"),
Expand Down

0 comments on commit 47856a2

Please sign in to comment.