From 7d1c09ca8657afc7bdc9c80a86929ff4ba78de11 Mon Sep 17 00:00:00 2001 From: Vijini Mallawaarachchi Date: Sat, 20 Apr 2024 11:03:01 +0930 Subject: [PATCH 1/2] DOC: Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index eeae50f..b13242e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # GraphBin-Tk: Assembly graph-based metagenomic binning toolkit +![GitHub License](https://img.shields.io/github/license/metagentools/gbintk) [![CI](https://github.com/metagentools/gbintk/actions/workflows/testing_python_app.yml/badge.svg)](https://github.com/metagentools/gbintk/actions/workflows/testing_python_app.yml) +[![codecov](https://codecov.io/gh/metagentools/gbintk/graph/badge.svg?token=r5sniGexZG)](https://codecov.io/gh/metagentools/gbintk) [![CodeQL](https://github.com/metagentools/gbintk/actions/workflows/codeql.yml/badge.svg)](https://github.com/metagentools/gbintk/actions/workflows/codeql.yml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) From 61438c514076de4b3751a07a8fff7cf278f724e0 Mon Sep 17 00:00:00 2001 From: Anuradha Wickramarachchi Date: Sun, 21 Apr 2024 17:32:36 +0930 Subject: [PATCH 2/2] DEV: Add graphbin as a dependency --- pyproject.toml | 3 ++- src/gbintk/cli.py | 61 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 700c6a7..af3d25a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,8 @@ dependencies = ["click", "scipy", "numpy", "pandas", - "tqdm"] + "tqdm", + "graphbin"] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", diff --git a/src/gbintk/cli.py b/src/gbintk/cli.py index e673024..52111ff 100644 --- a/src/gbintk/cli.py +++ b/src/gbintk/cli.py @@ -157,7 +157,68 @@ def graphbin( """GraphBin: Refined Binning of Metagenomic Contigs using Assembly Graphs""" print("Run GraphBin...") + from graphbin.utils import ( + graphbin_Canu, + graphbin_Flye, + graphbin_MEGAHIT, + graphbin_Miniasm, + graphbin_SGA, + graphbin_SPAdes, + ) + class ArgsObj: + def __init__( + self, + assembler, + graph, + contigs, + paths, + binned, + output, + prefix, + max_iteration, + diff_threshold, + delimiter, + ): + self.assembler = assembler + self.graph = graph + self.contigs = contigs + self.paths = paths + self.binned = binned + self.output = output + self.prefix = prefix + self.max_iteration = max_iteration + self.diff_threshold = diff_threshold + self.delimiter = delimiter + + # Make args object + args = ArgsObj( + assembler, + graph, + contigs, + paths, + binned, + output, + prefix, + max_iteration, + diff_threshold, + delimiter, + ) + + # Run GraphBin + # --------------------------------------------------- + if assembler.lower() == "canu": + graphbin_Canu.main(args) + if assembler.lower() == "flye": + graphbin_Flye.main(args) + if assembler.lower() == "megahit": + graphbin_MEGAHIT.main(args) + if assembler.lower() == "miniasm": + graphbin_Miniasm.main(args) + if assembler.lower() == "sga": + graphbin_SGA.main(args) + if assembler.lower() == "spades": + graphbin_SPAdes.main(args) # Main GraphBin2 # -------------------------------------------------------------------