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

uns_key has no default` #126

Open
BioTechTimy opened this issue Aug 2, 2021 · 1 comment
Open

uns_key has no default` #126

BioTechTimy opened this issue Aug 2, 2021 · 1 comment

Comments

@BioTechTimy
Copy link

BioTechTimy commented Aug 2, 2021

To recreate using https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM3674239,

import stream
from scipy.io import mmread
import pandas as pd

name = 'GSM3674239_b1'
x = mmread('data/' + name + '.matrix.mtx')
gene_names = pd.read_csv('data/' + name +  '.genes.tsv', sep = '\t', header=None)
barcodes = pd.read_csv('data/' + name + '.barcodes.tsv', sep = '\t', header=None)
df = pd.DataFrame.sparse.from_spmatrix(x, index = gene_names.iloc[:, 1], 
                                                                       columns = name + '-bone-' + barcodes.iloc[:, 0])
df.to_pickle("df.pkl")
df_stream = stream.read('df.pkl')

Traceback

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-24a97f60ba4b> in <module>
----> 1 df_stream = stream.read('merged_df.pkl')
      2 #stream.cal_qc(df_stream,assay='rna')
      3 #stream.plot_qc(df_stream,jitter=0.3)

~/miniconda/envs/venv_stream/lib/python3.7/site-packages/stream/core.py in read(file_name, file_path, file_format, delimiter, workdir, file_sample, file_feature, **kwargs)
    185         f.close()
    186 
--> 187     if('workdir' not in adata.uns_keys()):
    188         set_workdir(adata,workdir=workdir)
    189     else:

~/miniconda/envs/venv_stream/lib/python3.7/site-packages/pandas/core/generic.py in __getattr__(self, name)
   5476         ):
   5477             return self[name]
-> 5478         return object.__getattribute__(self, name)
   5479 
   5480     def __setattr__(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute 'uns_keys'

Thank you
Timothy Daley

@BioTechTimy
Copy link
Author

BioTechTimy commented Aug 5, 2021

Any update on this? It seems like stream can't read in standard pandas data frames. Is there documentation that I can read for what the expected input should be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant