Skip to content

Commit b1d1f19

Browse files
committed
feat: add accbase target for ATAC-seq/DNase-seq discovery
Add support for discovering chromatin accessibility datasets (ATAC-seq, scATAC-seq, DNase-seq) from GEO and uploading them to the accbase namespace in PEPhub. - Add "accbase" to valid targets in CLI - Add ACCBASE_FINDER_FILTER and ACCBASE_MAX_SIZE constants - Add accbase branches in queuer (assay-type filter) and uploader - Add accbase_uploader.yml and accbase_checker.yml GitHub Actions - Update README with accbase documentation
1 parent b1b3e2b commit b1d1f19

6 files changed

Lines changed: 99 additions & 3 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check failed cycles and samples for accbase
2+
3+
on:
4+
schedule:
5+
# run every 2 days at 13:00 (offset from bedbase)
6+
- cron: '0 13 1/2 * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
env:
13+
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
14+
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
15+
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
16+
POSTGRES_PORT: ${{ secrets.POSTGRES_PORT }}
17+
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install package
28+
run: python -m pip install .
29+
30+
- name: Check cycles 1-5
31+
run: |
32+
for cycle in 1 2 3 4 5; do
33+
echo "Checking cycle $cycle..."
34+
geopephub run-checker --target accbase --period 2 --cycle-count $cycle
35+
done
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Queue and upload Accbase projects
2+
3+
on:
4+
schedule:
5+
# run every 2 days at 12:00 (offset from bedbase)
6+
- cron: '0 12 1/2 * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
upload:
11+
runs-on: ubuntu-latest
12+
env:
13+
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
14+
POSTGRES_HOST: ${{ secrets.POSTGRES_HOST }}
15+
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
16+
POSTGRES_PORT: ${{ secrets.POSTGRES_PORT }}
17+
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install package
28+
run: python -m pip install .
29+
30+
- name: Add to queue
31+
run: geopephub run-queuer --target accbase --period 2
32+
33+
- name: Upload to PEPhub
34+
run: geopephub run-uploader --target accbase

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
This repository contains `geopephub` CLI, that enables to automatic upload GEO projects to PEPhub based on date and scheduled automatic uploading using GitHub actions.
55
Additionally, the CLI includes a download command, enabling users to retrieve projects from specified namespace directly from the PEPhub database. This feature is particularly helpful for downloading all GEO projects at once.
66

7+
## Supported Targets
8+
9+
The pipeline supports three targets:
10+
11+
- **geo**: All GEO projects (default behavior, no filtering)
12+
- **bedbase**: BED file projects - filters GEO for BED, narrowPeak, and broadPeak files, uploads to the `bedbase` namespace
13+
- **accbase**: Chromatin accessibility projects - filters GEO for ATAC-seq, scATAC-seq, and DNase-seq assays, uploads to the `accbase` namespace
14+
715
## Installation
816
To install `geopephub` use this command:
917
```

geopephub/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616

1717
def validate_target(value: str):
18-
valid_target = ["geo", "bedbase"]
18+
valid_target = ["geo", "bedbase", "accbase"]
1919
if value.lower() not in valid_target:
2020
raise typer.BadParameter(
21-
f"Invalid color '{value}'. Choose from: {', '.join(valid_target)}"
21+
f"Invalid target '{value}'. Choose from: {', '.join(valid_target)}"
2222
)
2323
return value.lower()
2424

geopephub/const.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424
POSTGRES_DIALECT = "postgresql+psycopg"
2525

2626
BEDBASE_MAX_SIZE = "500MB"
27+
28+
# Accbase specific constants
29+
ACCBASE_FINDER_FILTER = "((ATAC-seq) OR (scATAC-seq) OR (DNase-seq))"
30+
ACCBASE_MAX_SIZE = "1GB"

geopephub/metageo_pephub.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import peppy
1313

14-
from geopephub.const import LAST_UPDATE_DATES, BEDBASE_MAX_SIZE
14+
from geopephub.const import LAST_UPDATE_DATES, BEDBASE_MAX_SIZE, ACCBASE_FINDER_FILTER, ACCBASE_MAX_SIZE
1515
from geopephub.utils import get_agent, get_base_db_engine
1616
from geopephub.models import StatusModel, CycleModel
1717
from geopephub.utils import run_geofetch, add_link_to_description
@@ -59,6 +59,11 @@ def add_to_queue_by_period(
5959
gse_list = geofetch.Finder(
6060
filters="((bed) OR narrowPeak) OR broadPeak"
6161
).get_gse_by_date(start_date_str, today_date_str)
62+
elif target == "accbase":
63+
# get chromatin accessibility projects (ATAC-seq, scATAC-seq, DNase-seq)
64+
gse_list = geofetch.Finder(
65+
filters=ACCBASE_FINDER_FILTER
66+
).get_gse_by_date(start_date_str, today_date_str)
6267
elif target == "geo":
6368
gse_list = geofetch.Finder().get_gse_by_date(start_date_str, today_date_str)
6469
else:
@@ -195,6 +200,14 @@ def _upload_gse_project(
195200
data_source="all",
196201
processed=True,
197202
)
203+
elif target == "accbase":
204+
# For accbase, we want all files from ATAC-seq/DNase-seq projects
205+
# No file extension filter - we filter by assay type in the Finder
206+
geofetcher_obj = geofetch.Geofetcher(
207+
filter_size=ACCBASE_MAX_SIZE,
208+
data_source="all",
209+
processed=True,
210+
)
198211
else:
199212
geofetcher_obj = geofetch.Geofetcher()
200213
total_nb = len(log_model_dict.keys())
@@ -254,6 +267,8 @@ def _upload_gse_project(
254267
gse_log.status_info = "pepdbagent"
255268
if target == "bedbase":
256269
tag = pep_tag
270+
elif target == "accbase":
271+
tag = pep_tag
257272
else:
258273
tag = "default"
259274
try:

0 commit comments

Comments
 (0)