Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood authored Sep 11, 2024
0 parents commit 0233b09
Show file tree
Hide file tree
Showing 56 changed files with 2,147 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: [bug]
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: [enhancement]
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Describe your changes

<!-- Describe your changes -->

## Checklist before requesting a review
- [ ] I have performed a self-review of my code

- Check the correct box. Does this PR contain:
- [ ] Breaking changes
- [ ] New functionality
- [ ] Major changes
- [ ] Minor changes
- [ ] Bug fixes

- [ ] Proposed changes are described in the CHANGELOG.md

- [ ] CI Tests succeed and look good!
21 changes: 21 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on:
push:
branches: [ 'main' ]
workflow_dispatch:
inputs:
version:
description: |
The version of the project to build. Example: `1.0.3`.
If not provided, a development build with a version name
based on the branch name will be built. Otherwise, a release
build with the provided version will be built.
required: false

jobs:
build:
uses: viash-io/viash-actions/.github/workflows/build.yaml@v6
with:
version: ${{ github.event.inputs.version }}
11 changes: 11 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Test

on:
push:
branches:
- main
pull_request:

jobs:
test:
uses: viash-io/viash-actions/.github/workflows/test.yaml@v6
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/resources
/resources_test
/work
/.nextflow*
/target

.DS_Store
/output
trace-*
.ipynb_checkpoints
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "common"]
path = common
url = https://github.com/openproblems-bio/common_resources.git
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"yaml.schemas": {
"common/schemas/api_component_spec.yaml": "**/api/comp_*.yaml",
"common/schemas/api_file_format.yaml": "**/api/file_*.yaml",
"common/schemas/task_config.yaml": "_viash.yaml",
"common/schemas/task_method.yaml": "**/methods/**/config.vsh.yaml",
"common/schemas/task_control_method.yaml": "**/control_methods/**/config.vsh.yaml",
"common/schemas/task_metric.yaml": "**/metrics/**/config.vsh.yaml"
}
}
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# task_template x.y.z

## BREAKING CHANGES

<!-- * Restructured `src` directory (PR #3). -->

## NEW FUNCTIONALITY

* Added `control_methods/true_labels` component (PR #5).

* Added `methods/logistic_regression` component (PR #5).

* Added `metrics/accuracy` component (PR #5).

## MAJOR CHANGES

* Updated `api` files (PR #5).

* Updated configs, components and CI to the latest Viash version (PR #8).

## MINOR CHANGES

* Updated `README.md` (PR #5).

## BUGFIXES

148 changes: 148 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Contribution guidelines

We encourage contributions from the community. To contribute:

* Star this repository: Click the star button in the top-right corner of the repository to show your support.
* Fork the repository: Start by forking this repository to your account.
* Develop your component: Create your Viash component, ensuring it aligns with our best practices (detailed below).
* Submit a pull request: After testing your component, submit a pull request for review.

## Installation

You need to have Docker, Java, and Viash installed. Follow
[these instructions](https://openproblems.bio/documentation/fundamentals/requirements)
to install the required dependencies.

## Getting started

### Cloning the repository

To get started, fork the repository and clone it to your local machine:

```bash
git clone <git url to fork> --recursive

cd <name of the repository>
```

NOTE: If you forgot to clone the repository with the `--recursive` flag, you can run the following command to update the submodules:

```bash
git submodule update --init --recursive
```

### Downloading the test resources

Next, you should download the test resources:

```bash
scripts/sync_resources.sh
```

You may need to run this script again if the resources are updated.

## Good first steps

### Creating a new method

To create a new method, you can use the following command:

```bash
# in Python:
common/scripts/create_component \
--name my_method \
--language python \
--type method

# or in R:
common/scripts/create_component \
--name my_method \
--language r \
--type method
```

This will create a new method in `src/methods/my_method`. Next, you should:

* Fill in the component's metadata
* Specify dependencies
* Implement the method's code
* Run the unit test

Please review our documentation on [creating a new method](https://openproblems.bio/documentation/create_component/add_a_method) for more information on how to do this.


### Creating a new metric

Creating a new metric is similar to creating a new method. You can use the following command:

```bash
# in Python:
common/scripts/create_component \
--name my_metric \
--language python \
--type metric

# or in R:
common/scripts/create_component \
--name my_metric \
--language r \
--type metric
```

This will create a new metric in `src/metrics/my_metric`. Next, you should:

* Fill in the component's metadata
* Specify dependencies
* Implement the metric's code
* Run the unit test

Please review our documentation on [creating a new metric](https://openproblems.bio/documentation/create_component/add_a_metric) for more information.


## Frequently used commands

To get started, you can run the following commands:

### Sync the test data

To sync the test data, run the following command:

```bash
scripts/sync_resources.sh
```

### Building the components

To run the benchmark, you first need to build the components.

```bash
viash ns build --parallel --setup cachedbuild
```

For each of the components, this will:

* Build a Docker image
* Build an executable at `target/executable/<component_name>`
* Build a Nextflow module at `target/nextflow/<component_name>`

### Running the unit tests

To run the unit test of one component, you can use the following command:

```bash
viash test src/path/to/config.vsh.yaml
```

To run the unit tests for all components, you can use the following command:

```bash
viash ns test --parallel
```

### Running the benchmark

To run the benchmark, you can use the following command:

```bash
scripts/run_benchmark/run.sh
```
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Open Problems in Single-Cell Analysis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Task Template

This repo is a template to create a new task for the OpenProblems v2. This repo contains several example files and components that can be used when updated with the task info.

> [!WARNING]
> This README will be overwritten when performing the `create_task_readme` script.
## Create a repository from this template

> [!IMPORTANT]
> Before creating a new repository, make sure you are part of the OpenProblems task team. This will be done when you create an issue for the task and you get the go ahead to create the task.
> For more information on how to create a new task, check out the [Create a new task](https://openproblems.bio/documentation/create_task/) documentation.
The instructions below will guide you through creating a new repository from this template ([creating-a-repository-from-a-template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template)).


* Click the "Use this template" button on the top right of the repository.
* Use the Owner dropdown menu to select the `openproblems-bio` account.
* Type a name for your repository (task_...), and a description.
* Set the repository visibility to public.
* Click "Create repository from template".

## Clone the repository

To clone the repository with the submodule files, you can use the following command:

```bash
git clone --recursive [email protected]:openproblems-bio/<repo_name>.git
```
>[!NOTE]
> If somehow there are no files visible in the submodule after cloning using the above command. Check the instructions [here](common/README.md).
## What to do next

Check out the [instructions](https://github.com/openproblems-bio/common_resources/blob/main/INSTRUCTIONS.md) for more information on how to update the example files and components. These instructions also contain information on how to build out the task and basic commands.

For more information on the OpenProblems v2, check out the [documentation](https://openproblems.bio/documentation/).
Loading

0 comments on commit 0233b09

Please sign in to comment.