Skip to content

Commit

Permalink
update paper DOI number
Browse files Browse the repository at this point in the history
  • Loading branch information
feiyoung committed Feb 5, 2023
1 parent 246da38 commit c0af87a
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 38 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: PRECAST
Type: Package
Title: Embedding and Clustering with Alignment for Spatial Datasets
Version: 1.3
Date: 2022-10-18
Version: 1.4
Date: 2023-02-05
Authors@R:
c(person(given = "Wei",
family = "Liu",
Expand All @@ -16,7 +16,7 @@ Authors@R:
role = "aut"))
Author: Wei Liu [aut, cre], Yi Yang [aut], Jin Liu [aut]
Maintainer: Wei Liu <[email protected]>
Description: An efficient data integration method is provided for multiple spatial transcriptomics data with non-cluster-relevant effects such as the complex batch effects. It unifies spatial factor analysis simultaneously with spatial clustering and embedding alignment, requiring only partially shared cell/domain clusters across datasets. More details can be referred to Wei Liu, et al. (2022) <doi:10.1101/2022.06.26.497672>.
Description: An efficient data integration method is provided for multiple spatial transcriptomics data with non-cluster-relevant effects such as the complex batch effects. It unifies spatial factor analysis simultaneously with spatial clustering and embedding alignment, requiring only partially shared cell/domain clusters across datasets. More details can be referred to Wei Liu, et al. (2023) <doi:10.1038/s41467-023-35947-w>.
License: GPL-3
Depends:
parallel,
Expand Down
6 changes: 6 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.onAttach <- function(libname, pkgname) {
# output the specific message when package is loaded!
RFver <- read.dcf(file=system.file("DESCRIPTION", package=pkgname),
fields=c("Description"))
packageStartupMessage(paste(pkgname,': ', RFver))
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PRECAST: a probabilistic embedding and clustering with alignment for spatial tra

PRECAST is a package for integrating and analyzing multiple spatially resolved transcriptomics (SRT) datasets, developed by the Jin Liu's lab. It unifies spatial factor analysis simultaneously with spatial clustering and embedding alignment, requiring only partially shared cell/domain clusters across datasets.

Check out our [bioRxiv paper](https://doi.org/10.1101/2022.06.26.497672) and our [Package Website](https://feiyoung.github.io/PRECAST/index.html) for a more complete description of the methods and analyses.
Check out our [Nature Comunications paper](https://www.nature.com/articles/s41467-023-35947-w) and our [Package Website](https://feiyoung.github.io/PRECAST/index.html) for a more complete description of the methods and analyses.

PRECAST can be used to compare and contrast experimental datasets in a variety of contexts, for instance:

Expand Down
2 changes: 1 addition & 1 deletion man/ICM.EM_structure.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
\item{loglik}{pseudo observed log-likelihood.}
}
\references{
\href{https://www.biorxiv.org/content/10.1101/2021.12.25.474153v4}{Wei Liu, Xu Liao, Yi Yang, Huazhen Lin, Joe Yeong, Xiang Zhou, Xingjie Shi and Jin Liu. (2022) Joint dimension reduction and clustering analysis for single-cell RNA-seq and spatial transcriptomics data}
\href{https://www.nature.com/articles/s41467-023-35947-w}{Wei Liu, Liao, X., Luo, Z. et al, Jin Liu* (2023). Probabilistic embedding, clustering, and alignment for integrating spatial transcriptomics data with PRECAST. Nature Communications, 14, 296}
}
\author{
Wei Liu
Expand Down
4 changes: 4 additions & 0 deletions man/PRECAST.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
Return a revised PRECASTObj object.
}

\references{
\href{https://www.nature.com/articles/s41467-023-35947-w}{Wei Liu, Liao, X., Luo, Z. et al, Jin Liu* (2023). Probabilistic embedding, clustering, and alignment for integrating spatial transcriptomics data with PRECAST. Nature Communications, 14, 296}
}

\author{
Wei Liu
}
Expand Down
2 changes: 1 addition & 1 deletion man/idrsc.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
\item{loglik}{pseudo observed log-likelihood.}
}
\references{
\href{https://www.biorxiv.org/content/10.1101/2021.12.25.474153v4}{Wei Liu, Xu Liao, Yi Yang, Huazhen Lin, Joe Yeong, Xiang Zhou, Xingjie Shi and Jin Liu. (2022) Joint dimension reduction and clustering analysis for single-cell RNA-seq and spatial transcriptomics data}
\href{https://www.nature.com/articles/s41467-023-35947-w}{Wei Liu, Liao, X., Luo, Z. et al, Jin Liu* (2023). Probabilistic embedding, clustering, and alignment for integrating spatial transcriptomics data with PRECAST. Nature Communications, 14, 296}
}
\author{
Wei Liu
Expand Down
4 changes: 4 additions & 0 deletions man/selectIntFeatures.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
Return a string vector, the selected gene list for integration in PRECAST.
}

\references{
\href{https://www.nature.com/articles/s41467-023-35947-w}{Wei Liu, Liao, X., Luo, Z. et al, Jin Liu* (2023). Probabilistic embedding, clustering, and alignment for integrating spatial transcriptomics data with PRECAST. Nature Communications, 14, 296}
}

\author{
Wei Liu
}
Expand Down
Binary file modified src/PRECAST.dll
Binary file not shown.
107 changes: 75 additions & 32 deletions src/idrsc2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,45 +798,88 @@ Rcpp:: List idrsc2Cpp(const Rcpp::List& Xlist, const Rcpp::List& Adjlist, const
}



//set parallel structure object
par_iDRSC2 parObj(Xf, Adjf, Adjf_car, yf, Mu0, Sigma0, W_int, Lam0, Psi0,
if(lengthK==1){
field<ivec> yf_int(r_max);
for (int r = 0; r < r_max; r++){
ivec tmp_yf = yf(r).col(0);
yf_int(r) = tmp_yf;
}
MATTYPE Mu_int = Mu0(0);
MATTYPE Lam_int = Lam0;
CUBETYPE Psi_int = Psi0;
VECTYPE alpha_int = alpha0(0);
CUBETYPE Sigma_int = Sigma0(0);
Objidrsc2 output = idrsc2(Xf, Adjf, Adjf_car, yf_int,
Mu_int, Sigma_int, W_int,
Lam_int, Psi_int,
alpha_int, beta0, beta_grid,
maxIter_ICM, maxIter, epsLogLik, verbose,
homo, homoClust, Sigma_diag, mix_prop_heter, Sp2);

List Objidrsc2Rcpp(lengthK);

// output return value
Objidrsc2Rcpp[0] = List::create(
Rcpp::Named("cluster") = output.yf,
Rcpp::Named("hZ") = output.Ezz,
Rcpp::Named("hV") = output.Vf,
Rcpp::Named("Rf") = output.Rf,
Rcpp::Named("beta") = output.beta0,
Rcpp::Named("Mu") = output.Mu0,
Rcpp::Named("Sigma") = output.Sigma0,
Rcpp::Named("Psi") = output.Psi0,
Rcpp::Named("W") = output.W0,
Rcpp::Named("Lam") = output.Lam0,
Rcpp::Named("loglik") = output.loglik,
Rcpp::Named("loglik_seq") = output.loglik_seq);


return(Objidrsc2Rcpp);


}else{
//set parallel structure object
par_iDRSC2 parObj(Xf, Adjf, Adjf_car, yf, Mu0, Sigma0, W_int, Lam0, Psi0,
alpha0, beta0, beta_grid, maxIter_ICM, maxIter, epsLogLik, verbose,
homo, homoClust, Sigma_diag, mix_prop_heter, Sp2, maxK, minK);

const int n_thread = coreNum;
std::vector<std::thread> threads(n_thread);

for (int i_thread = 0; i_thread < n_thread; i_thread++){
threads[i_thread] = std::thread(&par_iDRSC2::update_by_thread_idrsc2, &parObj, i_thread);
}
for (int i = 0; i < n_thread; i++){
threads[i].join();
}


List Objidrsc2Rcpp(maxK-minK+1);


for (int k = 0; k < maxK - minK + 1; k++){
const int n_thread = coreNum;
std::vector<std::thread> threads(n_thread);
for (int i_thread = 0; i_thread < n_thread; i_thread++){
threads[i_thread] = std::thread(&par_iDRSC2::update_by_thread_idrsc2, &parObj, i_thread);
}
for (int i = 0; i < n_thread; i++){
threads[i].join();
}
List Objidrsc2Rcpp(maxK-minK+1);
for (int k = 0; k < maxK - minK + 1; k++){
// output return value
Objidrsc2Rcpp[k] = List::create(
Rcpp::Named("cluster") = parObj.output[k].yf,
Rcpp::Named("hZ") = parObj.output[k].Ezz,
Rcpp::Named("hV") = parObj.output[k].Vf,
Rcpp::Named("Rf") = parObj.output[k].Rf,
Rcpp::Named("beta") = parObj.output[k].beta0,
Rcpp::Named("Mu") = parObj.output[k].Mu0,
Rcpp::Named("Sigma") = parObj.output[k].Sigma0,
Rcpp::Named("Psi") = parObj.output[k].Psi0,
Rcpp::Named("W") = parObj.output[k].W0,
Rcpp::Named("Lam") = parObj.output[k].Lam0,
Rcpp::Named("loglik") = parObj.output[k].loglik,
Rcpp::Named("loglik_seq") = parObj.output[k].loglik_seq);
Rcpp::Named("cluster") = parObj.output[k].yf,
Rcpp::Named("hZ") = parObj.output[k].Ezz,
Rcpp::Named("hV") = parObj.output[k].Vf,
Rcpp::Named("Rf") = parObj.output[k].Rf,
Rcpp::Named("beta") = parObj.output[k].beta0,
Rcpp::Named("Mu") = parObj.output[k].Mu0,
Rcpp::Named("Sigma") = parObj.output[k].Sigma0,
Rcpp::Named("Psi") = parObj.output[k].Psi0,
Rcpp::Named("W") = parObj.output[k].W0,
Rcpp::Named("Lam") = parObj.output[k].Lam0,
Rcpp::Named("loglik") = parObj.output[k].loglik,
Rcpp::Named("loglik_seq") = parObj.output[k].loglik_seq);
}


return(Objidrsc2Rcpp);
}


return(Objidrsc2Rcpp);
}


Expand Down
Binary file modified src/idrsc2.o
Binary file not shown.

0 comments on commit c0af87a

Please sign in to comment.