feiyoung / PRECAST

an efficient data integration method for multiple spatial transcriptomics data with non- cluster-relevant effects such as the complex batch effects.
GNU General Public License v3.0
10 stars 3 forks source link

Increasing gene.number in CreatePRECASTObject #3

Closed anvaly closed 1 year ago

anvaly commented 1 year ago

Hello! I am running PRECAST on a diverse cohort of Seurat objects. I wanted to experiment with the gene.number parameter when creating the PRECAST object.

A few of my objects trigger an issues as follows:

Screenshot (95)

In this example, I am going for gene.number = 5000. The object that triggers the error has more than 5000 genes in all assay/slots; however, clearly PRECAST evaluates a total number of genes as 4999, so the error is triggered.

Could you point me towards information about how this total number of genes is evaluated? How do you propose to work around/with this?

feiyoung commented 1 year ago

Hi Anavaly,

Thank you for your feedback. I have fixed this bug in the new uploaded package in this github repository.

As for this problem (Could you point me towards information about how this total number of genes is evaluated?): When using the CreatePRECASTObject() function in SPARK-X to select spatially variable genes, we aim to speed up computation by first selecting the top 5000 highly variable genes and then inputting them into the SPARK-X function to select spatially variable features. Additionally, SPARK-X automatically filters out genes with low read counts from the 5000 HVGs, resulting in only 4999 genes remaining for SPARK-X to run. To avoid possible problem, I have revised my approach to using all genes as input for SPARK-X, albeit at the cost of slightly increased time.

Moreover, you could set the argument selectGenesMethod='HVGs' to select 5000 highly variable features ranther than spatially variable features.

feiyoung commented 1 year ago

Hi Anavaly, I have fixed this bug; see the above comment.