Consider the read start in the Cys location

This commit is contained in:
coolneng 2021-05-15 17:49:39 +02:00
parent e4189cab01
commit 2058fc96d7
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 3 additions and 2 deletions

View File

@ -110,8 +110,9 @@ get_cys_coordinates <- function(alignment) {
insertion <- unlist(Biostrings::insertion(alignment))
deletion <- unlist(Biostrings::deletion(alignment))
delta_coordinates <- handle_indels(insertion, deletion, cys, alignment)
cys_start <- cys$start + delta_coordinates$start
cys_end <- cys$end + delta_coordinates$end
read_start <- unlist(start(Biostrings::Views(alignment)))
cys_start <- cys$start + delta_coordinates$start + read_start - 1
cys_end <- cys$end + delta_coordinates$end + read_start
return(list("start" = cys_start, "end" = cys_end))
}