Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
branches:
- main
- devel
schedule:
- cron: '15 3 1 * *' # 1st of every month at 3:15
workflow_dispatch:

jobs:
Expand All @@ -18,7 +20,7 @@ jobs:
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
python: [ '3.9', '3.10', '3.11', '3.12' ]
python: [ '3.10', '3.11', '3.12', '3.13' ]

runs-on: ${{ matrix.os }}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![master](https://github.com/ladislav-hovan/sponge/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/ladislav-hovan/sponge/actions/workflows/test.yaml)
[![devel](https://github.com/ladislav-hovan/sponge/actions/workflows/test.yaml/badge.svg?branch=devel)](https://github.com/ladislav-hovan/sponge/actions/workflows/test.yaml)
[![master](https://github.com/kuijjerlab/sponge/actions/workflows/test.yaml/badge.svg?branch=main)](https://github.com/kuijjerlab/sponge/actions/workflows/test.yaml)
[![devel](https://github.com/kuijjerlab/sponge/actions/workflows/test.yaml/badge.svg?branch=devel)](https://github.com/kuijjerlab/sponge/actions/workflows/test.yaml)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)


Expand Down
24 changes: 11 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
namespaces = false

[project]
name = "netzoopy-sponge"
authors = [
Expand All @@ -20,14 +17,14 @@ classifiers = [
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"bioframe",
"numpy",
"pandas",
"pybbi",
"pyjaspar",
"scikit-learn",
"tqdm",
dependencies = [
"bioframe>=0.8.0,<0.9",
"numpy>=2.2.6,<3",
"pandas>=2.3.3,<3",
"pybbi>=0.4.2,<0.5",
"pyjaspar>=4.0.0,<5",
"scikit-learn>=1.7.2,<2",
"tqdm>=4.67.1,<5",
]

[project.scripts]
Expand All @@ -52,15 +49,16 @@ channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.tasks]
sponge = "netzoopy-sponge"

[tool.pixi.dependencies]
python = "3.10.*"
python = ">=3.10.0"

[tool.pixi.pypi-dependencies]
netzoopy-sponge = { path = ".", editable = true }

[tool.pixi.feature.sponge-dev.dependencies]
pytest = "*"
pytest = ">=8.4.0"

[tool.pixi.feature.sponge-dev.tasks]
test = "pytest -m 'not slow'"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _retrieve_region(
# Convert the response into a DataFrame
df = pd.read_csv(buffer, sep='\t', dtype=dtype_dict)

print ('Filtering and modifying dataframe...')
print ('\nFiltering and modifying dataframe...\n')
if self.settings['filter_basic']:
# Filter only for GENCODE basic
df = df[df['GENCODE basic annotation'] == 'GENCODE basic'].copy()
Expand Down Expand Up @@ -162,7 +162,7 @@ def _retrieve_region(
# Columns to be saved into a file
columns = ['Chromosome', 'Start', 'End', 'Transcript stable ID',
'Gene stable ID', 'Gene name', 'Gene type']
print (f'Saving data to: {self.temp_filename}')
print (f'\nSaving data to: {self.temp_filename}')
# Save the file
self.df = df[columns]
self.df.to_csv(self.temp_filename, sep='\t', index=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def retrieve_ppi(
'preferredName_B': 'tf2'}, inplace=True)
if len(ids_to_check) > 0:
# Replace with names that have been queried (as used by JASPAR)
ppi_df['tf1'].replace(p_to_q, inplace=True)
ppi_df['tf2'].replace(p_to_q, inplace=True)
ppi_df['tf1'] = ppi_df['tf1'].replace(p_to_q)
ppi_df['tf2'] = ppi_df['tf2'].replace(p_to_q)
ppi_df.sort_values(by=['tf1', 'tf2'], inplace=True)

print ('\nFinal number of TFs in the PPI network: '
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def filter_edges(
start,end = bed_df.loc[transcript][['Start', 'End']]
# Load all matches in that region from the bigbed file
motifs = bioframe.read_bigbed(bb_ref, chrom, start=start, end=end)
# This is a temporary guard until the name of TFName column
# is fixed for the 2026 release
colnames = ['chrom', 'start', 'end', 'name', 'score', 'strand',
'TFName']
motifs.columns = colnames
# Ensure the entire motif fits within range (not default behaviour)
motifs = motifs[(motifs['start'] >= start) & (motifs['end'] <= end)]
# Filter only the transcription factors in the list
Expand Down
File renamed without changes.
File renamed without changes.
26 changes: 24 additions & 2 deletions tests/sponge/test_motif_prior.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ FOXF2 AATBC 1
FOXF2 ABCC13 1
FOXF2 AGPAT3 1
FOXF2 ASMER1 1
FOXF2 B3GALT5 1
FOXF2 BACH1 1
FOXF2 BACH1-IT1 1
FOXF2 BACH1-IT3 1
FOXF2 BAGE2 1
FOXF2 BTF3P6 1
FOXF2 C21orf58 1
FOXF2 C21orf91 1
FOXF2 CFAP298 1
FOXF2 CFAP298-TCP10L 1
FOXF2 CHODL 1
FOXF2 CLDN14 1
Expand Down Expand Up @@ -51,7 +53,6 @@ FOXF2 ENSG00000231713 1
FOXF2 ENSG00000232193 1
FOXF2 ENSG00000232360 1
FOXF2 ENSG00000232806 1
FOXF2 ENSG00000232855 1
FOXF2 ENSG00000232884 1
FOXF2 ENSG00000233783 1
FOXF2 ENSG00000234340 1
Expand Down Expand Up @@ -151,9 +152,11 @@ FOXF2 ENSG00000310309 1
FOXF2 ERG 1
FOXF2 ETS2 1
FOXF2 ETS2-AS1 1
FOXF2 EVA1C 1
FOXF2 FDPSP6 1
FOXF2 FGF7P2 1
FOXF2 FTCD 1
FOXF2 GART 1
FOXF2 GET1 1
FOXF2 GPX1P2 1
FOXF2 GRIK1-AS1 1
Expand All @@ -166,6 +169,7 @@ FOXF2 IL10RB 1
FOXF2 IMMTP1 1
FOXF2 ITSN1 1
FOXF2 KCNE1 1
FOXF2 KCNJ15 1
FOXF2 KCNJ6-AS1 1
FOXF2 KRTAP10-11 1
FOXF2 KRTAP13-5P 1
Expand Down Expand Up @@ -199,6 +203,7 @@ FOXF2 LINC01687 1
FOXF2 LINC01695 1
FOXF2 LINC01700 1
FOXF2 LINC03105 1
FOXF2 LINC03138 1
FOXF2 LIPI 1
FOXF2 LLPHP2 1
FOXF2 LNCTSI 1
Expand Down Expand Up @@ -249,10 +254,12 @@ FOXF2 SAMSN1-AS1 1
FOXF2 SETD4 1
FOXF2 SH3BGR 1
FOXF2 SIM2 1
FOXF2 SLC19A1 1
FOXF2 SOD1-DT 1
FOXF2 SPATA20P1 1
FOXF2 TIMM9P2 1
FOXF2 TMPRSS15 1
FOXF2 TMPRSS2 1
FOXF2 TMPRSS3 1
FOXF2 TRPM2-AS 1
FOXF2 U6 1
Expand All @@ -264,6 +271,7 @@ FOXF2 ZNF295-AS1 1
FOXF2 ZNF299P 1
FOXF2 ZNF355P 1
GATA2 ABCC13 1
GATA2 BACH1 1
GATA2 BACH1-IT1 1
GATA2 C1QBPP1 1
GATA2 C2CD2 1
Expand Down Expand Up @@ -366,6 +374,7 @@ GATA2 GRIK1-AS1 1
GATA2 HLCS 1
GATA2 HLCS-IT1 1
GATA2 ITSN1 1
GATA2 KCNJ15 1
GATA2 KCNJ6 1
GATA2 KRTAP19-10P 1
GATA2 KRTAP19-7 1
Expand All @@ -387,6 +396,7 @@ GATA2 LINC01700 1
GATA2 LINC02573 1
GATA2 LINC02940 1
GATA2 LNCTSI 1
GATA2 MAP3K7CL 1
GATA2 MIR3156-3 1
GATA2 MIR4327 1
GATA2 MIR4760 1
Expand All @@ -396,6 +406,7 @@ GATA2 MX1 1
GATA2 MX2 1
GATA2 NCAM2 1
GATA2 NIPA2P3 1
GATA2 OLIG2 1
GATA2 RHOT1P2 1
GATA2 RN7SL163P 1
GATA2 RNU6-113P 1
Expand All @@ -409,10 +420,12 @@ GATA2 RUNX1-AS1 1
GATA2 SAMSN1 1
GATA2 SAMSN1-AS1 1
GATA2 TERF1P1 1
GATA2 TMPRSS2 1
GATA2 U3 1
GATA2 UBE2G2 1
GATA2 UBE3AP2 1
GATA2 Y_RNA 1
GATA2 ZBTB21 1
GATA2 ZNF295-AS1 1
JUN AATBC 1
JUN ABCC13 1
Expand All @@ -422,6 +435,7 @@ JUN AGPAT3 1
JUN AIRE 1
JUN APP 1
JUN ASMER1 1
JUN ATP5PF 1
JUN B3GALT5 1
JUN BACH1-IT2 1
JUN BRWD1-AS1 1
Expand Down Expand Up @@ -479,7 +493,6 @@ JUN ENSG00000231136 1
JUN ENSG00000231867 1
JUN ENSG00000231986 1
JUN ENSG00000232124 1
JUN ENSG00000232855 1
JUN ENSG00000233783 1
JUN ENSG00000235023 1
JUN ENSG00000235277 1
Expand Down Expand Up @@ -596,6 +609,7 @@ JUN ETS2 1
JUN ETS2-AS1 1
JUN EXOSC3P1 1
JUN FAM3B 1
JUN GABPA 1
JUN GATD3 1
JUN GET1 1
JUN GET1-SH3BGR 1
Expand All @@ -604,6 +618,7 @@ JUN HLCS-IT1 1
JUN HSF2BP 1
JUN IFNAR1 1
JUN IFNAR2 1
JUN ITGB2 1
JUN KCNE1 1
JUN KCNJ15 1
JUN KCNJ6-AS1 1
Expand Down Expand Up @@ -641,6 +656,7 @@ JUN LINC01690 1
JUN LINC01695 1
JUN LINC02573 1
JUN LINC03104 1
JUN LINC03138 1
JUN LTN1 1
JUN MIR155HG 1
JUN MIR4760 1
Expand All @@ -654,6 +670,7 @@ JUN MTCO1P3 1
JUN MTND6P21 1
JUN MTRES1P2 1
JUN MX1 1
JUN MX2 1
JUN MYL6P1 1
JUN MYL6P2 1
JUN OLIG2 1
Expand All @@ -662,6 +679,7 @@ JUN PCBP3-AS1 1
JUN PCP4 1
JUN PCSEAT 1
JUN PICSAR 1
JUN PKNOX1 1
JUN PLAC4 1
JUN POLR2CP1 1
JUN PSMA6P3 1
Expand All @@ -688,10 +706,13 @@ JUN RPSAP68 1
JUN RRP1 1
JUN RRP1B 1
JUN RUNX1 1
JUN S100B 1
JUN SAMSN1-AS1 1
JUN SETD4 1
JUN SIK1 1
JUN SLC19A1 1
JUN SLC37A1 1
JUN SMIM11 1
JUN SMIM34 1
JUN SNX18P10 1
JUN SOD1 1
Expand All @@ -700,6 +721,7 @@ JUN TCP10L 1
JUN TFF1 1
JUN TIAM1 1
JUN TMEM97P1 1
JUN TMPRSS2 1
JUN TMPRSS3 1
JUN TPT1P1 1
JUN TRPM2-AS 1
Expand Down
2 changes: 1 addition & 1 deletion tests/sponge/test_user_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ motif_output:
weighted: False # False by default
ppi_output:
file_name: "ppi_prior.tsv"
weighted: False # False by default
weighted: False # False by default
6 changes: 3 additions & 3 deletions tests/test_sponge.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from Bio.motifs.jaspar import Motif
from pathlib import Path
from pyjaspar import jaspardb
from pyjaspar import jaspardb, JASPAR_LATEST_RELEASE
from typing import Tuple

from sponge.config_manager import ConfigManager
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_recursive_update(input, expected_output):
import sponge.modules.utils.jaspar_versioning as jaspar_f

@pytest.mark.parametrize('input, expected_output', [
(None, 'JASPAR2024'),
(None, JASPAR_LATEST_RELEASE),
('JASPAR2022', 'JASPAR2022'),
('2024', 'JASPAR2024'),
])
Expand Down Expand Up @@ -417,7 +417,7 @@ def test_full_default_workflow(tmp_path):
_,_ = run_integration_test_common(
tmp_path,
# Default config file
os.path.join('sponge', 'user_config.yaml'),
os.path.join('src', 'sponge', 'user_config.yaml'),
)


Expand Down