You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks again for writing a wonderful package. I'm currently trying to implement the backed AnnData objects into a pipeline I'm building. I have a couple items of feedback to share, but I'll start with this one.
After I create backed AnnData objects via pp.import_data I'm unable to add new columns to .obs (i.e., adata.obs["barcode"] = adata.obs_names). Attempting to do so, I get the error
called `Result::unwrap()` on an `Err` value: H5Ldelete(): unable to delete link: no write intent on file note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I'm able to resolve this error by closing the AnnData object (adata.close()), and then rereading with write permissions (adata = snap.read(f"{file_name}.h5ad", "r+")). While this works, it's awkward and I have to do it again after running snap.metrics.tsse. I wonder if there's a better way to specify permissions when create backed AnnData objects. If not, perhaps an option to specify in import_data would be helpful.
Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for the quick response! The code you shared works for me as well. However, I'm able to trigger the error by putting fragment_file and the file name in lists:
import snapatac2 as snap
if __name__ == '__main__':
fragment_file = snap.datasets.pbmc500(downsample=True)
data = snap.pp.import_data(
[fragment_file],
chrom_sizes=snap.genome.hg38,
file=['test.h5ad'],
sorted_by_barcode=False,
)
data[0].obs['barcode'] = data[0].obs_names
print(data)
Hi,
Thanks again for writing a wonderful package. I'm currently trying to implement the backed AnnData objects into a pipeline I'm building. I have a couple items of feedback to share, but I'll start with this one.
After I create backed AnnData objects via
pp.import_data
I'm unable to add new columns to .obs (i.e.,adata.obs["barcode"] = adata.obs_names
). Attempting to do so, I get the errorI'm able to resolve this error by closing the AnnData object (
adata.close()
), and then rereading with write permissions (adata = snap.read(f"{file_name}.h5ad", "r+")
). While this works, it's awkward and I have to do it again after runningsnap.metrics.tsse
. I wonder if there's a better way to specify permissions when create backed AnnData objects. If not, perhaps an option to specify inimport_data
would be helpful.Thanks!
The text was updated successfully, but these errors were encountered: