Skip to content

docs: follow up on #826 review items #2681

docs: follow up on #826 review items

docs: follow up on #826 review items #2681

Workflow file for this run

# Validate the small set of SDRF examples kept in examples/ for quickstart and
# specification illustration purposes. Annotated public datasets now live at
# bigbio/sdrf-annotated-datasets and are validated by that repository's CI.
name: Validate examples
on:
push:
branches: [ master, dev ]
paths:
- 'examples/**'
pull_request:
branches: [ master, dev ]
paths:
- 'examples/**'
workflow_dispatch:
jobs:
sdrf_proteomics_validations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install git+https://github.com/bigbio/sdrf-pipelines
- name: Validate examples
run: |
shopt -s nullglob
failed=0
# Files with known sdrf-pipelines validator issues unrelated to this
# repo (e.g. ontology cache gaps, regex patterns that don't yet
# accept all documented value forms). Tracked separately.
known_failing=(
"examples/PXD042173/PXD042173.sdrf.tsv"
"examples/PXD006439/PXD006439.sdrf.tsv"
"examples/PXD012667/PXD012667.sdrf.tsv"
)
# Pick the most specific leaf template declared by the file in its
# comment[sdrf template] columns; fall back to ms-proteomics.
detect_template() {
local f="$1"
local declared
declared=$(awk -F'\t' '
NR==1 { for (i=1;i<=NF;i++) if (tolower($i)=="comment[sdrf template]") cols[i]=1 }
NR==2 { for (i in cols) print tolower($i) }
' "$f")
for leaf in olink somascan crosslinking immunopeptidomics \
single-cell dia-acquisition metaproteomics \
human-gut soil water cell-lines; do
if grep -q "$leaf" <<< "$declared"; then
echo "$leaf"; return
fi
done
echo "ms-proteomics"
}
for f in examples/*/*.sdrf.tsv; do
skip=0
for kf in "${known_failing[@]}"; do
if [[ "$f" == "$kf" ]]; then skip=1; break; fi
done
if [[ "$skip" -eq 1 ]]; then
echo "::warning file=$f::skipped (known sdrf-pipelines validator issue)"
continue
fi
template=$(detect_template "$f")
echo "Validating $f (template: $template)"
if ! parse_sdrf validate-sdrf --sdrf_file "$f" --template "$template" --use_ols_cache_only; then
echo "::error file=$f::parse_sdrf validate-sdrf failed"
failed=1
fi
done
exit "$failed"