kaizhang / SnapATAC2

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

write anndataset #258

Closed TingTingShao closed 8 months ago

TingTingShao commented 8 months ago

Hi,

I ran into errors when trying to write the anndataset

data=snap.AnnDataSet( adatas=filtered_adatas, filename=output.dataset )

data.write(output.final_dataset, backend='hdf5')

Could you please help me with this?

BTW, would there be online seminar for snapATAC2 in the near future?

Thanks, tingting

kaizhang commented 8 months ago

There is no "write" function for AnnDataSet. Any operations on AnnDataSet is automatically saved on your hard drive. When you are done with it, just close it using data.close(). Next time when you open the AnnDataSet using snap.read_dataset everything will be up-to-data. Read more here: https://kzhang.org/epigenomics-analysis/anndata.html

Yes, we are considering the possibility of hosting an online/in-person SnapATAC2 workshop in the future.

TingTingShao commented 8 months ago

Thanks for your reply! I understand.

Just to confirm, AnnDataSet adata.close, single adata, need to use function write?

kaizhang commented 8 months ago

hdf5 backed AnnData doesn't need to be saved. The in-memory ones need to. You can check this using adata.isbacked

TingTingShao commented 8 months ago

I am still playing around with the I/O.

Could I please ask how the information on the workshop will be released?

Thanks! tingting

TingTingShao commented 8 months ago

I think I understand what is happening with the anndataset. Feel like the anndataset is behaving more like the archrobject.