Skip to content

Commit

Permalink
refactor: rename package from reneeTools to MOSuite
Browse files Browse the repository at this point in the history
BREAKING CHANGE: all instances of reneeTools are now 'MOSuite', reneeDataSet is multiOmicDataSet, and renee_ds is moo (multi-omic object)
  • Loading branch information
kelly-sovacool committed Nov 19, 2024
1 parent 3ee462b commit 79d1fdd
Show file tree
Hide file tree
Showing 37 changed files with 238 additions and 231 deletions.
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
8 changes: 4 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# --------------------------------------------

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: Helper functions for RENEE'
version: 0.0.0.9000
abstract: TODO What the package does (one paragraph).
authors:
Expand All @@ -23,8 +23,8 @@ authors:
given-names: Samantha
email: samantha.chill@nih.gov
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
Expand Down
9 changes: 4 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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", , "vishal.koparde@nih.gov", role = c("aut", "cre"),
Expand All @@ -12,9 +12,8 @@ Authors@R: c(
)
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: 8 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# 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.

## 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)

Note: at the start of development, this package was called reneeTools.
Later it was renamed to MOSuite. ()
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

0 comments on commit 79d1fdd

Please sign in to comment.