Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cytofAsinh() function not available #71

Open
agataraczynska opened this issue Jul 7, 2019 · 2 comments
Open

cytofAsinh() function not available #71

agataraczynska opened this issue Jul 7, 2019 · 2 comments

Comments

@agataraczynska
Copy link

Hello,

I would like to use cytofAsinh() function to transform my data, but I do not have this function in my cytofkit package. I had problems installing cytofkit package. In the end I somehow installed ‘cytofkit’ version 1.12.0 manually by downloading zip from Bioconductor and placing it in appropriate directory on my computer.

Is the function cytofAsinh() only available through the bulky cytofkit() function?

@SamGG
Copy link

SamGG commented Jul 8, 2019

Hi,
If you simply need the cytofAsinh function (which should be applied to CyTOF data) you could simply copy the code starting at

#' Noise reduced arsinh transformation
#'
#' Inverse hyperbolic sine transformation (arsinh) with a cofactor of 5, reduce noise from negative values
#' Adopted from Plos Comp reviewer
#'
#' @param value A vector of numeric values.
#' @param cofactor Cofactor for asinh transformation, default 5 for mass cytometry data.
#' @noRd
#' @return transformed value
cytofAsinh <- function(value, cofactor = 5) {
value <- value-1
loID <- which(value < 0)
if(length(loID) > 0)
value[loID] <- rnorm(length(loID), mean = 0, sd = 0.01)
value <- value / cofactor
value <- asinh(value) # value <- log(value + sqrt(value^2 + 1))
return(value)
}

Best.

@agataraczynska
Copy link
Author

Thank you very much! It worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants