Skip to content

Commit

Permalink
update charge
Browse files Browse the repository at this point in the history
  • Loading branch information
dosorio committed Nov 10, 2014
1 parent 4bb7672 commit a68f1e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/charge.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}

0 comments on commit a68f1e2

Please sign in to comment.