Description Usage Arguments Value Examples

This function will plot a graph with normalized weights of all genes so user can select the appropriate number of genes to keep.

1 |

`data` |
Gene expression matrix, with rows represent samples and columns represent genes. |

`sparse` |
Boolen variable indicating whether data is a sparse matrix. The input must be a non negative sparse matrix. |

`ncores` |
Number of processor cores to use. |

`seed` |
Seed for reproducibility. |

A plot with normalized weights of all genes.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
library(scDHA)
#Load example data (Goolam dataset)
data('Goolam'); data <- t(Goolam$data); label <- as.character(Goolam$label)
#Log transform the data
data <- log2(data + 1)
if(torch::torch_is_installed()) #scDHA need libtorch installed
{
#Generate weight variances for each genes
weight_variance <- scDHA.w(data, ncores = 2, seed = 1)
#Plot weight variances for top 5,000 genes
#plot(weight_variance, xlab = "Genes", ylab = "Normalized Weight Variance", xlim=c(1, 5000))
#Plot the change of weight variances for top 5,000 genes
#weight_variance_change <- weight_variance[-length(weight_variance)] - weight_variance[-1]
#plot(weight_variance_change, xlab = "Genes", ylab = "Weight Variance Change", xlim=c(1, 5000))
}
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.