"In case the perturbation status is only found in 1 cell, scPerturbR does not give you an error message about the number, but rather it complains
Error in res$p.value : $ operator is invalid for atomic vectors
It might be nice to raise an error here so people understand what is going wrong.
Thanks Annique for finding this.