utils
Utility functions for parsing.
Small helper functions used across parser modules.
Functions¶
calculate_input_size ¶
Calculate total size of input files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_paths
|
list[Path]
|
List of input file paths. |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
Total size in bytes, or None if any file doesn't exist. |
Source code in snakesee/parser/utils.py
estimate_input_size_from_output ¶
Try to estimate input size by looking for related input files.
This is a heuristic that works for common bioinformatics patterns where output files are derived from inputs with predictable naming conventions.
Examples:
- sample.sorted.bam -> sample.bam
- sample.fastq.gz -> looks for sample.fq.gz, sample.fastq.gz
- sample.vcf.gz -> sample.bam
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
Path
|
Path to the output file. |
required |
workflow_dir
|
Path
|
Workflow root directory. |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
Estimated input size in bytes, or None if not determinable. |