Select the first sequence matching the identifier

This commit is contained in:
coolneng 2021-04-07 18:41:14 +02:00
parent e5a7b726a9
commit e694ee3292
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 2 additions and 2 deletions

View File

@ -24,9 +24,9 @@ parse_data <- function(files) {
return(list(sequences, vj_segments, vdj_dataframe)) return(list(sequences, vj_segments, vdj_dataframe))
} }
# TODO Test if grep can return more than one match
get_vj_sequence <- function(identifier, names, sequences) { get_vj_sequence <- function(identifier, names, sequences) {
row <- grep(names, pattern = identifier) matches <- grep(names, pattern = identifier)
row <- matches[1]
return(as.character(sequences[row])) return(as.character(sequences[row]))
} }