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
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,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
21 changes: 11 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,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 @@ -49,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
4 changes: 2 additions & 2 deletions src/sponge/modules/data_retriever/region_retriever.py
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
4 changes: 2 additions & 2 deletions src/sponge/modules/ppi_retriever/ppi_retriever.py
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
5 changes: 5 additions & 0 deletions src/sponge/modules/utils/tfbs_filtering.py
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
Loading