Skip to content

Commit 5f9ee0e

Browse files
refactor: add MOSuite as a subtree (#1)
* refactor: load local MOSuite * Squashed 'code/MOSuite/' content from commit c09ee39 git-subtree-dir: code/MOSuite git-subtree-split: c09ee39f9b282237f13d88dcf4cdfed965209c68 * `air format` (GitHub Actions) * chore: update changelog * ci: add tests gha * chore: create .gitattributes * test: create basic tests * `air format` (GitHub Actions) * refactor: use MOSuite-minimal docker --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 67ccc43 commit 5f9ee0e

309 files changed

Lines changed: 50492 additions & 87 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codeocean/environment.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 1,
3-
"base_image": "codeocean/mosuite:v0.3.0",
3+
"base_image": "codeocean/mosuite-minimal:v0.3.1",
44
"post_install": true,
55
"options": {
66
"registry_host_arg": true,

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/code/MOSuite linguist-vendored
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test
1+
name: tests
22

33
on:
44
push:
@@ -7,7 +7,7 @@ on:
77
branches: [ main, dev ]
88

99
jobs:
10-
test:
10+
tests:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Code Ocean capsule - MOSuite - Plot Volcano Summary
22

3+
## dev version
4+
5+
- The MOSuite package is now available in `code/MOSuite`. (#1)
6+
- Use MOSuite v0.3.1.
7+
38
## v3.0
49

510
- Use MOSuite v0.3.0.

code/MOSuite/.Rbuildignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
^renv$
2+
^renv\.lock$
3+
^_pkgdown\.yml$
4+
^\.github$
5+
^\.lintr$
6+
^\.pre-commit-config\.yaml$
7+
^\.prettierignore$
8+
^\.prettierrc$
9+
^\.Rproj\.user$
10+
^CITATION\.cff$
11+
^codemeta\.json$
12+
^data-raw$
13+
^doc$
14+
^Dockerfile$
15+
^docker$
16+
^docs$
17+
^figures$
18+
^LICENSE\.md$
19+
^Meta$
20+
^MOSuite\.Rproj$
21+
^pkgdown$
22+
^README\.Rmd$
23+
^README\.html$
24+
^README_files$
25+
^Rplots\.pdf$
26+
^moo_input\.rds$
27+
^plot-volc-enh\.json$
28+
^volc-sum-params\.json$
29+
^report_files$
30+
^inst/quarto/report_files$
31+
^tests/figures$
32+
^vignettes/figures/$
33+
^vignettes/memory\.Rmd$
34+
^vignettes/cli\.Rmd$
35+
VennDiagram.*\.log
36+
^[.]?air[.]toml$
37+
^\.vscode$

code/MOSuite/.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CITATION.cff linguist-generated
2+
codemeta.json linguist-generated
3+
NAMESPACE linguist-generated
4+
man/ linguist-generated

code/MOSuite/.github/.Rprofile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rlang::global_entrace()

code/MOSuite/.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html
Lines changed: 292 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,292 @@
1+
# Contributing to MOSuite
2+
3+
## Proposing changes with issues
4+
5+
If you want to make a change, it's a good idea to first
6+
[open an issue](https://github.com/CCBR/MOSuite/issues)
7+
and make sure someone from the team agrees that it’s needed.
8+
Before opening an issue, check the existing issues to make sure you're not
9+
opening a duplicate, and follow these guidelines to ensure your issue will be
10+
high-quality:
11+
<https://code-review.tidyverse.org/issues/>.
12+
13+
If you've decided to work on an issue,
14+
[assign yourself to the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/assigning-issues-and-pull-requests-to-other-github-users#assigning-an-individual-issue-or-pull-request)
15+
so others will know you're working on it.
16+
17+
## Pull request process
18+
19+
We use [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow)
20+
as our collaboration process.
21+
Follow the steps below for detailed instructions on contributing changes to
22+
MOSuite.
23+
24+
![GitHub Flow diagram](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/GitHub-Flow_bg-white.png)
25+
26+
27+
### Clone the repo
28+
29+
If you are a member of [CCBR](https://github.com/CCBR),
30+
you can clone this repository to your computer or development environment.
31+
Otherwise, you will first need to
32+
[fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
33+
the repo and clone your fork. You only need to do this step once.
34+
35+
```sh
36+
git clone https://github.com/CCBR/MOSuite
37+
```
38+
39+
> Cloning into 'MOSuite'... <br>
40+
> remote: Enumerating objects: 1136, done. <br>
41+
> remote: Counting objects: 100% (463/463), done. <br>
42+
> remote: Compressing objects: 100% (357/357), done. <br>
43+
> remote: Total 1136 (delta 149), reused 332 (delta 103), pack-reused 673 <br>
44+
> Receiving objects: 100% (1136/1136), 11.01 MiB | 9.76 MiB/s, done. <br>
45+
> Resolving deltas: 100% (530/530), done. <br>
46+
47+
```sh
48+
cd MOSuite
49+
```
50+
51+
### If this is your first time cloning the repo, install dependencies
52+
53+
- In an R console, install the R development dependencies with
54+
`devtools::install_dev_deps()`, and then make sure the package passes R CMD
55+
check by running `devtools::check()`. If R CMD check doesn't pass cleanly,
56+
it's a good idea to ask for help before continuing.
57+
58+
- Install [`pre-commit`](https://pre-commit.com/#install) if you don't already
59+
have it. Then from the repo's root directory, run
60+
61+
```sh
62+
pre-commit install
63+
```
64+
65+
This will install the repo's pre-commit hooks.
66+
You'll only need to do this step the first time you clone the repo.
67+
68+
### Create a branch
69+
70+
Create a Git branch for your pull request (PR). Give the branch a descriptive
71+
name for the changes you will make, such as `iss-10` if it is for a specific
72+
issue.
73+
74+
```sh
75+
# create a new branch and switch to it
76+
git branch iss-10
77+
git switch iss-10
78+
```
79+
80+
> Switched to a new branch 'iss-10'
81+
82+
### Make your changes
83+
84+
Edit the code, write unit tests, and update the documentation as needed.
85+
86+
#### style
87+
88+
New code should follow the [tidyverse style guide](https://style.tidyverse.org).
89+
You can use the [styler](https://CRAN.R-project.org/package=styler) package to
90+
apply these styles, but please don't restyle code that has nothing to do with
91+
your PR.
92+
93+
A brief overview of conventions according to the tidyverse style guide:
94+
95+
- most object names (variables and functions) should be in [snake_case](https://style.tidyverse.org/syntax.html#sec-objectnames)
96+
- function names should use [verbs](https://style.tidyverse.org/functions.html#naming) where possible
97+
- use `<-` for assignment
98+
- use [pipes](https://style.tidyverse.org/pipes.html) to chain operations on a single object
99+
100+
Please see the [tidyverse style guide](https://style.tidyverse.org) for more details.
101+
102+
#### test
103+
104+
Most changes to the code will also need unit tests to demonstrate that the
105+
changes work as intended.
106+
Use [`testthat`](https://testthat.r-lib.org/) to create your unit tests and test
107+
the code.
108+
Test files are organized as described in
109+
<https://style.tidyverse.org/tests.html>.
110+
Take a look at the existing code in this package for examples.
111+
112+
#### document
113+
114+
If you have written a new function or changed the API of an existing function,
115+
you will need to update the function's documentation using
116+
[roxygen2](https://cran.r-project.org/package=roxygen2) with
117+
[Markdown syntax](https://roxygen2.r-lib.org/articles/rd-formatting.html).
118+
See instructions on writing roxygen2 comments here:
119+
<https://r-pkgs.org/man.html>.
120+
If the function is used in a vignette, you may also need to update the vignette.
121+
122+
#### check
123+
124+
After making your changes, run `devtools::check()` from an R console to make
125+
sure the package still passes R CMD check.
126+
127+
### Commit and push your changes
128+
129+
If you're not sure how often you should commit or what your commits should
130+
consist of, we recommend following the "atomic commits" principle where each
131+
commit contains one new feature, fix, or task.
132+
Learn more about atomic commits here:
133+
<https://www.freshconsulting.com/insights/blog/atomic-commits/>
134+
135+
First, add the files that you changed to the staging area:
136+
137+
```sh
138+
git add path/to/changed/files/
139+
```
140+
141+
Then make the commit.
142+
Your commit message should follow the
143+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
144+
specification.
145+
Briefly, each commit should start with one of the approved types such as
146+
`feat`, `fix`, `docs`, etc. followed by a description of the commit.
147+
Take a look at the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary)
148+
for more detailed information about how to write commit messages.
149+
150+
151+
```sh
152+
git commit -m 'feat: create function for awesome feature'
153+
```
154+
155+
pre-commit will enforce that your commit message and the code changes are
156+
styled correctly and will attempt to make corrections if needed.
157+
158+
> Check for added large files..............................................Passed <br>
159+
> Fix End of Files.........................................................Passed <br>
160+
> Trim Trailing Whitespace.................................................Failed <br>
161+
> - hook id: trailing-whitespace <br>
162+
> - exit code: 1 <br>
163+
> - files were modified by this hook <br>
164+
> <br>
165+
> Fixing path/to/changed/files/file.txt <br>
166+
> <br>
167+
> codespell................................................................Passed <br>
168+
> style-files..........................................(no files to check)Skipped <br>
169+
> readme-rmd-rendered..................................(no files to check)Skipped <br>
170+
> use-tidy-description.................................(no files to check)Skipped <br>
171+
172+
In the example above, one of the hooks modified a file in the proposed commit,
173+
so the pre-commit check failed. You can run `git diff` to see the changes that
174+
pre-commit made and `git status` to see which files were modified. To proceed
175+
with the commit, re-add the modified file(s) and re-run the commit command:
176+
177+
```sh
178+
git add path/to/changed/files/file.txt
179+
git commit -m 'feat: create function for awesome feature'
180+
```
181+
182+
This time, all the hooks either passed or were skipped
183+
(e.g. hooks that only run on R code will not run if no R files were
184+
committed).
185+
When the pre-commit check is successful, the usual commit success message
186+
will appear after the pre-commit messages showing that the commit was created.
187+
188+
> Check for added large files..............................................Passed <br>
189+
> Fix End of Files.........................................................Passed <br>
190+
> Trim Trailing Whitespace.................................................Passed <br>
191+
> codespell................................................................Passed <br>
192+
> style-files..........................................(no files to check)Skipped <br>
193+
> readme-rmd-rendered..................................(no files to check)Skipped <br>
194+
> use-tidy-description.................................(no files to check)Skipped <br>
195+
> Conventional Commit......................................................Passed <br>
196+
> [iss-10 9ff256e] feat: create function for awesome feature <br>
197+
> 1 file changed, 22 insertions(+), 3 deletions(-) <br>
198+
199+
Finally, push your changes to GitHub:
200+
201+
```sh
202+
git push
203+
```
204+
205+
If this is the first time you are pushing this branch, you may have to
206+
explicitly set the upstream branch:
207+
208+
```sh
209+
git push --set-upstream origin iss-10
210+
```
211+
212+
> Enumerating objects: 7, done. <br>
213+
> Counting objects: 100% (7/7), done. <br>
214+
> Delta compression using up to 10 threads <br>
215+
> Compressing objects: 100% (4/4), done. <br>
216+
> Writing objects: 100% (4/4), 648 bytes | 648.00 KiB/s, done. <br>
217+
> Total 4 (delta 3), reused 0 (delta 0), pack-reused 0 <br>
218+
> remote: Resolving deltas: 100% (3/3), completed with 3 local objects. <br>
219+
> remote: <br>
220+
> remote: Create a pull request for 'iss-10' on GitHub by visiting: <br>
221+
> remote: https://github.com/CCBR/MOSuite/pull/new/iss-10 <br>
222+
> remote: <br>
223+
> To https://github.com/CCBR/MOSuite <br>
224+
> <br>
225+
> [new branch] iss-10 -> iss-10 <br>
226+
> branch 'iss-10' set up to track 'origin/iss-10'. <br>
227+
228+
We recommend pushing your commits often so they will be backed up on GitHub.
229+
You can view the files in your branch on GitHub at
230+
`https://github.com/CCBR/MOSuite/tree/<your-branch-name>`
231+
(replace `<your-branch-name>` with the actual name of your branch).
232+
233+
### Create the PR
234+
235+
Once your branch is ready, create a PR on GitHub:
236+
<https://github.com/CCBR/MOSuite/pull/new/>
237+
238+
Select the branch you just pushed:
239+
240+
![Create a new PR from your branch](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/new-PR.png)
241+
242+
Edit the PR title and description.
243+
The title should briefly describe the change.
244+
Follow the comments in the template to fill out the body of the PR, and
245+
you can delete the comments (everything between `<!--` and `-->`) as you go.
246+
When you're ready, click 'Create pull request' to open it.
247+
248+
![Open the PR after editing the title and description](https://raw.githubusercontent.com/CCBR/CCBR_NextflowTemplate/main/.github/img/create-PR.png)
249+
250+
Optionally, you can mark the PR as a draft if you're not yet ready for it to
251+
be reviewed, then change it later when you're ready.
252+
253+
### Wait for a maintainer to review your PR
254+
255+
We will do our best to follow the tidyverse code review principles:
256+
<https://code-review.tidyverse.org/>.
257+
The reviewer may suggest that you make changes before accepting your PR in
258+
order to improve the code quality or style.
259+
If that's the case, continue to make changes in your branch and push them to
260+
GitHub, and they will appear in the PR.
261+
262+
Once the PR is approved, the maintainer will merge it and the issue(s) the PR
263+
links will close automatically.
264+
Congratulations and thank you for your contribution!
265+
266+
### After your PR has been merged
267+
268+
After your PR has been merged, update your local clone of the repo by
269+
switching to the main branch and pulling the latest changes:
270+
271+
```sh
272+
git checkout main
273+
git pull
274+
```
275+
276+
It's a good idea to run `git pull` before creating a new branch so it will
277+
start from the most recent commits in main.
278+
279+
## Helpful links for more information
280+
281+
- This contributing guide was adapted from the [tidyverse contributing guide](https://github.com/tidyverse/tidyverse/blob/main/.github/CONTRIBUTING.md)
282+
- [GitHub Flow](https://docs.github.com/en/get-started/using-github/github-flow)
283+
- [tidyverse style guide](https://style.tidyverse.org)
284+
- [tidyverse code review principles](https://code-review.tidyverse.org)
285+
- [reproducible examples](https://www.tidyverse.org/help/#reprex)
286+
- [R packages book](https://r-pkgs.org/)
287+
- packages:
288+
- [usethis](https://usethis.r-lib.org/)
289+
- [devtools](https://devtools.r-lib.org/)
290+
- [testthat](https://testthat.r-lib.org/)
291+
- [styler](https://styler.r-lib.org/)
292+
- [roxygen2](https://roxygen2.r-lib.org)

0 commit comments

Comments
 (0)