Skip to content

Instantly share code, notes, and snippets.

@tuhulab
Last active March 8, 2021 12:47
Show Gist options
  • Save tuhulab/e6d0f69605b8ecd5a84c2693bd9c8218 to your computer and use it in GitHub Desktop.
Save tuhulab/e6d0f69605b8ecd5a84c2693bd9c8218 to your computer and use it in GitHub Desktop.
quick trick to clean pseudo genes
library(dplyr)
a_vector_of_genes <- c("AP005212.4", "Z98257.1", "U62317.4", "CLIC4P3", "PGLYRP2", "NEK4P1")
a_vector_of_cleaned_genes <- data.frame(a_vector_of_genes) %>% filter(!a_vector_of_genes %>% stringr::str_detect("\\d{1,}P$|\\d{1,}P\\d{1,}$|\\.|-AS\\d{1}|-DT")) %>% pull(a_vector_of_genes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment