Found while manually testing a small dataset: `cleanData()` errors out if a run's `gene_struct` table ends up with only the `genome_id` column (no actual structural-variant columns) — which can happen with a very small/homogeneous genome set where Panaroo finds no structural variation.
Error:
```
Error in `tidyr::pivot_longer()`:
! `cols` must select at least one column.
```
It happens here, in `cleanData()`:
```r
DBI::dbReadTable(con, "gene_struct") |>
tidyr::pivot_longer(-genome_id, names_to = "struct", values_to = "value") |>
...
```
`pivot_longer(-genome_id, ...)` has nothing left to pivot when `gene_struct` only has the `genome_id` column, so it throws instead of just producing an empty table.
This is pre-existing on `main` (confirmed the code is unchanged there) — not something introduced by #52. Probably rare on real-sized datasets, but worth a small guard (e.g. skip/short-circuit when there's nothing to pivot) so a degenerate or very small run doesn't crash the whole `runDataProcessing()` call at the very last step.
Found while manually testing a small dataset: `cleanData()` errors out if a run's `gene_struct` table ends up with only the `genome_id` column (no actual structural-variant columns) — which can happen with a very small/homogeneous genome set where Panaroo finds no structural variation.
Error:
```
Error in `tidyr::pivot_longer()`:
! `cols` must select at least one column.
```
It happens here, in `cleanData()`:
```r
DBI::dbReadTable(con, "gene_struct") |>
tidyr::pivot_longer(-genome_id, names_to = "struct", values_to = "value") |>
...
```
`pivot_longer(-genome_id, ...)` has nothing left to pivot when `gene_struct` only has the `genome_id` column, so it throws instead of just producing an empty table.
This is pre-existing on `main` (confirmed the code is unchanged there) — not something introduced by #52. Probably rare on real-sized datasets, but worth a small guard (e.g. skip/short-circuit when there's nothing to pivot) so a degenerate or very small run doesn't crash the whole `runDataProcessing()` call at the very last step.