Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename package from reneeTools to MOSuite #76

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^reneeTools\.Rproj$
^MOSuite\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^_pkgdown\.yml$
Expand Down
18 changes: 9 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to reneeTools
# Contributing to MOSuite

## Proposing changes with issues

Expand All @@ -15,7 +15,7 @@ so others will know you're working on it.
We use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow)
as our collaboration process.
Follow the steps below for detailed instructions on contributing changes to
reneeTools.
MOSuite.

![GitHub Flow diagram](./img/GitHub-Flow_bg-white.png)

Expand All @@ -28,10 +28,10 @@ Otherwise, you will first need to
the repo and clone your fork. You only need to do this step once.

```sh
git clone https://github.com/CCBR/reneeTools
git clone https://github.com/CCBR/MOSuite
```

> Cloning into 'reneeTools'... <br>
> Cloning into 'MOSuite'... <br>
> remote: Enumerating objects: 1136, done. <br>
> remote: Counting objects: 100% (463/463), done. <br>
> remote: Compressing objects: 100% (357/357), done. <br>
Expand All @@ -40,7 +40,7 @@ git clone https://github.com/CCBR/reneeTools
> Resolving deltas: 100% (530/530), done. <br>

```sh
cd reneeTools
cd MOSuite
```

### If this is your first time cloning the repo, install dependencies
Expand Down Expand Up @@ -204,22 +204,22 @@ git push --set-upstream origin iss-10
> remote: Resolving deltas: 100% (3/3), completed with 3 local objects. <br>
> remote: <br>
> remote: Create a pull request for 'iss-10' on GitHub by visiting: <br>
> remote: https://github.com/CCBR/reneeTools/pull/new/iss-10 <br>
> remote: https://github.com/CCBR/MOSuite/pull/new/iss-10 <br>
> remote: <br>
> To https://github.com/CCBR/reneeTools <br>
> To https://github.com/CCBR/MOSuite <br>
> <br>
> [new branch] iss-10 -> iss-10 <br>
> branch 'iss-10' set up to track 'origin/iss-10'. <br>

We recommend pushing your commits often so they will be backed up on GitHub.
You can view the files in your branch on GitHub at
`https://github.com/CCBR/reneeTools/tree/<your-branch-name>`
`https://github.com/CCBR/MOSuite/tree/<your-branch-name>`
(replace `<your-branch-name>` with the actual name of your branch).

### Create the PR

Once your branch is ready, create a PR on GitHub:
<https://github.com/CCBR/reneeTools/pull/new/>
<https://github.com/CCBR/MOSuite/pull/new/>

Select the branch you just pushed:

Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
Before you submit this issue, please check the documentation: <https://ccbr.github.io/reneeTools/>
Before you submit this issue, please check the documentation: <https://ccbr.github.io/MOSuite/>

- type: textarea
id: description
Expand All @@ -22,7 +22,7 @@ body:
description: Please include a minimal reproducible example (AKA a reprex). If you've never heard of a [reprex](http://reprex.tidyverse.org/) before, start by reading <https://www.tidyverse.org/help/#reprex>.
render: console
placeholder: |
library(reneeTools)
library(MOSuite)
... insert_your_code_here() ...

Paste some output where something broke
Expand All @@ -40,6 +40,6 @@ body:
label: System information
description: |
* Version of R
* Version of CCBR/reneeTools
* Version of CCBR/MOSuite
* OS _(eg. Ubuntu Linux, macOS)_
* Hardware _(eg. HPC, Desktop)_
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
contact_links:
- name: Discussions
url: https://github.com/CCBR/reneeTools/discussions
url: https://github.com/CCBR/MOSuite/discussions
about: Please ask and answer questions here.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [published]

env:
IMAGE_NAME: "reneeTools"
IMAGE_NAME: "MOSuite"
CONTEXT: "./"
NAMESPACE: "nciccbr"

Expand Down
29 changes: 16 additions & 13 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@
# --------------------------------------------

