Modular Workflow Execution
The Tractor Nextflow Workflow is built to run the following three core modules:
- Phasing (using SHAPEIT5)
- Local Ancestry Inference (LAI) (either of RFMix2, GNomix, or FLARE)
- Tractor GWAS - Pre-Tractor step (ancestry-specific tract extraction)
- Tractor GWAS
 
You can run the entire pipeline end-to-end (complete mode) run only specific modules (or combinations of them) by setting the --mode argument.
 This flexibility allows you to start from different points in the workflow depending on what data you already have.
For a full example of a complete run, see: Launching an NXF Workflow.
Workflow Modes
There are 9 modes you can choose from. Each mode runs a different combination of modules and may require additional arguments depending on what data you are providing.
Remember: --lai_tool {rfmix2, gnomix, flare} is required for all modes (except phasing_only or tractor_only modes).
- Modes, Descriptions, and Required Arguments
- Additional Required Arguments Formatting
- Output Directories
Modes, Descriptions, and Required Arguments
| Mode | What it Runs | Additional Required Arguments | 
|---|---|---|
| complete | Full workflow: Phasing → LAI → Pre-Tractor → Tractor | As described here | 
| phasing_only | Phasing only (using SHAPEIT5) | No additional required arguments. | 
| phasing_lai | Phasing + LAI | --chr,--lai_tool | 
| phasing_lai_pretractor | Phasing + LAI + Pre-Tractor | --chr,--lai_tool | 
| lai_only | LAI only (requires phased VCF as input) | --chr,--phased_vcf,--lai_tool | 
| lai_pretractor | LAI + Pre-Tractor (requires phased VCF) | --chr,--phased_vcf,--lai_tool | 
| lai_pretractor_tractor | LAI + Pre-Tractor + Tractor (requires phased VCF) | --chr,--phased_vcf,--lai_tool | 
| pretractor_tractor(RFMix2/GNomix) | Pre-Tractor + Tractor using existing LAI results (phased VCF + MSP file) | --chr,--phased_vcf,--msp | 
| pretractor_tractor(FLARE) | Pre-Tractor + Tractor using existing FLARE results (FLARE output VCF) | --flare_anc_vcf | 
| tractor_only | Tractor GWAS only (requires hapcount/dosage files) | --chr,--hapdos | 
Additional Required Arguments Formatting
| Argument | Description | Example | 
|---|---|---|
| --chr | Chromosome ( chr1or1). Must match the naming convention used in your VCF, reference VCF, genetic map files. | --chr 22 | 
| --lai_tool | LAI tool to use. Options: rfmix2,gnomix, orflare. | --lai_tool rfmix2 | 
| --phased_vcf | Phased VCF file (with index in same directory). Index not required in pretractor_tractormode. | --phased_vcf /path/to/phased_chr22.vcf.gz | 
| --msp | MSP file corresponding to the phased VCF. If --gnomix_phase=true, use the newly generated VCF. | --msp /path/to/results_chr22.msp.tsv | 
| --flare_anc_vcf | Phased VCF file with ancestry estimates. Input file be generated by FLARE. | --flare_anc_vcf /path/to/flare_ancestry_chr22.vcf.gz | 
| --hapdos | Prefix of hapdos files. The workflow detects all files automatically. Files usually follow <prefix>_<chr>.anc0.hapcount.txt. Do not include chromosome in the prefix. | If file = /path/to/results/results1_22.anc0.hapcount.txt, use:--hapdos /path/to/results/results1 | 
Output Directories
All relevant output directories will be generated based on the mode used. Please see Output overview for description of all files generated.