Comments (5)
CIDR utilises the package Rcpp, which automatically generates C & C++ code based on the Rcpp code (slightly modified C++ code) that we write.
This is the case when Rcpp generates _cpp_dist from our cpp_dist code.
For more information, you could look into the Rcpp documentation.
from cidr.
Thank you very much. But what's the your cpp_dist and cpp_dist_weighted code? I know the function eigen_centre and getEigenSpace have been defined explictly in the scr directory. But I still could not understand why the funtion cpp_dist and cpp_dist_weighted can be called directly in your scDissim function. Can you give me some notations?
from cidr.
We can call the C++ functions (that use Rcpp libraries) cpp_dist & cpp_dist_weighted directly from the R function scDissim because we are using the R package Rcpp. This is the beauty of using Rcpp - it abstracts the need for us to know how this process works.
You may notice in the source code located in src/scPCA.cpp, which contains the functions cpp_dist & cpp_dist_weighted, there is a line in the code directly before each function:
// [[Rcpp::export]]
This is part of the required Rcpp procedure to allow the C++ function to become available in the R code.
from cidr.
Thank you very much. I guess I see now. It is very interesting and useful, which is a great work. By the way, I have another question. At the end of your code, thre is some lines to compute the optimal number of clusters, But I don't fully understand why you calculate like that.
from cidr.
The typical shape for the CH index may have one peak that is clearly defined - see example(cidr) CH plot for one such example. In this case it may be reasonable to select the peak, which may correspond to the @Best.nc. However, we have found with a number of data sets, where we may know the real number of clusters, that this single peak shape does not hold. In some of these cases, the CH plot is monotinically decreasing, and @Best.nc is a lower number of clusters than we know to be true. Hence we empirically determined the displayed code via experimentation with a number of data sets, which is a form of the scree method (see CIDR paper for reference). The idea of the code is to find an "elbow" in the CH plot where the gradient may change significantly from the previous part of the plot. The user is encouraged to examine the CH plot, and the default number of clusters suggested by CIDR. If not happy with what CIDR produces, the user is able to override the value.
from cidr.
Related Issues (13)
- CIDR on Bioconductor? HOT 1
- CIDR imputed data HOT 9
- Error in nls.lm(par = start, fn = FCT, jac = jac, control = control, lower = lower, : evaluation of fn function returns non-sensible value! HOT 3
- How to set.seed?
- Error in hclust(md, method = "ward.D2") : Invalid clustering method "
- Error in if ((3 * a[b + c]) < a[b]) { : argument is of length zero HOT 2
- calc_npc() returns 0 HOT 1
- Input as batch effect corrected expression matrix HOT 2
- trying CIDR on ChIP-seq style vectors HOT 1
- Error running CIDR on Windows 10 HOT 1
- Retrieving contribution of genes to axes HOT 8
- missing value? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cidr.