mirror of
https://github.com/dchakro/shared_Rscripts.git
synced 2026-05-17 09:12:16 -07:00
Squashed commit of the following:
commit631eef6e8bAuthor: Deepankar Chakroborty <deepankar.chakroborty@utu.fi> Date: Wed Jul 29 14:41:00 2020 +0300 Switch to stringi to improve performance. commit99a6589b9bAuthor: Deepankar Chakroborty <deepankar.chakroborty@utu.fi> Date: Wed Jul 29 14:39:44 2020 +0300 Include MutSiteFind.R and improved installing dependencies unparalogMutations checks & installs dependencies only when it is sourced, and not everytime the function was called (as previously). commita044ac9f09Author: Deepankar Chakroborty <deepankar.chakroborty@utu.fi> Date: Wed Jul 29 14:19:03 2020 +0300 updated 20200714 commitcd79464c4eAuthor: Deepankar Chakroborty <deepankar.chakroborty@utu.fi> Date: Wed Jul 29 13:12:47 2020 +0300 Squashed commit of the following: commit23f5db8f0fAuthor: Deepankar Chakroborty <deepankar.chakroborty@utu.fi> Date: Wed Jul 29 13:12:26 2020 +0300 Changed to Apache License 2.0 commit21ad1ee706Author: Deepankar Chakroborty <deepankar.chakroborty@utu.fi> Date: Wed Jul 29 13:12:05 2020 +0300 Update info section
This commit is contained in:
parent
23f5db8f0f
commit
4c3b85200c
3 changed files with 32 additions and 7 deletions
25
MutSiteFind.R
Normal file
25
MutSiteFind.R
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# #<---------------------------->
|
||||
# # Please include this section when distributing and/or using this code.
|
||||
# # Please read and abide by the terms of the included LICENSE
|
||||
# #
|
||||
# # Author : Deepankar Chakroborty (https://gitlab.utu.fi/deecha)
|
||||
# # Report issues: https://gitlab.utu.fi/deecha/shared_scripts/-/issues
|
||||
# # License: https://gitlab.utu.fi/deecha/shared_scripts/-/blob/master/LICENSE
|
||||
# #
|
||||
# # PURPOSE:
|
||||
# # For a given vector of amino acid changes like A123T, V256F, E746_A750del
|
||||
# # this function returns c(123, 256, 746) as amino acid positions of
|
||||
# # the mutated residue.
|
||||
# # In case of indels, it doesn't return the range!! (returns only the start position)
|
||||
# #
|
||||
# #<---------------------------->
|
||||
|
||||
dependencies <- c("stringi")
|
||||
missing_packages <- dependencies[!(dependencies %in% installed.packages()[, "Package"])]
|
||||
if(length(missing_packages)) install.packages(missing_packages)
|
||||
|
||||
MutSiteFind <- function(MutationColumn){
|
||||
return(unlist(x = stringi::stri_extract_first_regex(str = MutationColumn,pattern = "[[:digit:]]+"), use.names = F))
|
||||
}
|
||||
|
||||
|
||||
BIN
asset/RefSeqSelect_Gene_Transcript.RDS
Normal file
BIN
asset/RefSeqSelect_Gene_Transcript.RDS
Normal file
Binary file not shown.
|
|
@ -1,6 +1,6 @@
|
|||
# #<---------------------------->
|
||||
# # Please include this when distributing and/or using this code.
|
||||
# # I hope you will read and respect the terms of the included LICENSE
|
||||
# # Please include this section when distributing and/or using this code.
|
||||
# # Please read and abide by the terms of the included LICENSE
|
||||
# #
|
||||
# # Author : Deepankar Chakroborty (https://gitlab.utu.fi/deecha)
|
||||
# # Report issues: https://gitlab.utu.fi/deecha/shared_scripts/-/issues
|
||||
|
|
@ -29,12 +29,12 @@
|
|||
|
||||
# <--------------->
|
||||
|
||||
# Installing missing dependencies
|
||||
dependencies <- c("stringi", "progress")
|
||||
missing_packages <- dependencies[!(dependencies %in% installed.packages()[, "Package"])]
|
||||
if(length(missing_packages)) install.packages(missing_packages)
|
||||
|
||||
unparalog <- function(DATA, paralog_separator = ";", annotation_separator = ",", GeneColName , AnnotationColName ){
|
||||
# Installing missing dependencies
|
||||
dependencies <- c("stringi", "progress")
|
||||
missing_packages <- dependencies[!(dependencies %in% installed.packages()[, "Package"])]
|
||||
if(length(missing_packages)) install.packages(missing_packages)
|
||||
|
||||
# Sanity checks
|
||||
check_paralog_sep <- !any(stringi::stri_detect_fixed(str = DATA$Gene.refGene,pattern = paralog_separator))
|
||||
check_annotation_sep <- !any(stringi::stri_detect_fixed(str = DATA$AAChange.refGene, pattern = annotation_separator))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue