Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auc bug #520

Open
AnjaliS1 opened this issue Dec 10, 2023 · 1 comment
Open

auc bug #520

AnjaliS1 opened this issue Dec 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@AnjaliS1
Copy link

Hi, I have used the CLI version of pyscenic. Everything appears to have run successfully but then I get this error with this code:

import json
import zlib
import base64

collect SCENIC AUCell output

lf = lp.connect( f_pyscenic_output, mode='r+', validate=False )
auc_mtx = pd.DataFrame( lf.ca.RegulonsAUC, index=lf.ca.CellID)
lf.close()


KeyError Traceback (most recent call last)
~/.local/lib/python3.8/site-packages/loompy/attribute_manager.py in getattr(self, name)
114 try:
--> 115 vals = self.dict["storage"][name]
116 if vals is None:

KeyError: 'RegulonsAUC'

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
/tmp/ipykernel_20211/3487089691.py in
5 # collect SCENIC AUCell output
6 lf = lp.connect( f_pyscenic_output, mode='r+', validate=False )
----> 7 auc_mtx = pd.DataFrame( lf.ca.RegulonsAUC, index=lf.ca.CellID)
8 lf.close()

~/.local/lib/python3.8/site-packages/loompy/attribute_manager.py in getattr(self, name)
121 return vals
122 except KeyError:
--> 123 raise AttributeError(f"'{type(self)}' object has no attribute '{name}'")
124
125 def setitem(self, name: str, val: np.ndarray) -> None:

AttributeError: '<class 'loompy.attribute_manager.AttributeManager'>' object has no attribute 'RegulonsAUC'

Is this perhaps due to my file structure?:
image

Code run in CLI in ubuntu on HPC.

@AnjaliS1 AnjaliS1 added the bug Something isn't working label Dec 10, 2023
@Tripfantasy
Copy link

This looks like the loom being produced by your aucell step isn't integrating the AUCell results correctly. I had something similar happen to me. If the goal is to integrate your pySCENIC data with Scanpy (Like mine was) I recommend looking at this Example provided by the authors.

They use add_scenic_metadata(adata, auc_mtx, regulons) to integrate them for downstream analysis. Of course, this workaround involves taking the GRN and CTX outputs and throwing them into something like jupyter notebook, and using them to do the aucell step. (Which makes it not fully CLI)

This method worked for me. Essentially adding the aucell matrix as a layer to an adata object, similar to how umap coordinates are stored. You can likely construct a loom file from this adata object after the fact. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants