Skip to content

Commit 4257492

Browse files
committed
Add --no-max-contig-length option to turn off splitting on --max-contig-length
1 parent 9a8f613 commit 4257492

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "tola-agp-tpf-utils"
7-
version = "1.3.1"
7+
version = "1.3.2"
88
readme = "README.md"
99
requires-python = ">=3.11"
1010
dependencies = [

src/tola/assembly/build_assembly.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,13 @@ def __build_name_and_sort_assemblies(
302302
new_asm = Assembly(self.name, curated=curated)
303303
assemblies[asm_key] = new_asm
304304

305-
for cut_scffld in self.cut_scaffold_if_too_long(scffld):
305+
cut_scaffolds: list[Scaffold]
306+
if self.max_contig_length is not None:
307+
cut_scaffolds = self.cut_scaffold_if_too_long(scffld)
308+
else:
309+
cut_scaffolds = [scffld]
310+
311+
for cut_scffld in cut_scaffolds:
306312
new_asm.add_scaffold(cut_scffld)
307313

308314
if cut_scffld.rank == 1:

src/tola/assembly/scripts/pretext_to_asm.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ def ul(txt):
199199
""",
200200
default=2_000_000_000,
201201
)
202+
@click.option(
203+
"--no-max-contig-length",
204+
flag_value=True,
205+
default=False,
206+
help="Turns off splitting on --max-contig-length",
207+
)
202208
def cli(
203209
assembly_file: Path,
204210
pretext_file: Path,
@@ -210,6 +216,7 @@ def cli(
210216
keep_map_order: bool,
211217
default_asm_name: str,
212218
max_contig_length: int,
219+
no_max_contig_length: bool,
213220
):
214221
logfile = setup_logging(log_level, output_file, write_log, clobber)
215222

@@ -230,7 +237,7 @@ def cli(
230237
build_asm = BuildAssembly(
231238
"stdout",
232239
autosome_prefix=autosome_prefix,
233-
max_contig_length=max_contig_length,
240+
max_contig_length=None if no_max_contig_length else max_contig_length,
234241
)
235242
build_asm.remap_to_input_assembly(prtxt_asm, input_asm)
236243

0 commit comments

Comments
 (0)