Recore Recore

Docs / Guide

Parameters

Required#

FlagDescription
-p, --presence-absencePanaroo gene_presence_absence.csv
-r, --pan-referencePanaroo pan_genome_reference.fa
-g, --genomesDirectory of genome FASTA files (.fasta, .fa, .fna, also .gz)

Optional#

FlagDefaultDescription
-a, --annotationsnoneDirectory of GFF3 annotation files. Required for SPLIT/START_VARIANT classification and synteny validation.
-o, --outputrecore_output/Output directory
-t, --threads4Number of parallel threads (for rayon classification and minimap2)

Recore matches FASTA and GFF files by exact matrix column name first, then by an embedded ASxxxxx identifier. For single-contig genomes, GFF seqids are normalized internally to the FASTA contig name so --synteny can work when a GFF uses contig_1 or L4_AS00146 but the FASTA contig is AS00146.

Numeric parameters are validated before the pipeline starts: percentages must be finite values between 0 and 100, fractions between 0 and 1, thread count and NSC k-mer size must be at least 1, and --nsc-engine must be minhash or mmseqs2.

Alignment#

FlagDefaultDescription
--presetasm5minimap2 preset. asm5 for sequences ≤5% divergence (MTBC, closely related strains). asm20 for up to 20% divergence (more divergent species).
--min-identity90.0Minimum % nucleotide identity to consider a hit. For MTBC, the default (90%) is appropriate: real genes have >99%. Lowering this increases PARALOG noise.
--min-coverage80.0Minimum % of reference sequence that must be covered by a hit (single hit or merged fragments).
--multi-allelefalseUse all alleles per cluster as queries. More sensitive for clusters with high intra-cluster diversity, but slower. Panaroo produces multiple alleles in pan_genome_reference.fa.

Filtering#

FlagDefaultDescription
--min-prevalence0.1Minimum fraction of genomes where a cluster must be present to attempt rescue. Clusters present in fewer genomes are likely truly accessory and skipped. Set to 0.0 to attempt rescue of all gaps.

Rescue options#

