Skip to content

Commit

Permalink
Merge pull request #90 from MicrobialDarkMatter/bump-pymethylation-utils
Browse files Browse the repository at this point in the history
updated pymethylation_utils
  • Loading branch information
SorenHeidelbach authored Jan 14, 2025
2 parents 94ba917 + 8fa1e4e commit da56491
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nanomotif/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.0"
__version__ = "0.5.1"
8 changes: 4 additions & 4 deletions nanomotif/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def check_install(args, pl):
# Binnary - contamination and inclusion
from nanomotif.binnary import data_processing, detect_contamination, include_contigs
from nanomotif.binnary.logging import set_logger_config
from pymethylation_utils.utils import run_methylation_utils
from pymethylation_utils.utils import run_epimetheus


def binnary(args, pl):
Expand Down Expand Up @@ -479,9 +479,9 @@ def binnary(args, pl):
if os.path.isfile(os.path.join(args.out,contig_methylation_file)) and not args.force:
log.info("motifs-scored-read-methylation.tsv exists. Using existing file! Use --force to override this.")
elif not os.path.isfile(os.path.join(args.out, contig_methylation_file)) or args.force:
log.info(f"Running methylation_utils to create {contig_methylation_file}")
log.info(f"Running epimetheus to create {contig_methylation_file}")
# Create motifs-scored-read-methylation
return_code = run_methylation_utils(
return_code = run_epimetheus(
pileup = args.pileup,
assembly = args.assembly,
motifs = motifs_in_bin_consensus,
Expand All @@ -491,7 +491,7 @@ def binnary(args, pl):
)

if return_code != 0:
log.error("Error running methylation_utils")
log.error("Error running epimetheus")


log.info("Loading assembly file...")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"scikit-learn>=1.5.2",
"networkx>=3.1",
"pyarrow>=15.0.2",
"pymethylation_utils==0.4.0",
"pymethylation_utils==0.5.1",
"hdbscan",
"Bio>=1.6.2",
"snakemake>=7.32.4",
Expand Down
8 changes: 4 additions & 4 deletions tests/binnary/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import polars as pl
import pandas as pd
import nanomotif.binnary.utils as ut
from pymethylation_utils.utils import run_methylation_utils
from pymethylation_utils.utils import run_epimetheus
from .conftest import MockArgs
import os
from pathlib import Path
Expand Down Expand Up @@ -31,7 +31,7 @@ def test_split_bin_contig():
def test_methylation_utils():
args = MockArgs()

run_methylation_utils(
run_epimetheus(
pileup = "nanomotif/datasets/geobacillus-plasmids.pileup.bed",
assembly = "nanomotif/datasets/geobacillus-plasmids.assembly.fasta",
motifs = ["GATC_m_3", "GATC_a_1"],
Expand All @@ -45,7 +45,7 @@ def test_methylation_utils():

res = pl.read_csv(file, separator = "\t")
print(res.columns)
assert res.columns == ["contig", "median", "N_motif_obs", "mean_read_cov","motif", "mod_type", "mod_position"]
assert res.shape == (4, 7), "Shape does not match"
assert res.columns == ['contig', 'motif', 'mod_type', 'mod_position', 'median', 'mean_read_cov', 'N_motif_obs', 'motif_occurences_total']
assert res.shape == (4, 8), "Shape does not match"


0 comments on commit da56491

Please sign in to comment.