SCENICprotocol icon indicating copy to clipboard operation
SCENICprotocol copied to clipboard

Error: buffer source array is read-only

Open weishwu opened this issue 4 years ago • 2 comments

Hi,

I'm trying to run pyscenic in jupyter-lab but got an error. I created a docker container that pulled from aertslab/pyscenic:0.10.4 (also tried 'latest') and also installed jupyter-lab within it.

I was following this tutorial: https://github.com/aertslab/SCENICprotocol/blob/master/notebooks/PBMC10k_SCENIC-protocol-CLI.ipynb

All the modules were loaded successfully and I was able to create a anndata object to contain the raw read count matrix. However I got an error when I ran:

!pyscenic grn {f_loom_path_scenic} {f_tfs} -o adj.csv --num_workers 20

The main error seems to be: 'infer_data failed for target BOK-AS1' Retry (1/10). Failure caused by ValueError("Regression for target gene BOK-AS1 failed. Cause ValueError('buffer source array is read-only')."). The same kind of error repeated for many other genes. The output file "adj.csv" is empty.

Any help? Thanks.

weishwu avatar Feb 10 '21 05:02 weishwu

Hi @weishwu ,

This is a strange error. I know you say that you've used the docker image (where all of the packages are locked), but if you've installed something else it could have changed some of the other packages. So, could you check the version of pandas that you're using? For pySCENIC 0.10.4 it should be pandas<1.0.0, so 0.25.3 should work.

There is also another report of this same error here: aertslab/pySCENIC/issues/238 where the problem was apparently resolved by additional filtering on the expression matrix. Not sure if this will help in your case but it's worth a try.

cflerin avatar Feb 10 '21 09:02 cflerin

Thanks. I ran the filtering as shown in the SCENIC vignette (R version) to filter the genes and used the kept genes for pyscenic:

genesKept <- geneFiltering(exprMat, scenicOptions=scenicOptions,
                           minCountsPerGene=3*.01*ncol(exprMat),
                           minSamples=ncol(exprMat)*.01)

Should I add more filtering?

My pandas version is 0.25.3.

weishwu avatar Feb 10 '21 15:02 weishwu