kaizhang / SnapATAC2

Single-cell epigenomics analysis tools
https://kzhang.org/SnapATAC2/
197 stars 20 forks source link

Unexpected behavior in AnnDataSet subset #310

Open mtvector opened 3 weeks ago

mtvector commented 3 weeks ago

Hi there,

When I run code like this:

data = snap.read_dataset("concatenated.h5ads",mode='r+')
data.obs['doubcall']=list(np.random.choice([True,False],data.shape[0]))
data.subset(obs_indices=pd.Series(data.obs_names)[~data.obs['doubcall']],out="concatenated_nodoublet")

It creates a directory concatenated_nodoublet, but this contains no files, while all of the h5ads within the AnnDataSet are copied in the locations where they are pointed to, with the suffix .h5ad.h5ad. I'm also wondering if this function is supposed write a new AnnDataSet file so that the datasets in this new directory can be easily accessed? Or does it inplace modify the original h5ads file?

Thanks! Matthew