DORAS is a tool designed to optimize enrichment of adaptive sampling (e.g., Oxford Nanopore Technologies' ReadUntil) by dynamically optimizing the length of the reference based on the read length distribution.
This tool circumvents the limitations of Multi-Locus Sequence Typing (MLST) enrichment where the genomic context of the loci is unknown for clinical isolates. It works in two main phases: extending base MLST loci to capture context and then using the extended references for high-accuracy sequence typing.
- Supported OS
- Requirements
- Installation
- Project Structure
- Configuration
- Usage
- Testing & Development
- Scripts
- Citation
- License
- Linux (Primary support)
- macOS (Tested on Apple Silicon)
- Python: >= 3.12.3
- Tools:
minimap2(>= 2.11)samtoolsbcftoolsseqkitmedaka(for polishing)pyabpoa
Pixi is the recommended package manager. It handles both Python and system dependencies automatically.
- Install Pixi:
curl -fsSL https://pixi.sh/install.sh | sh - Clone and install:
git clone git@github.com:RametteLab/DORAS.git cd DORAS pixi install
To verify that the installation was successful, run a short simulation (pixi run simulate). It extracts reads from a test directory and runs the extension phase, then the query phase, to reproduce the typical behaviour of a real sequencing run.
The config of the run can be changed by modifying the doras_test.toml file. The reads used for the simulation can be found in the test_data directory. This can be modified but they must contain the timestamps of Nanopore in the headers.
The details of how to set up such simulations can be found in the Testing & Development section.
pixi run simulateThe simulation will take a few minutes to complete since it's only building a small extension (default is 3000 bp). If everything is working correctly, you should see this line at the end of script in the terminal:
2026-05-22 10:41:07,639 - INFO - Final ST status: {'Isolate': ['barcode01', 'barcode02', 'barcode03', 'barcode04'], 'ST': ['1115', '1115', '1115', '1115'], 'final_timepoint': [datetime.datetime(2026, 5, 22, 10, 40, 48, 658452), datetime.datetime(2026, 5, 22, 10, 40, 50, 509838), datetime.datetime(2026, 5, 22, 10, 40, 51, 352132), datetime.datetime(2026, 5, 22, 10, 40, 58, 245245)]}
TODO: Add conda installation instructions.
DORAS/
├── src/ # Core source code
│ ├── doras_manager.py # Main orchestration logic
│ ├── doras_extension.py # Extension and trimming logic
│ ├── bigsdb_tools.py # Integration with PubMLST/BigsDB
│ ├── config.py # Configuration and Pydantic models
│ └── ...
├── base_refs/ # Initial MLST loci FASTA files
├── README.md
├── tests/ # Unit and integration tests
├── main.py # Primary CLI entry point
└── pixi.toml # Pixi configuration and tasks
DORAS is configured via TOML files. You can generate or edit these manually or use the Marimo UI.
experiment_name: (String) A unique identifier for your experiment. This name is used for log files and output naming.genome_size: (Integer) The approximate genome size of the target organism (e.g.,5000000for 5MB). Used to estimate required coverage and extension limits.
base_api: (URL) The base REST API endpoint for PubMLST (e.g.,https://rest.pubmlst.org).url: (URL) The specific sequence definition URL for the target scheme. this is the URL that you would use to access the scheme in the browser.scheme: (String) The scheme path on PubMLST (e.g.,schemes/1/).db_selected: (String) The database name on PubMLST (e.g.,pubmlst_escherichia_seqdef).
value: (Path) Path to the local FASTA file containing the initial MLST loci sequences used as seeds for extension.
These loci are used to construct the initial reference and are not modified during extension. They should be created by the user based on the MLST scheme used in the experiment. see examples here for more details.
fastq_files_path: (Path) Directory where the sequencer/basecaller deposits FastQ files (e.g.,path/to/fastq_pass).output_dir: (Path) Directory where results named by the experiment name, temporary files, and logs will be stored.
list: (Array of Strings) List of barcode or sample names to process (e.g.,["barcode01", "barcode02"]). This should match the folder names in thefastq_files_path. In most cases, the file /path/to/fastq_pass/barcode01/ will contain the reads for sample barcode01.
quantile: (Float, 0.0-1.0) The target read length quantile to use for reference extension. A higher value (e.g.,0.95) means longer extensions based on the longer reads in the distribution.min_quantile: (Float, 0.0-1.0) The minimum quantile allowed during dynamic adjustment.min_map_quality: (Integer) Minimum mapping quality (MAPQ) score for a read to be considered for extension or typing (default: 10).min_consensus_depth: (Integer) Minimum read depth required at a position to confidently call a consensus base during extension (default: 20).
Enable test_mode in the TOML to use local FastQ files instead of monitoring a directory for live sequencing. This is useful for simulating runs or re-running analysis on existing data.
[test_mode]
value = false #default is false
test_samples = ["path/to/test.fastq.gz"]
test_start_time = 0
test_end_time = 1
test_start_time_query = 0
test_end_time_query = 1value: (Boolean) Set totrueto enable test mode.test_samples: (Array of Paths) List of paths to FastQ files to use for simulation. Each index of the list corresponds to a sample, if you have only 1 fastq you can copy the same path as done in the example in doras_test.toml.test_start_time/test_end_time: (Integer) The start and end time (in hours) relative to the beginning of the "virtual" run for the Extension Phase.test_start_time_query/test_end_time_query: (Integer) The start and end time (in hours) for the Query Phase simulation.
Test mode allows you to simulate the dynamic behavior of DORAS using existing data. It is particularly useful for optimizing parameters or validating results without needing a live sequencing run.
How it works:
- Historical Data: It takes existing FastQ files (defined in
test_samples) that contain reads with ONT-standard timestamps in their headers. - Read Extraction by Time: DORAS parses these timestamps to determine the relative start time of the experiment. It then extracts reads into "virtual" time windows (controlled by
test_interval). - Simulation Phases:
- Extension Simulation: Reads from
test_start_timetotest_end_timeare progressively "released" into thefastq_files_path. This simulates the first few hours of a run where the reference is being extended. - Query Simulation: Once the reference is ready (or if running in query phase), it simulates the typing process using reads from
test_start_time_querytotest_end_time_query.
- Extension Simulation: Reads from
- Mock File Creation: In the background, a
FastQTimeExtractorcreates mock FastQ files in the input directory at regular intervals, mimicking how MinKNOW/Guppy deposits files during a real run.
DORAS is designed to run alongside a live sequencing run with basecalling enabled.
Constructs an organism-specific extended reference.
# Using pixi
pixi run python main.py --toml config.toml --phase extension
# Or direct python
python main.py --toml config.toml --phase extensionOnce finished, you will be prompted to concatenate the generated final_ref.fasta files for Phase 2.
Performs sequence typing against the extended reference.
python main.py --toml config.toml --phase queryNovel STs (retry behavior): a sample can have a correct allele that is nevertheless new, in which case the PubMLST API returns no ST match. DORAS queries each sample at most 3 times:
- The first query happens as soon as the sample reaches the depth threshold.
- Re-queries only happen after a new polishing step has run (each polish, triggered by a new batch of reads, improves the consensus being queried).
- If no ST is found after the 3 attempts, the sample is still marked as finished,
and its ST column is set to
No_ST_foundto stipulate that no corresponding ST was found on the database.
Final typing results are written to st_results.csv in the experiment output
directory.
Unit tests vs simulations. Two different things share the word "test" here:
- Unit tests —
pixi run testruns the pytest suite intests/. These check individual functions and are what CI runs.- Simulations —
pixi run simulate*run the full pipeline (main.py) on existing FastQ files, driven bydoras_test.toml. In that config, the[test_mode]section means "simulate from existing reads", not unit testing.
Use pixi run to execute predefined tasks:
test: Runs the unit-test suite (pytest tests/).simulate: Runs a full simulation, extension phase then query phase.simulate_ext: Runs the extension phase on the test data.simulate_long: Runs a longer simulation.simulate_full: Runs the full pipeline including the extension compute.clean_up: Removes the temporary simulation directories.
TODO: Add citation information when available.