From e694ee329213847db18c1bafc608245ca3f3b7c7 Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 7 Apr 2021 18:41:14 +0200 Subject: [PATCH] Select the first sequence matching the identifier --- src/alignment.r | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alignment.r b/src/alignment.r index 50cc1ff..d5f3e17 100644 --- a/src/alignment.r +++ b/src/alignment.r @@ -24,9 +24,9 @@ parse_data <- function(files) { return(list(sequences, vj_segments, vdj_dataframe)) } -# TODO Test if grep can return more than one match 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])) }