Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when load data by readVisium #126

Open
hannshu opened this issue Jun 27, 2024 · 3 comments
Open

Error when load data by readVisium #126

hannshu opened this issue Jun 27, 2024 · 3 comments

Comments

@hannshu
Copy link

hannshu commented Jun 27, 2024

Hi,

Thank you for your excellent work on BayesSpace. I am currently attempting to implement BayesSpace with a 10x Visium data link, I've downloaded the Feature / barcode matrix (filtered) file and the Spatial imaging data file, the file are organized like this

.
├── filtered_feature_bc_matrix
│   ├── barcodes.tsv.gz
│   ├── features.tsv.gz
│   └── matrix.mtx.gz
├── filtered_feature_bc_matrix.h5
├── Parent_Visium_Human_BreastCancer_filtered_feature_bc_matrix.tar.gz
└── spatial
    ├── aligned_fiducials.jpg
    ├── detected_tissue_image.jpg
    ├── scalefactors_json.json
    ├── tissue_hires_image.png
    ├── tissue_lowres_image.png
    └── tissue_positions_list.csv

Then I try to load the data by the readVisium function like this

library(BayesSpace)

hbc <- readVisium("hbc/")

It prompt error

Error in .subscript.2ary(x, , j, drop = TRUE) : subscript out of bounds
Calls: readVisium -> [ -> [ -> .subscript.2ary
Execution halted

I find a function read10Xh5 in your source code and try to use this function to load data. This function can successfully load the data but it prompts error in the spatialCluster function

Error: subscript contains invalid names
Execution halted

I'm a novice in R, my following script is like this, which is modified from your tutorial on the DLPFC dataset link

hbc <- read10Xh5("hbc/")
hbc <- logNormCounts(hbc)

set.seed(101)
dec <- scran::modelGeneVar(hbc)
top <- scran::getTopHVGs(dec, n = 2000)

set.seed(102)
hbc <- scater::runPCA(hbc, subset_row=top)

## Add BayesSpace metadata
hbc <- spatialPreprocess(hbc, platform="Visium", skip.PCA=TRUE)

q <- 16  # Number of clusters
d <- 20  # Number of PCs

## Run BayesSpace clustering
set.seed(104)
hbc <- spatialCluster(hbc, q=q, d=d, platform='Visium',
                        nrep=50000, gamma=3, save.chain=TRUE)

Please help me solve this problem.

@kunstner
Copy link

Same problem here. Any progress on this issue?

@g-wee
Copy link

g-wee commented Oct 30, 2024

Another novice with the same problem here. Hoping for a solution soon.

@edward130603
Copy link
Owner

Sorry for the late response. This issue should be fixed in the next bioconductor release. You can also use the current devel branch on github as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants