From a68f1e2d0bee63e2c0443757969299d2caa5c3b0 Mon Sep 17 00:00:00 2001 From: Daniel Camilo Osorio Date: Mon, 10 Nov 2014 09:21:14 -0500 Subject: [PATCH] update charge --- R/charge.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/charge.R b/R/charge.R index b9a5d96..0081b90 100755 --- a/R/charge.R +++ b/R/charge.R @@ -4,7 +4,7 @@ # The net charge can be calculated using one of the 9 pKa scales availables Bjellqvist, EMBOSS, Murray, Sillero, Solomon, # Stryer, Lehninger, Dawson or Rodwell -charge <- function(seq,pH,pKscale){ +charge <- function(seq,pH=7,pKscale= "Lehninger"){ # # Divide the amino acid sequence and makes an absolute frequencies table aa<-table(factor(prot<-s2c(toupper(seq)),levels = LETTERS)) # Set pKscale @@ -23,6 +23,6 @@ charge <- function(seq,pH,pKscale){ ccys <- aa["C"]* (-1 /(1+10^(-1*(pH-pKs["C"])))) ctyr <- aa["Y"]* (-1 /(1+10^(-1*(pH-pKs["Y"])))) # Compute the charge and return the value rounded to 3 decimals - charge <- round(as.numeric(carg + clys + chis + nterm + casp + cglu + ctyr + ccys + cterm),3) + charge <- as.numeric(carg + clys + chis + nterm + casp + cglu + ctyr + ccys + cterm) return(charge) } \ No newline at end of file