ASF Tools command line tool-kit for ASF operations.
ASF Tools is a Python-based command-line application designed to streamline and automate repetitive tasks within ASF operations. It provides a suite of utilities for managing sequencing data, interacting with internal services such as the LIMS, and supporting automation workflows for both Illumina and Nanopore (ONT) platforms.
- Authors: Chris Cheshire, Areda Elezi
Requirements:
- Python 3.11
- Linux or macOS (tested in containerized environments)
Development Setup:
- Clone the repository:
git clone https://github.com/FrancisCrickInstitute/asf-tools.git cd asf-tools - Install dependencies for development and testing:
pip install -e ".[dev,tests]"
Formatting and Linting:
ASF Tools can be run as a containerized application (recommended for production) or directly via the CLI for development.
ASF Tools is packaged for use on Nemo. The easiest way to interact is via the scripts in asf-automation-scripts in the scripts folder. All operations must be run from the scripts folder where the config.sh file is located. For example:
./asf-automation-scripts/asf_tools.sh [ARGS]Generate a samplesheet from a folder of Illumina FASTQ files, supporting multi-lane samples and optional path prefix substitution.
asf_tools gen-viral-genomics-samplesheet SOURCE_DIR TARGET_DIR [--curr-prefix CURR_PREFIX --new-prefix NEW_PREFIX]SOURCE_DIR: Directory containing FASTQ files.TARGET_DIR: Directory to write the samplesheet.--curr-prefix: (Optional) Prefix in FASTQ file paths to replace (e.g.,/mnt/data).--new-prefix: (Optional) Replacement prefix for FASTQ file paths (e.g.,/Users/you/data).
Behavior:
- Each (sample id, lane) pair appears as a row in the samplesheet.
- If both
--curr-prefixand--new-prefixare provided, the prefix inread1andread2paths is substituted. - The samplesheet is sorted by sample id, read1, and read2 for consistency.
Creates a run directory for the ONT demux pipeline.
asf_tools ont gen-demux-run [OPTIONS]-s,--source_dir <PATH>: Source directory to look for runs (required).-t,--target_dir <PATH>: Target directory to write runs (required).-p,--pipeline_dir <PATH>: Pipeline code directory (required).-n,--nextflow_cache <PATH>: Nextflow cache directory (required).-w,--nextflow_work <PATH>: Nextflow work directory (required).-c,--container_cache <PATH>: Nextflow Singularity cache directory (required).-r,--runs_dir <PATH>: Host path for the runs folder (required).--use_api: Utilize the Clarity API to generate the samplesheet.--contains <STRING>: Filter run folders by a substring.--samplesheet_only: Update samplesheets only for all runs in the target folder.--nextflow_version <VERSION>: Specify the Nextflow version to use in the sbatch header.
Symlinks demux outputs to the user directory.
asf_tools ont deliver-to-targets [OPTIONS]-s,--source_dir <PATH>: Source directory (required).-t,--target_dir <PATH>: Target directory (required).-d,--host_delivery_folder <PATH>: Host delivery folder path.-i,--interactive: Run in interactive mode to select runs manually.
- Follow Test-Driven Development (TDD): write tests before implementation.
- All new code must be accompanied by tests in the
tests/directory. - Use
pytestfor running tests:pytest
- Ensure code is formatted with
blackandisort, and linted withruff. - Aim for 100% code coverage.
asf_tools/: Main source code.tests/: Flat directory of test modules mirroring the source structure.docs/: Documentation and design notes.output/: Delivery and output files (ignored in version control).pyproject.toml: Project configuration.Dockerfile: Container build file.
See LICENSE for details.
Please contact chris.cheshire@crick.ac.uk for any questions.