FlagDefaultDescription
--syntenyfalseValidate each rescue by adaptive 1-to-5-neighbour flanking context against reference genomes. Requires --annotations. Boosts synteny-consistent rescues (×1.2), reports quantitative synteny metrics, and rejects explicit synteny failures from the corrected matrix while writing them to synteny_rejected_report.tsv. Independently, PARALOG candidates without explicit synteny support are rejected to paralog_rejected_report.tsv.
--write-corrected-gfffalseWrite a corrected_gff/*.recore.gff3 file for each genome with a matrix-corrected rescue, with those CDS features appended. Original GFF records are preserved when --annotations is provided.
--write-rescued-fastafalseWrite rescued_genes.fna and rescued_genes.faa: the sequence of every cell the binary matrix gained, read in the gene's direction, and its protein (bacterial code, table 11) where the reading frame is known. IDs match the features of --write-corrected-gff.
--search-cachenoneDirectory to keep minimap2 results in and reuse them from. A rerun that changes the matrix policy, coverage, synteny or the prevalence floor aligns only the sequences it has not seen before; a changed genome, query sequence, preset, --min-identity or minimap2 version is searched afresh. Results are identical with and without it.
--write-html-reportfalseWrite a self-contained recore_report.html with headline QC, correction counts, evolutionary mechanisms, top candidate clusters, and links to the underlying audit files.
--matrix-policybalancedControls which accepted rescues can enter the binary corrected matrix. strict corrects only STRICT_PRESENT and ALIAS_CLUSTER; balanced also corrects full-length SEQUENCE_ONLY; sensitive also corrects partial/disrupted accepted evidence for exploratory analyses. In all modes, the adaptive orthology-quality guard can keep weak accepted evidence as audit_only_quality.
--reference-genomenoneAudit one genome column/reference background by exact matrix name or embedded ASxxxxx identifier. Runs a reference-only shadow search and writes reference_genome_audit.tsv with new_to_reference, reference_like_or_present, and reference_like_ambiguous classifications, plus publication_confidence labels for clean, complex/paralogous, event-derived, fragmented, pseudogene, and unresolved reference evidence. Also writes reference_cluster_events.tsv for reference-absent clusters whose representative sequence is best explained as an allele, fragment, or partial homologue of a reference gene. These rows are audit-only and do not change the binary matrix.
--treenoneOptional rooted Newick tree. When provided, Recore uses Fitch parsimony on the corrected presence/absence state to add ancestral state, root-state confidence, gain/loss counts, carrier-MRCA purity, Dollo-like fit, monophyly, and phylogenetic pattern calls to evolutionary_events.tsv. Tip names can match matrix columns exactly or by embedded ASxxxxx identifiers.
--mobile-element-referencenoneOptional nucleotide FASTA of mobile elements, insertion sequences, or transposase loci. Recore aligns these sequences to genomes with rescue/disruption evidence and reports nearby hits in evolutionary_events.tsv as mobile_element_source=sequence, so IS support can be sequence-based rather than dependent on GFF product names.
--mobile-element-min-identity85.0Minimum identity for sequence-based mobile-element hits.
--mobile-element-min-coverage50.0Minimum query coverage for sequence-based mobile-element hits.
--mobile-element-window1000Maximum distance in bp from a rescue/disruption interval to report mobile-element support. IS interruption calls still require close evidence within 250 bp.

Nucleotide Similarity Clustering#

FlagDefaultDescription
--nsclusterfalseEnable NSC. Detects and merges Panaroo clusters that are nearly identical at the DNA level but split at the protein level.
--nsc-engineminhashClustering engine: minhash (built-in, approximate, no dependencies) or mmseqs2 (exact, requires MMseqs2 in PATH).
--nsc-kmer-size21k-mer size for MinHash sketching. Larger values are more specific (fewer false positives).
--nsc-threshold0.8Maximum containment threshold for MinHash. Pairs above this are merged.
--nsc-min-seq-id0.9Minimum sequence identity for MMseqs2 linclust (0.0-1.0).
--nsc-coverage0.8Minimum bidirectional coverage for MMseqs2 linclust (0.0-1.0).

Logging#

FlagDefaultDescription
-v, --verbosefalseEnable DEBUG-level log output. Shows GFF loading details, synteny decisions (including why individual rescues pass/fail), per-genome missing FASTA warnings, and the top 10 rescues.

Parameter Guide by Organism#

M. tuberculosis complex (MTBC)#

MTBC has >99.95% average nucleotide identity across strains. This has two consequences:

  1. Real genes have very high identity; PARALOGs (90-94%) are nearly always noise
  2. PE/PPE genes (~170 families with high mutual similarity) are a major source of cross-matches

Recommended command:

recore \
  -p gene_presence_absence.csv \
  -r pan_genome_reference.fa \
  -g genomes/ \
  -a annotations/ \
  --synteny \
  --multi-allele \
  --nscluster \
  --nsc-engine mmseqs2 \
  --nsc-min-seq-id 0.9 \
  --nsc-coverage 0.8 \
  --preset asm5 \
  --min-prevalence 0.0 \
  -t 8

Why --min-prevalence 0.0: In MTBC, even rare accessory clusters can have real false absences due to annotation differences. 0.0 ensures nothing is skipped.

Why asm5: Strains are <5% divergent. asm5 is faster and more accurate at this range.

Why mmseqs2 for NSC: More precise than MinHash for detecting the redundant annotation clusters common in MTBC pangenome analyses.


More divergent bacteria / pan-genome with 95% ANI#

recore \
  -p gene_presence_absence.csv \
  -r pan_genome_reference.fa \
  -g genomes/ \
  -a annotations/ \
  --synteny \
  --multi-allele \
  --nscluster \
  --preset asm20 \
  --min-prevalence 0.05 \
  -t 8

Why asm20: Allows up to 20% divergence, which is needed when comparing strains from the same species but different lineages.

Why --min-prevalence 0.05: Rare accessory clusters (present in <5% of genomes) generate excessive cross-match noise across the matrix.


Threshold Effects#

--min-identity (alignment filter)#

Affects PARALOG counts most strongly. If you see an unexpectedly large number of PARALOGs:

--min-coverage (coverage filter)#

Controls the boundary between PSEUDOGENE:PartialDeletion (60-80%) and no rescue (<60%):

--min-prevalence (gap filter)#

Affects total rescues and PARALOG rate:

For core/soft-core analysis, --min-prevalence 0.0 is recommended. For reducing runtime on large datasets, 0.05 is a reasonable compromise.

--nsc-threshold (NSC similarity)#

Controls how aggressively redundant clusters are merged:

For MTBC, prefer MMseqs2 with --nsc-min-seq-id 0.9 over MinHash, as it uses exact alignment identity.

Edit this page on GitHub