Skip to content

refdb_clean_seq_crop_primers returns NA if one primer is not found #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
FabianRoger opened this issue Nov 25, 2022 · 0 comments
Open

Comments

@FabianRoger
Copy link

FabianRoger commented Nov 25, 2022

refdb_clean_seq_crop_primers returns NA if one primer is not found:

repex:


primer_F <- paste0(rep("A",20), collapse = "")
primer_R <- paste0(rep("T",20), collapse = "")
SEQ <- paste0(rep("CG",10), collapse = "")

seq_w_F <- paste0(primer_F, SEQ, collapse = "")
seq_w_R <- paste0(SEQ, primer_R, collapse = "")
seq_FR <- paste0(primer_F, SEQ, primer_R, collapse = "")

test <- 
tibble(primer = c("seq_w_F",
                  "seq_w_R",
                  "seq_FR",
                  "seq_noP"),
         sequence = c(seq_w_F,
                      seq_w_R,
                      seq_FR,
                      SEQ)) %>% 
  refdb_set_fields(sequence = "sequence")


refdb_clean_seq_crop_primers(test,
                             primer_F,
                             primer_R,
                             include_primers = F)

this results in

 primer  sequence            
  <chr>   <DNA>               
1 seq_w_F NA                  
2 seq_w_R NA                  
3 seq_FR  CGCGCGCGCGCGCGCGCGCG
4 seq_noP NA                 

I think it should default (or have the option) to crop the primers if they are found but to keep it if none or only one is found.

PS. I realize the the function is a wrapper for bioseq::seq_crop_pattern where this is the documented behavior...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant