Skip to content

Commit

Permalink
Also allow copy from View of AnnData
Browse files Browse the repository at this point in the history
  • Loading branch information
bli25 committed Oct 8, 2021
1 parent b6fde33 commit c9374e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pegasusio/unimodal_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ def from_anndata(self, data: anndata.AnnData, genome: str = None, modality: str
""" Initialize from an anndata object, try best not to copy
If genome/modality is not None, set 'genome'/'modality' as genome/modality
"""
if data.is_view:
data = data.copy()

self.barcode_metadata = data.obs
self.barcode_metadata.index.name = "barcodekey"

Expand Down

0 comments on commit c9374e8

Please sign in to comment.