annotation_results <- rMSI2::peakAnnotation(rMSIprocPeakMatrix = peak_mat_1, params = params)
Error in if ((as.numeric(r[[i]][[j]][5, which.max(r[[i]][[j]][5, ])]) >= :
argument is of length zero
`
The above code line leads to an error if "FinalScore" is NA. Adding "if (!is.na(r[[i]][[j]][5])){}" in lines 103 and 112 and closing them accordingly in lines 111 and 128 seems to prevent this issue
Talked to Roger G about this and he think this NA may come from an issue within "C_isotopeAnnotator" that leads to NA propagation.
`
https://github.com/prafols/rMSI2/blob/1c901a6837ed6d08f485d164f3ac234e28c870f1/R/peakAnnotation.R#L361
The above code line leads to an error if "FinalScore" is NA. Adding "if (!is.na(r[[i]][[j]][5])){}" in lines 103 and 112 and closing them accordingly in lines 111 and 128 seems to prevent this issue
Talked to Roger G about this and he think this NA may come from an issue within "C_isotopeAnnotator" that leads to NA propagation.