Skip to content

Commit

Permalink
change Align name package
Browse files Browse the repository at this point in the history
  • Loading branch information
lalo-caballero committed Jan 26, 2024
1 parent 8f2aff3 commit 1674684
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/align_pow-GCIMSDataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ methods::setMethod(
p = 10,
max_it = 1000){
rics <- object$getRIC()
idx_y <- Align::select_reference(rics)
idx_y <- pow::select_reference(rics)
X <- as.matrix(rics[-idx_y,])
y <- as.matrix(rics[idx_y,])
n_samples <- nrow(X)
Expand All @@ -26,11 +26,11 @@ methods::setMethod(
iv <- seq(2, m - 1, by = p)
v[iv] <- 0
W <- Matrix::Diagonal(x = v)
val<-Align::compute_val_error(X,y,W,iv,lambdas)
opar <- Align::optimize_params(n_samples, lambdas, val$ti_ix, val$e_ix)
val<-pow::compute_val_error(X,y,W,iv,lambdas)
opar <- pow::optimize_params(n_samples, lambdas, val$ti_ix, val$e_ix)
best_lambdas2 <- opar$best_params

w<-mapply(Align::pow,x=as.list(data.frame(t(X))), lambda2=as.list(best_lambdas2),MoreArgs = list(y=y,max_it = max_it))
w<-mapply(pow::pow,x=as.list(data.frame(t(X))), lambda2=as.list(best_lambdas2),MoreArgs = list(y=y,max_it = max_it))
w<-as.list((as.data.frame(w)))
w<-append(w,list(1:m),idx_y-1)
names(w)<-object$sampleNames
Expand Down
2 changes: 1 addition & 1 deletion R/align_pow-GCIMSSample.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ methods::setMethod(
"GCIMSSample",
function(object,w){
int <- GCIMS::intensity(object)
inter <- t(apply(int, 1, Align::interpolation, w = w, return = FALSE))
inter <- t(apply(int, 1, pow::interpolation, w = w, return = FALSE))
sel <- !is.na(inter[1,])
object@retention_time <- object@retention_time[sel]
object@data <- inter[,sel]
Expand Down

0 comments on commit 1674684

Please sign in to comment.