moducomp 0.7.14__py3-none-any.whl → 0.7.17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
moducomp/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
  moducomp: metabolic module completeness and complementarity for microbiomes.
3
3
  """
4
4
 
5
- __version__ = "0.7.14"
5
+ __version__ = "0.7.17"
6
6
  __author__ = "Juan C. Villada"
7
7
  __email__ = "jvillada@lbl.gov"
8
8
  __title__ = "moducomp"
moducomp/moducomp.py CHANGED
@@ -3272,7 +3272,7 @@ def pipeline(
3272
3272
  help="Complementarity size to compute (0 disables).",
3273
3273
  ),
3274
3274
  lowmem: bool = typer.Option(
3275
- False,
3275
+ True,
3276
3276
  "--lowmem/--fullmem",
3277
3277
  "--low-mem/--full-mem",
3278
3278
  help="Run eggNOG-mapper with reduced memory footprint by omitting --dbmem.",
@@ -3449,6 +3449,7 @@ def _run_pipeline_core(
3449
3449
  tmp_emapper_output_dir = f"{get_tmp_dir(savedir)}/emapper_output"
3450
3450
  tmp_emapper_file = f"{tmp_emapper_output_dir}/emapper_out.emapper.annotations"
3451
3451
  ko_matrix_path = f"{savedir}/kos_matrix.csv"
3452
+ kpct_outprefix = "output_give_completeness"
3452
3453
 
3453
3454
  # Process annotations and create KO matrix
3454
3455
  if os.path.exists(ko_matrix_path):
@@ -3517,7 +3518,6 @@ def _run_pipeline_core(
3517
3518
  )
3518
3519
  else:
3519
3520
  # Set up KPCT processing
3520
- kpct_outprefix = "output_give_completeness"
3521
3521
  kpct_input_file = os.path.join(savedir, "ko_file_for_kpct.txt")
3522
3522
 
3523
3523
  # Check if KPCT output already exists
@@ -3602,7 +3602,7 @@ def _run_pipeline_core(
3602
3602
  try:
3603
3603
  validate(
3604
3604
  savedir=savedir,
3605
- mode="ko-matrix",
3605
+ mode="pipeline",
3606
3606
  calculate_complementarity=calculate_complementarity,
3607
3607
  kpct_outprefix=kpct_outprefix,
3608
3608
  strict=validate_strict,
@@ -4151,24 +4151,32 @@ def analyze_ko_matrix(
4151
4151
  # Generate final resource usage summary
4152
4152
  log_final_resource_summary(resource_log_file, start_time, logger, verbose)
4153
4153
 
4154
- # Display pipeline completion summary
4155
- display_pipeline_completion_summary(start_time, savedir, logger, verbose)
4156
-
4157
4154
  if run_validation:
4158
4155
  logger.info("Running post-run validation checks.")
4159
4156
  report_path = None
4160
4157
  if validation_report:
4161
4158
  report_path = os.path.join(savedir, "validation_report.json")
4162
- validate(
4163
- savedir=savedir,
4164
- mode="ko-matrix",
4165
- calculate_complementarity=calculate_complementarity,
4166
- kpct_outprefix=kpct_outprefix,
4167
- strict=validate_strict,
4168
- report=report_path,
4169
- verbose=verbose,
4170
- log_level=log_level,
4171
- )
4159
+ try:
4160
+ validate(
4161
+ savedir=savedir,
4162
+ mode="ko-matrix",
4163
+ calculate_complementarity=calculate_complementarity,
4164
+ kpct_outprefix=kpct_outprefix,
4165
+ strict=validate_strict,
4166
+ report=report_path,
4167
+ verbose=verbose,
4168
+ log_level=log_level,
4169
+ )
4170
+ except typer.Exit as exc:
4171
+ if logger:
4172
+ logger.error("Validation failed with exit code %s.", exc.exit_code)
4173
+ logger.error("Outputs written to: %s", savedir)
4174
+ if report_path:
4175
+ logger.error("Validation report: %s", report_path)
4176
+ raise
4177
+
4178
+ # Display pipeline completion summary
4179
+ display_pipeline_completion_summary(start_time, savedir, logger, verbose)
4172
4180
 
4173
4181
  except Exception as e:
4174
4182
  if logger:
@@ -4753,7 +4761,7 @@ def validate(
4753
4761
  )
4754
4762
 
4755
4763
  # Complementarity checks
4756
- comp_pattern = re.compile(r"module_completeness_complementarity_(\\d+)member\\.tsv$")
4764
+ comp_pattern = re.compile(r"module_completeness_complementarity_(\d+)member\.tsv$")
4757
4765
  comp_files: Dict[int, Path] = {}
4758
4766
  for file_path in Path(savedir).glob("module_completeness_complementarity_*member.tsv"):
4759
4767
  match = comp_pattern.match(file_path.name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: moducomp
3
- Version: 0.7.14
3
+ Version: 0.7.17
4
4
  Summary: moducomp: metabolic module completeness and complementarity for microbiomes.
5
5
  Keywords: bioinformatics,microbiome,metabolic,kegg,genomics
6
6
  Author-email: "Juan C. Villada" <jvillada@lbl.gov>
@@ -153,7 +153,7 @@ This section lists all CLI options implemented today, along with their default v
153
153
  | `--calculate-complementarity`, `-c` | `0` | Complementarity size to compute (0 disables). |
154
154
  | `--adapt-headers/--no-adapt-headers` | `false` | Adapt FASTA headers to `genome|protein_N`. |
155
155
  | `--del-tmp/--keep-tmp` | `true` | Delete temporary files after completion. |
156
- | `--lowmem/--fullmem` (`--low-mem/--full-mem`) | `fullmem` | Run eggNOG-mapper without `--dbmem` to reduce RAM. |
156
+ | `--lowmem/--fullmem` (`--low-mem/--full-mem`) | `lowmem` | Run eggNOG-mapper without `--dbmem` to reduce RAM. |
157
157
  | `--verbose/--quiet` | `false` | Enable verbose progress output. |
158
158
  | `--validate/--no-validate` | `validate` | Run post-run validation checks. |
159
159
  | `--validate-report/--no-validate-report` | `validate-report` | Write `validation_report.json` in the output directory. |
@@ -259,7 +259,7 @@ moducomp validate /path/to/output --strict
259
259
 
260
260
  ### ⚠️ Important note 2
261
261
 
262
- `moducomp` is specifically designed for large scale analysis of microbiomes with hundreds of members, and works on Linux systems with at least **64GB of RAM**. Nevertheless, it can be run on **smaller systems with less RAM, using the flag `--lowmem` (`--low-mem`) when running the `pipeline` command**. The `test` command uses low-memory mode by default and can be switched to full memory with `--fullmem` (`--full-mem`).
262
+ `moducomp` is specifically designed for large scale analysis of microbiomes with hundreds of members, and works on Linux systems with at least **64GB of RAM**. For robustness, **low-memory mode is now the default** for `pipeline` and `test`. If you have ample RAM and want full-memory mode, add `--fullmem` (`--full-mem`).
263
263
 
264
264
  ### Notes on bundled test data
265
265
 
@@ -296,7 +296,7 @@ moducomp pipeline \
296
296
  --ncpus <number_of_cpus_to_use> \
297
297
  --calculate-complementarity <N> # 0 to disable, 2 for 2-member, 3 for 3-member complementarity.
298
298
  # Optional flags:
299
- # --lowmem/--fullmem # Optional: Use low-mem if you have less than 64GB of RAM (default is full mem)
299
+ # --fullmem # Optional: Use full-mem if you have ample RAM (default is low-mem)
300
300
  # --adapt-headers # If your FASTA headers need modification
301
301
  # --del-tmp/--keep-tmp # Delete or keep temporary files
302
302
  # --eggnog-data-dir /path # If EGGNOG_DATA_DIR is not set
@@ -349,8 +349,11 @@ moducomp pipeline ./large_genome_collection ./output_large --ncpus 32 --calculat
349
349
  # For moderate datasets with verbose output
350
350
  moducomp analyze-ko-matrix ./ko_matrix.csv ./output_moderate --ncpus 16 --calculate-complementarity 2 --verbose
351
351
 
352
- # For systems with limited memory
353
- moducomp pipeline ./genomes ./output_lowmem --ncpus 8 --lowmem --calculate-complementarity 2
352
+ # For systems with limited memory (default behavior)
353
+ moducomp pipeline ./genomes ./output_lowmem --ncpus 8 --calculate-complementarity 2
354
+
355
+ # For systems with ample RAM
356
+ moducomp pipeline ./genomes ./output_fullmem --ncpus 8 --fullmem --calculate-complementarity 2
354
357
  ```
355
358
 
356
359
  ## Expected outputs
@@ -1,11 +1,11 @@
1
- moducomp/__init__.py,sha256=X6clbSkbbep0QQrY0sh9zG3HV2dI9AErsPMaQ5342hM,659
1
+ moducomp/__init__.py,sha256=dqEX24o5zZhw4ZWqcPhd9l3D5oqYfLcV2YuZIpeu6uw,659
2
2
  moducomp/__main__.py,sha256=1O2pv6IGjUgqnbqsiMLtVqjxWQpRtZUjp8LDljZ1bsI,185
3
- moducomp/moducomp.py,sha256=Xdtjsx-BAmhZ3LXZgfuGUTzF46Q4bHSjMfvYTrkjLOY,178931
3
+ moducomp/moducomp.py,sha256=z3-PBUK15nbthjbfMRU8R4Hkw2NMEbrNd2aZ8S2S0Uk,179334
4
4
  moducomp/data/test_genomes/IMG2562617132.faa,sha256=gZPh-08pMRdAWJRr3__TbnU1F68CdkDb3gxtpaCLTTc,356863
5
5
  moducomp/data/test_genomes/IMG2568526683.faa,sha256=PxFJwe-68UGw7il1hGlNhZt4-2WzzxXxGE1GTskDnow,343109
6
6
  moducomp/data/test_genomes/IMG2740892217.faa,sha256=WsId4sIPxENbqF6tYFouAgDCy6T0SXNY6TywxBNe-3E,548954
7
- moducomp-0.7.14.dist-info/entry_points.txt,sha256=oIUiacp53fiOCWDXpc2rpq5hS4wDdpasx24EXit3daE,181
8
- moducomp-0.7.14.dist-info/licenses/LICENSE.txt,sha256=pt0cfIq9Wop21KDZYyQgP0M1YWYvKG0PomA5cUDC4TI,1536
9
- moducomp-0.7.14.dist-info/WHEEL,sha256=_2ozNFCLWc93bK4WKHCO-eDUENDlo-dgc9cU3qokYO4,82
10
- moducomp-0.7.14.dist-info/METADATA,sha256=rvBZ2J1n1NDC05UMDB4NE6jq4IG3QRqMqk5plIsfm-4,21640
11
- moducomp-0.7.14.dist-info/RECORD,,
7
+ moducomp-0.7.17.dist-info/entry_points.txt,sha256=oIUiacp53fiOCWDXpc2rpq5hS4wDdpasx24EXit3daE,181
8
+ moducomp-0.7.17.dist-info/licenses/LICENSE.txt,sha256=pt0cfIq9Wop21KDZYyQgP0M1YWYvKG0PomA5cUDC4TI,1536
9
+ moducomp-0.7.17.dist-info/WHEEL,sha256=_2ozNFCLWc93bK4WKHCO-eDUENDlo-dgc9cU3qokYO4,82
10
+ moducomp-0.7.17.dist-info/METADATA,sha256=928kXAKc1Y8aF8stEQ1237vSnHGKsxRXrgv39zoUD8w,21662
11
+ moducomp-0.7.17.dist-info/RECORD,,