Skip to content
Merged

Dev #75

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
21 changes: 21 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# History

1.8.1 (2025-09-27)
------------------

* Fixes minor issues with `--skip_qc` (#73) and `--no_chromosome` (#74)

1.8.0 (2025-06-12)
------------------

* Fixes issues with `--skip_qc` when using non gzipped FASTQ reads (#60)
* Fixes issue with fastp versions #64
* Add skip_mash to run Plassembler without the database mash search #61

1.8.0 (2025-06-23)
------------------

* Relaxes Python version dependency to >=3.8,<3.14 from >=3.8,<3.10
* Minor change to log file error behaviour #69
* Thanks @rrwick for both changes

* Bug fix with `--force` for `plassembler download`, which will only remove the output directory if `--force` is specified (#49).

1.6.2 (2024-03-08)
------------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "plassembler"
version = "1.8.0" # change VERSION too
version = "1.8.1" # change VERSION too
description = "Quickly and accurately assemble plasmids in hybrid sequenced bacterial isolates"
authors = ["George Bouras <george.bouras@adelaide.edu.au>"]
license = "MIT"
Expand Down
16 changes: 12 additions & 4 deletions src/plassembler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def begin_plassembler(outdir, force):
# get start time
start_time = time.time()

# ensure sys exit if error
logger.add(lambda _: sys.exit(1), level="ERROR")

# instantiate the outdir
# remove outdir on force
if force is True:
Expand All @@ -94,8 +97,6 @@ def begin_plassembler(outdir, force):
log_file = os.path.join(outdir, f"plassembler_{start_time}.log")
# adds log file
logger.add(log_file)
# ensure sys exit if error
logger.add(lambda _: sys.exit(1), level="ERROR")

logger.info(f"You are using Plassembler version {get_version()}")
logger.info("Repository homepage is https://github.com/gbouras13/plassembler")
Expand Down Expand Up @@ -1276,6 +1277,11 @@ def long_options(func):
help="Use --nano-raw for Flye. \nDesigned for Guppy fast configuration reads. \nBy default, Flye will assume SUP or HAC reads and use --nano-hq.",
is_flag=True,
),
click.option(
"--keep_fastqs",
help="Whether you want to keep FASTQ files containing putative plasmid reads \nand long reads that map to multiple contigs (plasmid and chromosome).",
is_flag=True,
),
click.option(
"--keep_chromosome",
help="If you want to keep the chromosome assembly.",
Expand Down Expand Up @@ -1341,6 +1347,7 @@ def long(
pacbio_model,
skip_qc,
raw_flag,
keep_fastqs,
keep_chromosome,
flye_directory,
flye_assembly,
Expand Down Expand Up @@ -1371,6 +1378,7 @@ def long(
logger.info(f"--force is {force}")
logger.info(f"--skip_qc is {skip_qc}")
logger.info(f"--raw_flag is {raw_flag}")
logger.info(f"--keep_fastqs is {keep_fastqs}")
logger.info(f"--pacbio_model is {pacbio_model}")
logger.info(f"--keep_chromosome is {keep_chromosome}")
logger.info(f"--flye_directory is {flye_directory}")
Expand Down Expand Up @@ -1518,7 +1526,7 @@ def long(
outdir,
prefix,
False, # unicycler success
False, # keep fastqs
False, # keep fastqs will be false here as no chromosome
False, # assembled mode
True, # long only
False, # raven false
Expand Down Expand Up @@ -1730,7 +1738,7 @@ def long(
outdir,
prefix,
unicycler_success, # unicycler success
False, # keep fastqs
keep_fastqs, # keep fastqs
False, # assembled mode
True, # long only
False, # no raven
Expand Down
2 changes: 1 addition & 1 deletion src/plassembler/utils/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.8.1
1 change: 1 addition & 0 deletions src/plassembler/utils/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def move_and_copy_files(
:param out_dir: Output Directory
:param prefix: prefix
:param unicycler_success_flag: whether or not unicycler worked
:param keep_fastqs: whether to keep FASTQs
:param assembled_mode: whether or not unicycler worked
:param long_only: whether or not unicycler worked
:param use_raven: whether or not unicycler worked
Expand Down
2 changes: 1 addition & 1 deletion src/plassembler/utils/no_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def create_fake_flye_chromosome_info(assembly_info_file: Path) -> None:
}

flye_info_df = pd.DataFrame(data)
flye_info_df.to_csv(assembly_info_file, index=False)
flye_info_df.to_csv(assembly_info_file, sep="\t", index=False)
9 changes: 9 additions & 0 deletions tests/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ def test_plassembler_long(self):
exec_command(cmd)
remove_directory(outdir)

def test_plassembler_long_keep_fastqs(self):
"""test plassembler long"""
longreads: Path = f"{end_to_end}/input_fastq.gz"
chromosome = 50000
outdir: Path = f"{end_to_end}/test_out_keep_fastqs"
cmd = f"plassembler long -l {longreads} -c {chromosome} -d {plassembler_db_dir} -o {outdir} -t 8 -f --keep_fastqs"
exec_command(cmd)
remove_directory(outdir)

def test_plassembler_long_skipmash(self):
"""test plassembler long --skip_mash - no need for -d"""
longreads: Path = f"{end_to_end}/input_fastq.gz"
Expand Down
Loading