Skip to content

Commit

Permalink
Merge pull request #2 from sdsc-ordes/feat/meta
Browse files Browse the repository at this point in the history
feat: package skeleton
  • Loading branch information
cmdoret authored Dec 15, 2023
2 parents a86e685 + 432a957 commit 49c3bf1
Show file tree
Hide file tree
Showing 16 changed files with 1,544 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/poetry-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: tests

on: [push]

jobs:

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
with:
fetch-depth: 0

# https://github.com/actions/setup-python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

# https://github.com/snok/install-poetry
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'

- name: Code Quality
run: poetry run black . --check

- name: Test with pytest
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_GITHUB_TOKEN }}
GITLAB_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
run: make test
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: install
install: ## Install with the poetry and add pre-commit hooks
@echo "🚀 Installing packages with poetry"
@poetry install
@poetry run pre-commit install

.PHONY: check
check: ## Run code quality tools.
@echo "🚀 Checking Poetry lock file consistency with 'pyproject.toml': Running poetry lock --check"
@poetry lock --check
@echo "🚀 Linting code: Running pre-commit"
@poetry run pre-commit run -a

.PHONY: test
test: ## Test the code with pytest
@echo "🚀 Testing code: Running pytest"
@poetry run pytest

.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

.DEFAULT_GOAL := help
82 changes: 82 additions & 0 deletions assets/schema.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
@prefix ex: <http://example.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix bioschemas: <http://bioschemas.org/> .
@prefix taxon: <http://purl.uniprot.org/taxonomy/> .
@prefix schema: <http://schema.org/> .
@prefix mondo: <http://purl.obolibrary.org/obo/mondo#> .
@prefix ror: <https://ror.org/> .
@prefix smoc: <http://smoc.ethz.ch> .

# Classes

smoc:MODO a rdfs:Class ;
rdfs:label "Multi-Omics Digital Object" ;
rdfs:comment "A digital object which can contain multiple omics data records and samples" .

smoc:CRAMFile a rdfs:Class ;
rdfs:label "CRAM file" ;
rdfs:comment "A file containing aligned genomic intervals" .

smoc:Array a rdfs:Class ;
rdfs:label "Array" ;
rdfs:comment "An array inside a Zarr archive containing data and metadata. Part of a digital object." .

smoc:Reference a rdfs:Class ;
rdfs:label "Reference genome" ;
rdfs:comment "A genome assembly used as reference coordinate system for aligning data records." .

smoc:BioSample a rdfs:Class ;
rdfs:label "Biological sample" ;
rdfs:comment "A sample of biological material." .

# In practice, we should use http://purl.obolibrary.org/obo/ncbitaxon.owl
smoc:Taxon a rdfs:Class ;
rdfs:label "Taxon" ;
rdfs:comment "A taxonomic unit describing a biological entity" .

smoc:OmicsType a rdfs:Class ;
rdfs:label "Omics type" ;
rdfs:comment "A type of omics field, tied to a biological molecule" .

# Properties

smoc:hasTaxonomicRange a rdf:Property ;
rdfs:domain smoc:BioSample, smoc:Reference ;
rdfs:range smoc:Taxon ;
rdfs:label "has taxonomic range" .

smoc:hasSample a rdf:Property ;
rdfs:domain smoc:MODO, smoc:CRAMFile .

smoc:hasRecord a rdf:Property ;
rdfs:domain smoc:MODO ;
rdfs:range smoc:Record ;
rdfs:label "has record" .

smoc:hasReference a rdf:Property ;
rdfs:domain smoc:MODO, smoc:Record ;
rdfs:range smoc:Reference .

smoc:hasOmicsType a rdf:Property ;
rdfs:domain smoc:Array ;
rdfs:range smoc:OmicsType .

smoc:hasLocation a rdf:property ;
rdfs:domain smoc:MODO, smoc:CRAMFile, smoc:Reference ;
rdfs:range xsd:anyURI ;
rdfs:label "has location" ;
rdfs:comment "The location of a resource, either on the filesystem or online" .

smoc:hasTaxId a rdf:Property ;
rdfs:domain smoc:Taxon ;
rdfs:range xsd:integer .

# Named individuals

smoc:Genomics a smoc:OmicsType .
smoc:Transcriptomics a smoc:OmicsType .
smoc:Proteomics a smoc:OmicsType .
smoc:Metabolomics a smoc:OmicsType .
Empty file added data/ex1/archive.zarr/.gitkeep
Empty file.
Binary file added data/ex1/demo1.cram
Binary file not shown.
Binary file added data/ex1/demo2.cram
Binary file not shown.
Loading

0 comments on commit 49c3bf1

Please sign in to comment.