There are multiple ways to adjust pid in r; 4 within the biostrings package:
##PID Method Comparison
#pid1 <- Biostrings::pid(human_chimp_alignment, type = "PID1")
#pid2 <- Biostrings::pid(human_chimp_alignment, type = "PID2")
#pid3 <- Biostrings::pid(human_chimp_alignment, type = "PID3")
#pid4 <- Biostrings::pid(human_chimp_alignment, type = "PID4")
#pid_methods_vector <- c(pid1, pid2, pid3, pid4)
#pid_method <- c("PID1", "PID2", "PID3", "PID4")
#denominator <- c("(aligned positions & internal gap positions)",
# "(aligned positions)",
# "(length of shorter sequence)",
# "(average length of sequences)")
#pid_df <- data.frame(pid_method, pid_methods_vector, denominator)
#colnames(pid_df) <- c("method", "PID", "denominator")
#pander::pander(pid_df)
The different methods will allow you to calculate pid differently by changing the denominator that is divided. This may significantly affect your pid output depending on aligned positions, length of shorter sequences, or the average length of sequences.