Skip to content

Example Tests

github-actions[bot] edited this page Aug 7, 2026 · 2 revisions

Example Tests

The public example data can be used to check a released SGAtools installation on Linux. These are functional examples rather than quick --version checks. The first run downloads the required runtime database archives and caches them for later commands.

Get the example data

Download and extract the public FAA and FNA examples:

wget https://raw.githubusercontent.com/stsnsn/SGAtools/main/examples/SGAtools_examples.tar.gz
tar -xzf SGAtools_examples.tar.gz

This downloads only the example archive, not the complete source repository.

The example inputs are paired by sample name:

examples/
├── faa_dir/   # predicted proteins
└── fna_dir/   # nucleotide genomes

Test SGAmapper

Start with one protein FASTA:

sga-mapper examples/faa_dir/HIMB59.faa \
  --output-dir test-results/mapper-HIMB59 \
  --threads 4

Check that the annotation table was created:

test -s test-results/mapper-HIMB59/sga_mapper.tsv
head test-results/mapper-HIMB59/sga_mapper.tsv

This first mapper run downloads the OG HMM archive if it is not already in the runtime cache.

Test alignment-only classification

Use the matching protein FASTA to test marker extraction and alignment without EPA-ng placement or ANI:

sga-classify examples/faa_dir/HIMB59.faa \
  --onlyalign \
  --output-dir test-results/alignment-HIMB59 \
  --threads 4

Check the main outputs:

test -s test-results/alignment-HIMB59/alignment.faa
test -s test-results/alignment-HIMB59/marker_summary.tsv

This command downloads the SAR11_165 marker HMM archive on first use.

Test full classification

Full classification adds EPA-ng placement and nearest-genome fastANI. Supplying the matching FAA reuses the existing protein predictions:

sga-classify examples/fna_dir/HIMB59.fna \
  --proteins examples/faa_dir/HIMB59.faa \
  --output-dir test-results/classifier-HIMB59 \
  --threads 4

Check the classification output:

test -s test-results/classifier-HIMB59/sga_classification.tsv
head test-results/classifier-HIMB59/sga_classification.tsv

The first full classification can also download the reference-genome archive. EPA-ng placement with the full reference alignment is memory intensive; SGAtools prints a warning when detected physical memory is below 128 GiB.

Test the integrated workflow

To include Prodigal, mapper, classification, and the combined run report in one test, omit --proteins:

sga-run examples/fna_dir/HIMB59.fna \
  --output-dir test-results/run-HIMB59 \
  --threads 4

Check the component and top-level outputs:

test -s test-results/run-HIMB59/mapper/sga_mapper.tsv
test -s test-results/run-HIMB59/classifier/sga_classification.tsv
test -s test-results/run-HIMB59/report.json
test -s test-results/run-HIMB59/run.log

Test directory input

After the single-sample checks, the complete example directories can be used to exercise batch input:

sga-mapper examples/faa_dir \
  --output-dir test-results/mapper-batch \
  --threads 4

sga-classify examples/faa_dir \
  --onlyalign \
  --output-dir test-results/alignment-batch \
  --threads 4

Expected aggregate outputs include:

test -s test-results/mapper-batch/batch_sga_mapper.tsv
test -s test-results/alignment-batch/batch_alignment.faa

Full batch classification and sga-run are available as described in the Command Reference, but require substantially more time and memory than the mapper and alignment-only checks above.

Clone this wiki locally