Closed ryanhchung closed 9 months ago
Hello
By applying this function to the entire dataset, the plotting function tries to plot the trend of every single gene which appears to be overloading the system. We recommend subsetting the genes to make this more amenable. Some options: (1) Highly variable genes, (2) List of all transcription factors, (3) Receptor or ligand genes.
Hello @ryanhchung,
Thanks for bringing this up. Applying the plotting function to the entire dataset can indeed be computationally intensive. @ManuSetty has already given valuable suggestions for subsetting genes—like focusing on highly variable genes, transcription factors, or receptor/ligand genes.
Random Gene Selection: A representative random set of 100 genes can be displayed using:
palantir.plot.plot_gene_trends(ad, ad.var.sample(100).index)
Cluster-Based Overview: You can get a comprehensive view by clustering gene trends and then plotting them:
palantir.presults.cluster_gene_trends(ad, branch_name)
palantir.plot.plot_gene_trend_clusters(ad, branch_name)
To find available branches, use:
palantir.plot.plot_branch_selection(ad)
Batch Plotting for All Genes: To plot all genes in batches:
import numpy as np
for genes in np.array_split(ad.var_names, ad.n_vars // 10):
palantir.plot.plot_gene_trends(ad, genes)
plt.show()
Note: This will result in a large number of plots.
Please let us know if ay of our suggestions resolved your issue.
Closing due to inactivity.
Hi Team,
From my understanding, it is possible not to specify genes in the plot_gene_trends function. In the tutorial, you guys already used known genes for your data but I want to discover unbiased gene trends so I didn't use it, and I got this error:
Do you have any idea how to solve this? If I misunderstood, please don't hesitate to tell me. As I want to know unbiased terminal states and gene trends, I didn't specify anything except starting cell to proceed.
Thank you!