Error in `select(sampled_receptors, all_of(receptor_join_cols))`: i In argument: `all_of(receptor_join_cols)`.
Caused by error in `all_of()`:
! Can't subset elements that don't exist.
x Elements `imd_repertoire_id` and `imd_receptor_id` don't exist.

Expected `all(ann_na_counts == 0)` to be TRUE.
Differences:
`actual`:   FALSE
`expected`: TRUE 

context: downsample n exceeds units
annotation shape: 6x16
repertoire shape: 2x4
missing annotation columns: <none>
missing repertoire columns: <none>
annotation NA counts: imd_receptor_id=0, imd_repertoire_id=6, imd_count=6, imd_proportion=6, n_repertoires=0
repertoire NA counts: imd_repertoire_id=0, n_barcodes=0, n_receptors=2

downsample_immundata warns and keeps repertoire unchanged when n exceeds available units

Expected `all(reps_na_counts == 0)` to be TRUE.
Differences:
`actual`:   FALSE
`expected`: TRUE 

context: downsample n exceeds units
annotation shape: 6x16
repertoire shape: 2x4
missing annotation columns: <none>
missing repertoire columns: <none>
annotation NA counts: imd_receptor_id=0, imd_repertoire_id=6, imd_count=6, imd_proportion=6, n_repertoires=0
repertoire NA counts: imd_repertoire_id=0, n_barcodes=0, n_receptors=2

Expected `nrow(unmatched_repertoire_ids)` to equal 0.
Differences:
  `actual`: 1.0
`expected`: 0.0

context: downsample n exceeds units
annotation shape: 6x16
repertoire shape: 2x4
missing annotation columns: <none>
missing repertoire columns: <none>
annotation NA counts: imd_receptor_id=0, imd_repertoire_id=6, imd_count=6, imd_proportion=6, n_repertoires=0
repertoire NA counts: imd_repertoire_id=0, n_barcodes=0, n_receptors=2
unmatched repertoire ids: NA

Error in `downsample_immundata(idata, n = 10, seed = 42)`: No barcode units were selected. Increase `n`.

Expected `all(ann_na_counts == 0)` to be TRUE.
Differences:
`actual`:   FALSE
`expected`: TRUE 

context: downsample count proportion
annotation shape: 4x14
repertoire shape: 2x4
missing annotation columns: <none>
missing repertoire columns: <none>
annotation NA counts: imd_receptor_id=0, imd_repertoire_id=4, imd_count=4, imd_proportion=4, n_repertoires=0
repertoire NA counts: imd_repertoire_id=0, n_barcodes=0, n_receptors=2