atarashansky / sctransformpy Goto Github PK
View Code? Open in Web Editor NEWA python port of the R package SCTransform:
A python port of the R package SCTransform:
Hi,
I noticed that SCTransform fails on AnnData objects that have their X stored as np.ndarray instead of a scipy matrix:
File "/data1/fteufel/miniconda_installation/envs/qsc_env/lib/python3.9/site-packages/SCTransform.py", line 104, in SCTransform
genes_cell_count = X.sum(0).A.flatten()
AttributeError: 'numpy.ndarray' object has no attribute 'A
Workaround:
adata.X = sparse.csr_matrix(adata.X)
SCTransform(adata, inplace=True)
Hi, thanks for the package. I am trying to run SCTransform on the pbmc3k dataset but it takes much time. In your example notebooks, it says that it should take about 3 min but I am running this since 25 minutes and no I have no output. I put flags in the code to see what takes time and it seems that it is the line
pool.map(_parallel_wrapper, range(umi_bin.shape[1]), chunksize=pc_chunksize)
Note that it should do this 4 times (as it is in a for loop of size 4) and in 20 minutes I have not been able to run this once.
Here is my code to reproduce:
from SCTransform import SCTransform
import scanpy as sc
import matplotlib.pyplot as plt
import numpy as np
import time
adata = sc.datasets.pbmc3k()
adata_sct = SCTransform(
adata,
min_cells=5,
gmean_eps=1,
n_genes=2000,
n_cells=None, # use all cells
bin_size=500,
bw_adjust=3,
inplace=False,
)
I have a very good CPU (64 Gb).
Any idea on what is happening ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.