diff --git a/MutSiteFind.R b/MutSiteFind.R new file mode 100644 index 0000000000000000000000000000000000000000..1174e3dda34f9e5530d1340a74bc8f7b7f4b6d44 --- /dev/null +++ b/MutSiteFind.R @@ -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)) +} + + diff --git a/asset/RefSeqSelect_Gene_Transcript.RDS b/asset/RefSeqSelect_Gene_Transcript.RDS new file mode 100644 index 0000000000000000000000000000000000000000..8149ce039eaa3848159427dd3a40075c3244a06d Binary files /dev/null and b/asset/RefSeqSelect_Gene_Transcript.RDS differ diff --git a/unparalogMutations.R b/unparalogMutations.R index f34e540315cd3fafa64fd44680415b648dc17210..91683579cbc3bf50a6f8d24e23d2ed86bf678e27 100644 --- a/unparalogMutations.R +++ b/unparalogMutations.R @@ -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))