cff-version: 1.2.0
message: 'To cite package "reneeTools" in publications use:'
message: 'To cite package "MOSuite" in publications use:'
type: software
license: MIT
title: 'reneeTools: Helper functions for RENEE'
title: 'MOSuite: R package for downstream multi-omics analysis'
version: 0.0.0.9000
abstract: TODO What the package does (one paragraph).
authors:
- family-names: Koparde
given-names: Vishal
email: [email protected]
orcid: https://orcid.org/0000-0001-8978-8495
- family-names: Sovacool
given-names: Kelly
email: [email protected]
orcid: https://orcid.org/0000-0003-3283-829X
- family-names: Homan
given-names: Philip
email: [email protected]
- family-names: Koparde
given-names: Vishal
email: [email protected]
orcid: https://orcid.org/0000-0001-8978-8495
- family-names: Chill
given-names: Samantha
email: [email protected]
orcid: https://orcid.org/0000-0002-8734-9875
repository-code: https://github.com/CCBR/reneeTools
url: https://ccbr.github.io/reneeTools/
repository-code: https://github.com/CCBR/MOSuite
url: https://ccbr.github.io/MOSuite/
contact:
- family-names: Koparde
given-names: Vishal
email: vishal.koparde@nih.gov
orcid: https://orcid.org/0000-0001-8978-8495
- family-names: Sovacool
given-names: Kelly
email: kelly.sovacool@nih.gov
orcid: https://orcid.org/0000-0003-3283-829X
references:
- type: software
title: 'R: A Language and Environment for Statistical Computing'
Expand Down Expand Up @@ -320,7 +323,7 @@ references:
title: S7
abstract: 'S7: An Object Oriented System Meant to Become a Successor to S3 and S4'
notes: Imports
url: https://github.com/rconsortium/S7/
url: https://rconsortium.github.io/S7/
repository: https://CRAN.R-project.org/package=S7
authors:
- family-names: Vaughan
Expand Down
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Package: reneeTools
Title: Helper functions for RENEE
Package: MOSuite
Title: R package for downstream multi-omics analysis
Version: 0.0.0.9000
Authors@R: c(
person("Vishal", "Koparde", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8978-8495")),
person("Kelly", "Sovacool", , "[email protected]", role = "aut",
person("Kelly", "Sovacool", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-3283-829X")),
person("Philip", "Homan", , "[email protected]", role = "aut"),
person("Vishal", "Koparde", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-8978-8495")),
person("Samantha", "Chill", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0002-8734-9875")),
person("CCR Collaborative Bioinformatics Resource", role = "cph")
)
Description: TODO What the package does (one paragraph).
License: MIT + file LICENSE
URL: https://github.com/CCBR/reneeTools,
https://ccbr.github.io/reneeTools/
BugReports: https://github.com/CCBR/reneeTools/issues
URL: https://github.com/CCBR/MOSuite, https://ccbr.github.io/MOSuite/
BugReports: https://github.com/CCBR/MOSuite/issues
Depends:
R (>= 2.10)
Imports:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ RUN mamba install -c conda-forge \
r-devtools

# install R package
COPY . /opt2/reneeTools
RUN R -e "devtools::install_local('/opt2/reneeTools', dependencies = TRUE)"
COPY . /opt2/MOSuite
RUN R -e "devtools::install_local('/opt2/MOSuite', dependencies = TRUE)"

# Save Dockerfile in the docker
COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

export("%>%")
export(calc_cpm)
export(create_reneeDataSet_from_dataframes)
export(create_reneeDataSet_from_files)
export(create_multiOmicDataSet_from_dataframes)
export(create_multiOmicDataSet_from_files)
export(filter_counts)
export(meta_tbl_to_dat)
export(run_deseq2)
Expand Down
13 changes: 7 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# reneeTools development version 0.0.0.9000
# MOSuite development version 0.0.0.9000

This is the first release of reneeTools 🎉
This is the first release of MOSuite 🎉

- Create a `NEWS.md` file to track changes to the package.
- Note: at the start of development, this package was called reneeTools.
Later it was renamed to MOSuite. (#76, @kelly-sovacool)

## Main functions & classes

- `reneeDataSet` (#16, #28, @kelly-sovacool)
- `create_reneeDataSet_from_files()`
- `create_reneeDataSet_from_dataframes()`
- `multiOmicDataSet` (#16, #28, @kelly-sovacool)
- `create_multiOmicDataSet_from_files()`
- `create_multiOmicDataSet_from_dataframes()`
- `run_deseq2()`
- `calc_cpm()` (#38, @kelly-sovacool)
- `filter_counts()` (#38, @kelly-sovacool)
46 changes: 23 additions & 23 deletions R/0_renee-class.R → R/0_mo-class.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#' reneeDataSet class
#' multiOmicDataSet class
#'
#' @param sample_meta_dat sample metadata as a data frame or tibble.
#' Must contain a `sample_id` column.
#' @param counts_lst named list of dataframes containing counts, e.g. expected gene counts from RSEM. Each data frame is expected to contain a `gene_id` column and a column for each sample ID in the metadata.
#'
#'
reneeDataSet <- S7::new_class("renee",
multiOmicDataSet <- S7::new_class("multiOmicDataSet",
properties = list(
sample_meta = S7::class_data.frame,
counts = S7::class_list, # list of data frames
Expand All @@ -29,49 +29,49 @@ reneeDataSet <- S7::new_class("renee",
}
)

#' Construct a reneeDataSet object from tsv files.
#' Construct a multiOmicDataSet object from tsv files.
#'
#' @param sample_meta_filepath path to tsv file with sample IDs and metadata for differential analysis.
#' @param gene_counts_filepath path to tsv file of expected gene counts from RSEM.
#' @param count_type type to assign the values of `gene_counts_filepath` to in the `counts` slot
#' @param sample_id_colname name of the column in `sample_meta_filepath` that contains the sample IDs
#'
#' @return reneeDataSet object
#' @return multiOmicDataSet object
#' @export
#'
#' @examples
#' renee_ds <- create_reneeDataSet_from_files(
#' moo <- create_multiOmicDataSet_from_files(
#' sample_meta_filepath = system.file("extdata",
#' "sample_metadata.tsv.gz",
#' package = "reneeTools"
#' package = "MOSuite"
#' ),
#' gene_counts_filepath = system.file("extdata",
#' "RSEM.genes.expected_count.all_samples.txt.gz",
#' package = "reneeTools"
#' package = "MOSuite"
#' )
#' )
#' renee_ds@counts$raw %>% head()
#' renee_ds@sample_meta
create_reneeDataSet_from_files <- function(sample_meta_filepath, gene_counts_filepath,
count_type = "raw",
sample_id_colname = "sample_id") {
#' moo@counts$raw %>% head()
#' moo@sample_meta
create_multiOmicDataSet_from_files <- function(sample_meta_filepath, gene_counts_filepath,
count_type = "raw",
sample_id_colname = "sample_id") {
count_dat <- readr::read_tsv(gene_counts_filepath)
sample_meta_dat <- readr::read_tsv(sample_meta_filepath)
return(create_reneeDataSet_from_dataframes(
return(create_multiOmicDataSet_from_dataframes(
sample_meta_dat = sample_meta_dat,
count_dat = count_dat,
count_type = "raw",
sample_id_colname = sample_id_colname
))
}

#' Construct a reneeDataSet object from data frames
#' Construct a multiOmicDataSet object from data frames
#'
#' @inheritParams reneeDataSet
#' @inheritParams create_reneeDataSet_from_files
#' @inheritParams multiOmicDataSet
#' @inheritParams create_multiOmicDataSet_from_files
#' @param count_dat data frame of feature counts (e.g. expected gene counts from RSEM)
#'
#' @return reneeDataSet object
#' @return multiOmicDataSet object
#' @export
#'
#' @examples
Expand All @@ -82,11 +82,11 @@ create_reneeDataSet_from_files <- function(sample_meta_filepath, gene_counts_fil
#' levels = c("wildtype", "knockout")
#' )
#' )
#' create_reneeDataSet_from_dataframes(sample_meta, gene_counts)
create_reneeDataSet_from_dataframes <- function(sample_meta_dat,
count_dat,
sample_id_colname = "sample_id",
count_type = "raw") {
#' create_multiOmicDataSet_from_dataframes(sample_meta, gene_counts)
create_multiOmicDataSet_from_dataframes <- function(sample_meta_dat,
count_dat,
sample_id_colname = "sample_id",
count_type = "raw") {
gene_columns <- c("gene_id", "GeneName", "Gene")
# sample IDs must be in the same order
gene_sample_colnames <- count_dat %>%
Expand All @@ -109,5 +109,5 @@ create_reneeDataSet_from_dataframes <- function(sample_meta_dat,
counts <- list()
counts[[count_type]] <- count_dat

return(reneeDataSet(sample_meta_dat, counts))
return(multiOmicDataSet(sample_meta_dat, counts))
}
4 changes: 2 additions & 2 deletions R/reneeTools-package.R → R/MOSuite-package.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' reneeTools: R helper functions for RENEE
#' MOSuite: R helper functions for RENEE
#'
#' `reneeTools` implements helper functions for RENEE, a comprehensive
#' `MOSuite` implements helper functions for RENEE, a comprehensive
#' quality-control and quantification RNA-seq pipeline
#'
#' @keywords internal
Expand Down
18 changes: 9 additions & 9 deletions R/counts.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' Calculate counts-per-million (CPM) on raw counts in a reneeDataSet
#' Calculate counts-per-million (CPM) on raw counts in a multiOmicDataSet
#'
#' @param renee_ds reneeDataSet object
#' @param moo multiOmicDataSet object
#' @param ... additional arguments to pass to edgeR::cpm()
#'
#' @return reneeDataSet with cpm-transformed counts
#' @return multiOmicDataSet with cpm-transformed counts
#' @export
#'
#' @examples
Expand All @@ -14,17 +14,17 @@
#' levels = c("wildtype", "knockout")
#' )
#' )
#' renee_ds <- create_reneeDataSet_from_dataframes(sample_meta, gene_counts) %>%
#' moo <- create_multiOmicDataSet_from_dataframes(sample_meta, gene_counts) %>%
#' calc_cpm()
#' head(renee_ds@counts$cpm)
calc_cpm <- S7::new_generic("calc_cpm", "renee_ds", function(renee_ds, ...) {
#' head(moo@counts$cpm)
calc_cpm <- S7::new_generic("calc_cpm", "moo", function(moo, ...) {
S7::S7_dispatch()
})

S7::method(calc_cpm, reneeDataSet) <- function(renee_ds, gene_colname = "gene_id", ...) {
renee_ds@counts$cpm <- renee_ds@counts$raw %>%
S7::method(calc_cpm, multiOmicDataSet) <- function(moo, gene_colname = "gene_id", ...) {
moo@counts$cpm <- moo@counts$raw %>%
calc_cpm_df(gene_colname = gene_colname)
return(renee_ds)
return(moo)
}

#' Calculate CPM on a data frame
Expand Down
Loading