Skip to main content

install with bioconda

GeneFíor (pronounced Gene "feer", sounds like beer)

This toolkit utilises a combined approach that uses BLAST, BWA, Bowtie2, DIAMOND, and Minimap2 to search DNA and protein sequences against DNA and AA sequence databases - Databases including CARD/RGI and ResFinder are installed with the bioconda package.

Please see GeneFior.pdf for a draft publication.

Requirements:

- python >=3.10
- samtools >=1.19.2
- blast >=2.17.0
- diamond >=2.1.13
- bowtie2 >=2.5.4
- bwa >=0.8.09
- minimap2 >=2.30
- mmseqs2 >=18-8cc5c
- hmmer >=3.4
- seqtk >=1.4
- pigz >=2.8
- fastp >=1.3.5 
- bedtools >=2.31.1

Installation:

GeneFíor is available via bioconda (https://anaconda.org/channels/bioconda/packages/genefior/overview).
To install, use the following command:

conda install -c bioconda genefior

If there are problems installing pigz, ensure conda-forge is added to your channels and try again:

GeneFíor is also available via pip, but conda installation is recommended to ensure all dependencies are correctly installed.

pip install genefior

Quick start

GeneFíor searches reads or supplied gene sequences against selected reference databases. AMRfíor is also available as a separate command for AMR-focused workflows and is kept compatible with the same search and sensitivity options. Run either command with --help to see all options supported by your installed version.

GeneFíor with a custom database

genefior \
  -i reads_R1.fastq.gz,reads_R2.fastq.gz \
  -st Paired-FASTQ \
  --db-path /path/to/database \
  --tools blastn diamond bowtie2 \
  -o results \
  -t 8

AMRfíor with the built-in AMR databases

amrfior \
  -i reads_R1.fastq.gz,reads_R2.fastq.gz \
  -st Paired-FASTQ \
  -o results \
  -t 8

AMRfíor uses the built-in ResFinder and CARD databases by default. GeneFíor uses a user-provided database path; its database setup instructions are in src/GeneFior/databases/.

Input types

  • Paired-FASTQ: paired R1 and R2 FASTQ files separated by a comma.
  • Single-FASTA: a FASTA file containing reads or sequences to search.
  • Genes-FASTA: full-length gene sequences; specify whether they are DNA or amino acid sequences with --genes-type.

Compressed .gz FASTA and FASTQ inputs are supported. Optional paired-read trimming is described below.

Search tools and thresholds

You can choose tools with --tools, or use the defaults shown by genefior --help / amrfior --help. BLASTx and BLASTp are excluded from the usual all selection because they can be slow. Query identity and coverage control which alignments are retained; gene-level coverage, identity, depth, and evidence rules control how those alignments are interpreted.

Search effort is controlled separately with --sensitivity. The plain-language sensitivity guide explains what each preset changes, its trade-offs, and how Bowtie2 mode, BLAST task overrides, Minimap2 read presets, and detection thresholds interact.

Additional commands

The package also includes GeneFíor-Recompute for recalculating detection results from saved alignment output, GeneFíor-Gene-Stats for gene-level visualisation, and GeneFíor-Combine for combining sample matrices. Their options are documented by each command's --help.

Optional paired-read trimming

Add --fastp-trim (also accepted as --fastp or --trim-reads) to a Paired-FASTQ GeneFior or AMRfior run to apply fastp automatic adapter and quality trimming before every selected search tool. The fastp executable must be available in PATH. HTML and JSON QC reports are retained in <output>/fastp/; the trimmed FASTQ files follow the normal temporary-file cleanup policy. Without this option, the log explicitly records that non-trimmed reads were used.

Multiple custom databases with GeneFior

GeneFior accepts multiple independent custom databases through a comma-separated --db-path value:

GeneFior \
  -i reads_R1.fastq.gz,reads_R2.fastq.gz \
  -st Paired-FASTQ \
  --db-path /data/databases/amr,/data/databases/virulence \
  --tools diamond blastn bowtie2 \
  -o results

Each directory must contain its own tool-specific subdirectories, such as diamond/, blast_dna/, and bowtie2/. With multiple paths, GeneFior uses each directory name as the database name in logs and output files. Directory names must therefore be unique. A single path retains the historical user-provided-db output label.

Traditional metagenomic read-to-protein-gene abundance (RPKM)

GeneFior-Metagenomic is a focused DIAMOND blastx workflow for mapping short DNA reads against a prepared amino-acid gene database, assigning each read to its closest threshold-passing reference, and reporting read counts, gene breadth, and RPKM. Single-end input or two paired-end files are accepted; paired reads are counted as individual reads in both the numerator and total read denominator.

GeneFior-Metagenomic \
  -i reads_R1.fastq.gz reads_R2.fastq.gz \
  --database /data/gene_db/proteins.dmnd \
  --reference-fasta /data/gene_db/proteins.faa \
  --gene-lengths /data/gene_db/gene_lengths.tsv \
  --annotations /data/gene_db/classification.tsv \
  --identity-thresholds /data/gene_db/identity_thresholds.tsv \
  --sample-id sample_001 \
  --query-coverage 80 \
  --minimum-identity 50 \
  --require-diamond-version 2.1.6 \
  --minimum-reads 1 \
  --threads 12 \
  --include-zeroes \
  --output-dir results/sample_001

Read hits must cover more than the configured fraction of the read (default 80%). Identity defaults to 50%. The cited analysis's group-specific 60% cutoffs are included as defaults, and any gene group can be configured in a CSV or TSV passed with --identity-thresholds. The table requires pattern and minimum_identity; match_type (exact, contains, regex, or all_terms) and group_name are optional. For example:

pattern,minimum_identity,match_type,group_name
coxL,60,contains,CoxL
my_custom_family,72,contains,My custom family
gene_0042,65,exact,Curated allele 0042
^hydrogenase.*group 4,60,regex,Group 4 hydrogenases

Custom rules take precedence over defaults; exact ID matches are checked before other custom rules, whose row order is retained. Use --no-default-identity-exceptions when the supplied table should be the only source of group-specific cutoffs. Every read is assigned once to its highest bit-score qualifying reference; ties are retained in the read-assignment table and resolved by reference ID for the abundance count. RPKM is read_count / (total_input_reads / 1,000,000) / (gene_length_kb). Since the reference is amino-acid sequence, coding length defaults to three nucleotide bases per amino acid. Supply --gene-lengths with gene_id and length_bp columns to use exact nucleotide gene lengths for RPKM. The report records which length source was used. gene_breadth_coverage_pct is the union of mapped subject amino-acid intervals. The default --minimum-gene-coverage 0 leaves the article's query-cover threshold as the coverage filter; a higher value can be set to require a minimum fraction of the target gene covered.

Outputs include diamond_hits*.raw.tsv, best_read_assignments.tsv, and gene_abundance_rpkm.tsv. The optional annotation TSV must be tab-separated and have a gene_id column; classification, subgroup, family, and hyddb_classification are copied into the abundance report when present. This allows curated HydDB labels to be supplied for hydrogenases rather than inferring their subgroup from sequence IDs. The threshold scheme follows the analysis described in Science, DOI 10.1126/science.adu2182. The actual DIAMOND version, input read counts, thresholds, commands, and RPKM formula are recorded in metagenomic_run_manifest.json; use --require-diamond-version to enforce the cited version.

Always-flag gene review lists

Use --always-flag-genes <file> (alias: --always-flag-gene-list) with GeneFior, AMRfior, or GeneFior-Recompute to provide a CSV, TSV, or plain text list of database gene IDs that should always be surfaced for review when any alignment evidence exists. The IDs must match the gene IDs used in the selected database outputs.

The file can be a one-ID-per-line list, or a CSV/TSV table with a Gene, Gene_ID, GeneID, or ID column:

Gene_ID	Reason
blaCTX-M-1_1_DQ915955	priority review
aac(3)-IIc_1_X54723	priority review

Always-flagged genes are not promoted to detected calls just because they are on the list. In qualified mode, weak flagged evidence is reported as MUST_FLAG_REVIEW with Always_Flagged=1, Evidence_Present=0, and Detected=0. If a flagged gene passes the normal evidence, candidate, or exact thresholds, it keeps that true status and is also marked with Always_Flagged=1. Gene-stats --gene-selection evidence includes these flagged review genes automatically.

PHA4GE hAMRonization output

GeneFior, AMRfior, and GeneFior-Recompute can write positive AMR results in the PHA4GE hAMRonization TSV or JSON schema. The exporter consolidates supporting search tools and writes one row per sample, reference database, and gene family. Normal GeneFior reports remain the detailed audit trail for tool-specific evidence, competing alleles, and warnings.

AMRfior \
  -i reads_R1.fastq.gz,reads_R2.fastq.gz \
  -st Paired-FASTQ \
  -o results \
  --hamronized-output both \
  --hamronized-min-call evidence \
  --sample-id isolate_001 \
  --database-version resfinder=2026-01 \
  --database-version card=4.0.1

The output files are hamronized_report.tsv and/or hamronized_report.json. --hamronized-output is optional and accepts tsv, json, or both. The minimum exported call can be selected with:

  • evidence (default): any call with Evidence_Present=1; legacy-relaxed Detected=1 calls are also supported.
  • candidate: candidate and exact nucleotide allele calls only.
  • exact: exact nucleotide allele calls only.

MUST_FLAG_REVIEW, PARTIAL_OR_DIVERGENT, NOT_DETECTED, and low-evidence always-flag results are never exported as gene presence. Candidate or exact allele names are used only when that resolution tier passes; otherwise the gene-family name is reported with the top database accession retained as reference provenance.

hAMRonization requires a reference database version. GeneFior does not guess one from a filename or installation date, so every selected database must have an explicit --database-version DATABASE=VERSION whenever harmonized output is requested. For a single custom GeneFior database the database label is user-provided-db; with multiple custom databases, each directory name is its database label.

Paired inputs use the inferred common sample name unless --sample-id is provided. Batch runs always use each discovered sample name. Recompute inherits the harmonized format, minimum tier, sample ID, and database versions from the source run_parameters.json; explicitly supplied Recompute options override that metadata.

For nucleotide-supported rows, Gene_Length is exported as reference_gene_length. Protein-search and protein-profile rows use reference_protein_length; their sequence_identity is amino-acid identity. The hAMRonization schema currently has no separate field identifying whether sequence_identity is nucleotide or amino-acid based, so GeneFior preferentially uses nucleotide evidence when otherwise equivalent calls are consolidated.

Search sensitivity

The shared presets configure search effort for each compatible search tool. They do not change identity, coverage, or gene-detection thresholds. See the plain-language sensitivity guide for the current tool-by-tool behavior and trade-offs.

Evidence qualification and allele resolution

GeneFíor no longer treats union coverage alone as proof that one exact database allele is present. Every tool now receives a qualified evidence call:

  • EXACT_ALLELE_DETECTED: literal nucleotide allele support with 100% mean identity, full-length coverage, and allele-resolving support.
  • EXACT_PROTEIN_DETECTED: a protein reference was matched at 100% amino-acid identity and full-length coverage. This is an exact protein match, not proof of an exact nucleotide allele, because synonymous DNA differences are not visible at the protein level.
  • WHOLE_GENOME_PARTIAL: some of the combined genome has mapping evidence, but coverage or quality is insufficient for a near-complete call.
  • WHOLE_GENOME_NEAR_COMPLETE: the combined contigs pass the configured identity, depth, and read-support thresholds and reach at least 80% coverage at the detection depth.
  • WHOLE_GENOME_COMPLETE: the combined contigs have full 1x coverage, at least 95% coverage at the detection depth, and no internal coverage gaps beyond the configured tolerance.
  • WHOLE_GENOME_MAPPED: legacy per-reference mapping status retained for compatibility; new genome-level summaries use the graded statuses above.
  • CANDIDATE_ALLELE_DETECTED: nucleotide allele candidate with full-length support, mean identity at least 98% by default, and allele-resolving support. For read inputs, every base must be covered at least 3x by default; for full-length Genes-FASTA DNA input, one full-length query sequence can support the candidate.
  • ALLELE_LIKE: strong evidence close to the named allele, but candidate or exact identity is unresolved.
  • FAMILY_DETECTED: the gene family is strongly supported, but reads do not distinguish its alleles.
  • PARTIAL_OR_DIVERGENT: an incomplete or divergent mapping pattern that does not pass the user's evidence thresholds.
  • MIXED_OR_MOSAIC: discontinuous or threshold-sensitive evidence inconsistent with one coherent allele.
  • PROFILE_DETECTED: robust HMM profile evidence.
  • MUST_FLAG_REVIEW: a must-flag profile passed the significance filter but failed ordinary evidence thresholds, or a user-listed always-flag gene has some evidence but does not pass ordinary thresholds; it is flagged for review, not counted as positive evidence.
  • NOT_DETECTED: insufficient evidence.

Protein searches (BLASTx, BLASTp, and DIAMOND) cannot by themselves claim an exact nucleotide allele because synonymous differences are invisible. Their strongest normal result is therefore EXACT_PROTEIN_DETECTED, ALLELE_LIKE, or FAMILY_DETECTED. EXACT_PROTEIN_DETECTED requires 100% amino-acid identity and full-length protein coverage, but it does not set Exact_Allele_Detected because synonymous DNA differences are invisible. Nucleotide read tools can make a candidate call when every base is covered at least --evidence-candidate-depth times and the mean identity is at least --evidence-candidate-identity. Full-length DNA Genes-FASTA input uses full-length 1x allele coverage instead of read-depth corroboration. Exact calls are stricter: candidate support plus literal 100% identity.

Whole-genome references can be selected with --db-whole-genome. These runs are mapping-oriented: the default tool set is minimap2, bowtie2, and bwa (with blastn available when explicitly requested), while protein searches and gene/allele resolution are disabled. Mapping statistics and per-base coverage are still reported, with positive genome calls labelled with the graded whole-genome statuses above rather than as gene or allele detections.

Whole-genome runs write both <database>_contig_mapping_summary.tsv and <database>_genome_mapping_summary.tsv. The contig report retains each reference sequence. The genome report combines contigs that use an explicit genome|contig/genome::contig separator or a recognised suffix such as genome_contig_1, genome_scaffold_2, or genome_chr_1; unrecognised names remain separate single-contig genomes. Combined metrics are weighted by contig length and include 1x/2x/3x/5x/10x coverage, mean and median depth, depth CV, mean identity, mapped/passing/unique read support, total and internal gap counts, longest gap lengths, detection-depth coverage, and the final evidence status. WHOLE_GENOME_PARTIAL starts at 20% combined 1x coverage. WHOLE_GENOME_NEAR_COMPLETE requires at least 80% combined coverage at the detection depth (3x by default), plus identity and read-support thresholds. WHOLE_GENOME_COMPLETE additionally requires 100% combined 1x coverage, at least 95% coverage at the detection depth, and no internal gaps.

Important output columns:

  • Evidence_Present=1 means the gene passes the user's configured detection coverage at the qualified evidence depth, identity, and minimum-read thresholds.
  • Candidate_Allele_Detected=1 means the named nucleotide allele is a strong candidate under the configured candidate-depth and candidate-identity thresholds for read inputs, or under full-length 1x coverage and candidate-identity thresholds for DNA Genes-FASTA input.
  • Exact_Allele_Detected=1 means the named nucleotide allele was resolved.
  • Exact_Protein_Detected=1 means the named protein reference was matched exactly; it does not mean the underlying nucleotide allele was resolved.
  • Profile_Detected=1 means a robust HMM profile was detected.
  • Always_Flagged=1 means the gene was supplied through --always-flag-genes and should be reviewed even if Evidence_Present=0.
  • Detected is retained as a backwards-compatible alias of Evidence_Present; it reports whether the user's detection thresholds pass.
  • Evidence_Status and Evidence_Warnings should be used for interpretation.
  • Qualified tool-stat files include Detection_System, Evidence_Status, Evidence_Warnings, Evidence_Present, Candidate_Allele_Detected, Exact_Allele_Detected, and the family/allele-resolution fields.
  • Read export modes detected/evidence and detected-all/evidence-all export threshold-passing calls. The candidate and candidate-all modes restrict output to candidate allele calls, while exact and exact-all restrict output to exact nucleotide allele calls.

New per-database outputs:

  • <database>_detection_matrix.tsv: user-threshold evidence binary calls.
  • <database>_evidence_matrix.tsv: qualified per-tool evidence statuses.
  • <database>_evidence_summary.tsv: evidence, candidate-allele, exact-allele, and always-flagged review counts per tool and across all tools.
  • <database>_allele_resolution.tsv: family-level top database candidate and competing alleles.

These qualified-only files and fields are produced only by --detection-system qualified.

Detection-system compatibility:

  • --detection-system qualified is the default. It reports threshold-passing evidence, distinguishes family/mosaic/allele-like/candidate-allele results, and applies the additional exact-allele requirements.
  • --detection-system legacy-relaxed reproduces the original binary detector: gene coverage, mean identity, covered-region depth, and read count are compared directly with the user's thresholds. It does not require corroborated depth, continuous coverage, competitive uniqueness, or family resolution. For strict historical compatibility, its minimum-read check uses the original alignment/HSP count rather than deduplicated passing-read support. It never labels the result as an exact allele. Legacy tool-stat files report the quantitative mapping statistics followed by one binary Detected column. They do not emit evidence matrices, evidence summaries, allele-resolution reports, or qualified evidence fields. Gene-Stats likewise reports only the binary detection value for legacy runs.
  • --detection-mode is accepted as an alias for --detection-system.

GeneFíor-Recompute (or genefior-recompute)

GeneFíor-Recompute is used to recalculate detection statistics from existing sequence search outputs with different thresholds without needing to rerun the entire analysis.

GeneFíor v0.12.0 - GeneFíor-Recompute: Recalculate detection statistics from existing sequence search outputs

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input directory containing Genefíor results (with raw_outputs/ subdirectory)
  -o OUTPUT, --output OUTPUT
                        Output directory for recomputed results
  --tools {blastn,blastx,diamond,bowtie2,bwa,minimap2,all} [{blastn,blastx,diamond,bowtie2,bwa,minimap2,all} ...]
                        Specify which tools to recompute - "all" will recompute for all detected tools (default: all)

Query threshold Parameters:
  --q-min-cov QUERY_MIN_COVERAGE, --query-min-coverage QUERY_MIN_COVERAGE
                        Minimum coverage threshold in percent (default: 40.0)
  --q-min-id QUERY_MIN_IDENTITY, --query-min-identity QUERY_MIN_IDENTITY
                        Minimum identity threshold in percent (HSP for blast/diamond) (default: 80.0)

Gene Detection Parameters:
  --d-min-cov DETECTION_MIN_COVERAGE, --detection-min-coverage DETECTION_MIN_COVERAGE
                        Minimum coverage threshold in percent (default: 80.0)
  --d-min-id DETECTION_MIN_IDENTITY, --detection-min-identity DETECTION_MIN_IDENTITY
                        Minimum identity threshold in percent (default: 80.0)
  --d-min-depth DETECTION_MIN_DEPTH, --detection-min-depth DETECTION_MIN_DEPTH
                        Minimum per-base depth required across the configured detection coverage in legacy-relaxed mode (default: source run, otherwise 1)
  --d-min-reads DETECTION_MIN_NUM_READS, --detection-min-num-reads DETECTION_MIN_NUM_READS
                        Minimum number of reads required for detection (default: 1)

Output Parameters:
  --report-fasta {None,all,detected,detected-all,evidence,evidence-all,candidate,candidate-all,exact,exact-all}
                        Specify whether to output sequences that "mapped" to genes."all" should only be used for deep investigation/debugging."detected" will report the reads that passed detection thresholds for
                        each detected gene. Evidence modes are explicit aliases; candidate modes restrict output to candidate allele calls; exact modes restrict output to exact nucleotide allele calls. (default: None)
  --report-read-names {all,detected,detected-all,evidence,evidence-all,candidate,candidate-all,exact,exact-all}
                        Write deduplicated read-name files per database/tool/gene. Candidate modes restrict output to candidate allele calls; exact modes restrict output to exact nucleotide alleles. Read names are stored on disk during recompute rather than retained in memory.
  --query-fasta QUERY_FASTA
                        Specify the original query FASTA/FASTQ file used for alignment (required for FASTA reporting from BLAST/DIAMOND).

Recompute memory behaviour:
- By default, read names and per-hit identity values are not retained.
- Coverage/depth uses compact interval boundaries rather than a Python object per covered base.
- Read-name and FASTA reporting are opt-in and use a temporary disk-backed store.
- Query-level thresholds can be tightened safely. Relaxing them below the source run is rejected because source BLAST/DIAMOND outputs were already filtered; use `--allow-incomplete-relaxation` only when accepting incomplete results.

Miscellaneous Parameters:
  -v, --version         Show program version and exit

Examples:
  # Recompute with different thresholds
  GeneFior-recompute -i original_results/ -o recomputed_90_90/ \
    --d-min-cov 90 --d-min-id 90

  # More stringent depth requirement
  GeneFior-recompute -i original_results/ -o high_depth/ \
    --d-min-depth 5 --d-min-reads 10

  # Export threshold-passing read names and sequences for detected genes
  GeneFior-recompute -i original_results/ -o recomputed_with_reads/ \
    --tools blastx --report-read-names detected --report-fasta detected \
    --query-fasta reads.fasta.gz

GeneFíor-Gene-Stats (or genefior-gene-stats)

GeneFíor-Gene-Stats is used to generate summary statistics and visualisations from Genefíor results.

GeneFíor v0.12.0 - GeneFíor-Gene-Stats: Generate detailed coverage visualisations for searched genes

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input directory containing GeneFíor results
  -o OUTPUT, --output OUTPUT
                        Output directory for visualisation reports
  -g GENES, --genes GENES
                        Comma-separated gene names (FULL NAMES) or path to file with gene names (one per line)
  --all-genes           Include all genes found in raw outputs (default: genes with meaningful evidence in evidence_matrix.tsv, falling back to strict detections for older runs)
  --gene-selection {evidence,candidate,exact,candidate-or-exact,all}
                        Select genes automatically from qualified evidence outputs. Use candidate-or-exact to report every candidate or exact nucleotide allele call without specifying gene names.
  --databases {resfinder,card,ncbi} [{resfinder,card,ncbi} ...]
                        Database(s) to interrogate
  --tools {blastn,blastx,diamond,bowtie2,bwa,minimap2,all} [{blastn,blastx,diamond,bowtie2,bwa,minimap2,all} ...]
                        Tool(s) to interrogate
  --ref-fasta REF_FASTA
                        Plain-text reference FASTA file for variant calling (optional)
  --query-fasta QUERY_FASTA
                        Original query FASTA/FASTQ file. Required for FASTA read export from BLAST/DIAMOND results.
  --raw-dir RAW_DIR     Directory containing raw GeneFior alignment outputs. May point directly to raw_outputs/ or to a result directory containing raw_outputs/. Useful when -i/--input is a recompute output.
  --plot-per-tool       Generate individual per-tool coverage PNGs in addition to combined comparison plots (default: off)
  --report-read-names   Write deduplicated read-name files for the selected genes, databases, and tools
  --report-fasta        Write deduplicated read FASTA files for the selected genes, databases, and tools
  --read-selection {all,passing}
                        Export all raw mappings or only mappings passing the original query identity/coverage thresholds (default: passing)

Examples:
  # Visualise specific genes (FULL NAMES) from all tools
  GeneFior-gene-stats -i results/ -o vis/ \
    -g "sul1_2_U12338,tet(W)|ARO:3000194" \
    --databases resfinder card \
    --tools diamond bowtie2 bwa

  # Visualise from gene (FULL NAMES) list file with reference
  GeneFior-gene-stats -i results/ -o vis/ \
    -g genes_of_interest.txt \
    --databases resfinder \
    --tools blastn diamond 

  # Export reads for one selected gene from selected tools
  GeneFior-gene-stats -i results/ -o gene_reads/ \
    -g "tet(Q)_1_L33696" \
    --databases resfinder \
    --tools blastx bowtie2 \
    --report-read-names --report-fasta --read-selection passing \
    --query-fasta reads.fasta.gz

  # Report all candidate/exact allele genes automatically
  GeneFior-gene-stats -i results/ -o candidate_exact_gene_stats/ \
    --gene-selection candidate-or-exact \
    --databases resfinder card \
    --tools blastn bwa minimap2

  # Generate Gene-Stats from a recompute output while using the original raw files
  GeneFior-gene-stats -i recomputed_results/ -o gene_stats/ \
    --raw-dir original_results/raw_outputs \
    --databases resfinder card \
    --tools blastn blastx diamond bowtie2 bwa minimap2 \
    --query-fasta reads_R1.fastq.gz,reads_R2.fastq.gz

GeneFíor-Combine (or genefior-combine)

GeneFíor-Combine is a small standalone tool for combining per-sample *_detection_matrix.tsv files produced by a multi-sample GeneFíor/AMRfíor run into per-database combined matrices. It writes:

  • _combined_detection_matrix.tsv (binary presence/absence matrix compatible with previous behaviour)
  • _combined_detection_matrix_tools.tsv (informative matrix where each cell lists which tools detected the gene in that sample)
  • _combined_evidence_matrix.tsv (qualified per-sample evidence statuses with evidence, candidate, exact, profile, and strict sample counts)

Usage:

GeneFíor-Combine -i /path/to/output_root [--samples-file samples.txt] [--output /path/to/write] [--verbose]
GeneFíor v0.12.0 - GeneFíor-Combine - Combine per-sample detection matrices into per-database combined matrices

options:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Root output directory containing per-sample result folders
  --samples-file SAMPLES_FILE
                        Optional file with one sample folder name per line to include (defaults to all subdirectories)
  --output OUTPUT       Output root directory where combined files will be written (defaults to --input)
  --verbose             Enable verbose/debug logging

Examples:
  GeneFior-Combine -i /path/to/output_dir
  GeneFior-Combine -i /path/to/output_dir --samples-file samples.txt

Database setup

See src/GeneFior/databases/ for instructions and tools for setting up user-provided databases.

Development notes

docs/DEVELOPMENT_NOTES.md preserves historical feature and implementation notes. It is an archive; use this README and the linked guides for current user instructions.


Testing and CI

This repository includes an integration test harness that runs the GeneFíor CLI against a small set of repository-provided test inputs. The harness is located at:

test_data/run_tests.sh

Test data layout

Place the canonical test inputs under test_data/ with this layout:

  • test_data/Genes-AA/all_aa.gz — protein gene FASTA (gzipped)
  • test_data/Genes-DNA/all.gz — nucleotide gene FASTA (gzipped)
  • test_data/Paired-FASTQ/Test_R1.fastq.gz and Test_R2.fastq.gz
  • test_data/Single-FASTA/*.fasta.gz

What the harness does

  • Builds minimal temporary databases under test_data/tmp_user_dbs/resfinder when the local tools are available (runs makeblastdb, diamond makedb, bowtie2-build, bwa index where present). If binaries are missing the harness will still run GeneFíor but may skip index creation.
  • Writes outputs into a centralised directory: test_data/outputs/out_<testname>/. If an out_<testname> already exists it is moved to out_<testname>.prev before the run so the harness can compare new vs previous results.
  • After each successful run the harness computes SHA-256 checksums for stable files in the new and .prev outputs and compares them. By default transient files are excluded from checksums (pipeline_* logs, run.log, and checksum_diff.txt) so only stable data files are compared. When checksums differ a unified diff is written to test_data/outputs/out_<testname>/checksum_diff.txt and the test is marked as failed.
  • The harness uses a relative path to the GeneFíor CLI (../src/GeneFior/GeneFior.py relative to test_data/) so it runs from within the repo without absolute paths. You can override the PYTHON environment variable to use a specific interpreter.

Running tests locally

From the repository test_data directory run:

cd /path/to/GeneFior/test_data
./run_tests.sh

On success the script prints a per-test summary and exits 0. If tests fail it exits non-zero and leaves logs and checksum_diff.txt in test_data/outputs for inspection.

Compare-only mode

If you only want to compare existing out_<test> directories against their .prev counterparts (without re-running the pipeline), use:

./run_tests.sh --compare-only
# or
./run_tests.sh -c

This compares the current outputs against the .prev directory and reports any checksum differences.

Prerequisites and CI

  • The harness and the GeneFíor CLI call external bioinformatics tools (BLAST+, DIAMOND, Bowtie2, BWA, samtools). To run full integration tests locally install the toolchain (Conda + Bioconda is recommended). Example:
conda create -n genefior-test -c conda-forge -c bioconda python=3.11 blast diamond bowtie2 bwa samtools pigz -y
conda activate genefior-test
  • The GitHub Actions CI included with this repository installs the toolchain on the runner so end-to-end tests run in CI.

Metadata

Release files for GeneFior 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GeneFior 0.12.0
File Size Uploaded Provenance Actions
genefior-0.12.0.tar.gz 54.6 MB Without provenance Details for genefior-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for GeneFior 0.12.0
File Interpreter ABI Platform Actions
genefior-0.12.0-py3-none-any.whl Python 3 none any Details for genefior-0.12.0-py3-none-any.whl

Total release size: 109.6 MB

Release files / genefior-0.12.0.tar.gz

Download URL genefior-0.12.0.tar.gz
Size 54.6 MB
Tags Source
SHA-256 checksum
How to use checksums
683fad260f4b4ffa874c823780c99fed1d5c75d32930c6c90ac6aa1bb922036b
BLAKE2b-256 checksum
How to use checksums
40dc160e55330b889501f3962e5017e2ee044e7ad17d187bc542f6f22a9698da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / genefior-0.12.0-py3-none-any.whl

Download URL genefior-0.12.0-py3-none-any.whl
Size 55.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2f30558124f7abbd01722f9c29d128052d1182afc79f89be39da17c40a4e303e
BLAKE2b-256 checksum
How to use checksums
c4294a345c32f880ad057e73ed00db83d98fc00fa8aeebd69e92e5d12b38998a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for GeneFior 0.12.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page