Let's say I have this dataset
ds <- data.frame(X1 = c("TP","TP","FN","FN"),
X2 = c("TP","TP","FN","FN"),
X3 = c("TN","TN","FP","FP"),
X4 = c("FP","TN","FP","FP"))
I would like to count how many "TP" "FN" (etc) are in each row and achieve this result:

I have tried to use mutate(total_TP= sum(str_detect(select(X1:X4), "TP"))) but it's not working.
I would like to remain within tidyverse environment.
Thank you