Skip to content

Commit 7ffb753

Browse files
committed
deploy: b782e93
0 parents  commit 7ffb753

File tree

1,923 files changed

+1190348
-0
lines changed

Some content is hidden

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

1,923 files changed

+1190348
-0
lines changed

.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
README.html
2+
README_files/
3+
*.DS_Store
4+
*__pycache__
5+
*.h5ad
6+
changelogs
7+
8+
# IDE ignores
9+
/.idea/
10+
/.vscode/
11+
12+
# repo specific ignores
13+
output_bash
14+
15+
# R specific ignores
16+
.Rhistory
17+
.Rproj.user
18+
*.Rproj
19+
20+
# viash specific ignores
21+
docker_output/
22+
23+
check_results/
24+
log.txt
25+
.viash*
26+
/resources/
27+
/resources_test/
28+
29+
# nextflow specific ignores
30+
/.nextflow*
31+
/work
32+
output

.nojekyll

Whitespace-only changes.

CHANGELOG.md

+1,100
Large diffs are not rendered by default.

CODE_OF_CONDUCT.md

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official e-mail address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at
64+
[INSERT CONTACT METHOD].
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Contributing to OpenProblems
2+
3+
[OpenProblems](https://openproblems.bio) is a community effort, and
4+
everyone is welcome to contribute. This project is hosted on
5+
[github.com/openproblems-bio/openproblems](https://github.com/openproblems-bio/openproblems).
6+
7+
You can find a full in depth guide on how to contribute to this project
8+
on the [OpenProblems website](https://openproblems.bio/documentation/).
9+
10+
## Code of conduct
11+
12+
We as members, contributors, and leaders pledge to make participation in
13+
our community a harassment-free experience for everyone, regardless of
14+
age, body size, visible or invisible disability, ethnicity, sex
15+
characteristics, gender identity and expression, level of experience,
16+
education, socio-economic status, nationality, personal appearance,
17+
race, caste, color, religion, or sexual identity and orientation.
18+
19+
We pledge to act and interact in ways that contribute to an open,
20+
welcoming, diverse, inclusive, and healthy community.
21+
22+
Our full [Code of Conduct](CODE_OF_CONDUCT.md) is adapted from the
23+
[Contributor Covenant](https://www.contributor-covenant.org), version
24+
2.1.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 OpenProblems
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[![](https://openproblems.bio/images/heros/home_hero_text.png)](https://openproblems.bio)
2+
3+
------
4+
5+
Open Problems is a living, extensible, community-guided benchmarking platform.
6+
7+
Useful links:
8+
9+
* [Introduction to Open Problems](https://openproblems.bio)
10+
* [Our benchmarks](https://openproblems.bio/results)
11+
* [Our datasets](https://openproblems.bio/datasets)
12+
* [Our team and community](https://openproblems.bio/team)
13+
* [Planned and past events](https://openproblems.bio/events)
14+
* [How to contribute](https://openproblems.bio/documentation)

_viash.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
viash_version: 0.8.6
2+
3+
source: src
4+
target: target
5+
6+
config_mods: |
7+
.functionality.version := 'dev'
8+
.platforms[.type == 'docker'].target_registry := 'ghcr.io'
9+
.platforms[.type == 'docker'].target_organization := 'openproblems-bio/openproblems'
10+
.platforms[.type == 'docker'].target_image_source := 'https://github.com/openproblems-bio/openproblems'
11+
.platforms[.type == "nextflow"].directives.tag := "$id"
12+
.platforms[.type == "nextflow"].auto.simplifyOutput := false
13+
.platforms[.type == "nextflow"].config.labels := { lowmem : "memory = 20.Gb", midmem : "memory = 50.Gb", highmem : "memory = 100.Gb", lowcpu : "cpus = 5", midcpu : "cpus = 15", highcpu : "cpus = 30", lowtime : "time = 1.h", midtime : "time = 4.h", hightime : "time = 8.h", veryhightime : "time = 24.h" }
14+
.platforms[.type == "nextflow"].config.script := "process.errorStrategy = 'ignore'"

main.nf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
workflow {
2+
print("This is a dummy placeholder for pipeline execution. Please use the corresponding nf files for running pipelines.")
3+
}

nextflow.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
process.container = 'nextflow/bash:latest'

scripts/sync_resources.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
viash run src/common/sync_test_resources/config.vsh.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
functionality:
2+
name: check_dataset_schema
3+
namespace: common
4+
description: Checks if the dataset has the necessary slots that are predefined in a schema.
5+
argument_groups:
6+
- name: Inputs
7+
arguments:
8+
- name: --input
9+
type: file
10+
required: true
11+
description: A h5ad file.
12+
- name: --schema
13+
type: file
14+
required: true
15+
description: A schema file for the h5ad object.
16+
- name: Arguments
17+
arguments:
18+
- name: --stop_on_error
19+
type: boolean
20+
default: false
21+
description: Whether or not to stop with exit code 1 if the input file does not adhere to the schema.
22+
- name: Output
23+
arguments:
24+
- name: --output
25+
type: file
26+
required: true
27+
description: If specified, this file will contain a structured log of which checks succeeded (or not).
28+
example: checks.json
29+
direction: output
30+
resources:
31+
- type: python_script
32+
path: script.py
33+
test_resources:
34+
- path: /resources_test/common/pancreas
35+
- type: python_script
36+
path: test.py
37+
platforms:
38+
- type: docker
39+
image: openproblems/base_python:1.0.0
40+
test_setup:
41+
- type: python
42+
packages: viashpy
43+
- type: nextflow
44+
directives:
45+
label: [midtime, midmem, midcpu]
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import anndata as ad
2+
import yaml
3+
import json
4+
5+
## VIASH START
6+
par = {
7+
'input': 'work/d4/f4fabc8aa4f2308841d4ab57bcff62/_viash_par/input_1/dataset.h5ad',
8+
'schema': 'work/d4/f4fabc8aa4f2308841d4ab57bcff62/_viash_par/schema_1/schema.yaml',
9+
'stop_on_error': False,
10+
'output': 'work/d4/f4fabc8aa4f2308841d4ab57bcff62/out.yaml',
11+
}
12+
## VIASH END
13+
14+
def check_structure(slot, slot_info, adata_slot):
15+
missing = []
16+
if slot == "X":
17+
slot_info["name"] = "X"
18+
slot_info = [slot_info]
19+
for obj in slot_info:
20+
adata_data = adata_slot.get(obj['name']) if slot != 'X' else adata_slot
21+
if obj.get('required') and adata_data is None:
22+
missing.append(obj['name'])
23+
# todo: check types
24+
return missing
25+
26+
print('Load data', flush=True)
27+
adata = ad.read_h5ad(par['input'])
28+
29+
# create data structure
30+
out = {
31+
"exit_code": 0,
32+
"error": {},
33+
"data_schema": "ok"
34+
}
35+
36+
print("Check AnnData against schema", flush=True)
37+
with open(par["schema"], "r") as f:
38+
data_struct = yaml.safe_load(f)
39+
40+
def_slots = data_struct['info']['slots']
41+
42+
out = {
43+
"exit_code": 0,
44+
"error": {},
45+
"data_schema": "ok"
46+
}
47+
for slot in def_slots:
48+
print("Checking slot", slot, flush=True)
49+
missing = check_structure(slot, def_slots[slot], getattr(adata, slot))
50+
if missing:
51+
print(f"Dataset is missing {slot} {missing}", flush=True)
52+
out['exit_code'] = 1
53+
out['data_schema'] = 'not ok'
54+
out['error'][slot] = missing
55+
56+
with open(par["output"], "w") as f:
57+
json.dump(out, f, indent=2)
58+
59+
if par['stop_on_error']:
60+
exit(out['exit_code'])

0 commit comments

Comments
 (0)