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

Module 'cptac' has no attribute 'INDEX' #68

Open
mavershang opened this issue Aug 5, 2024 · 3 comments
Open

Module 'cptac' has no attribute 'INDEX' #68

mavershang opened this issue Aug 5, 2024 · 3 comments

Comments

@mavershang
Copy link

A1BG_cross = ov.multi_join({"umich proteomics": "A1BG", "bcm transcriptomics": "A1BG"})

Trace
AttributeError Traceback (most recent call last)
Cell In[17], line 1
----> 1 A1BG_cross = ov.multi_join({"umich proteomics": "A1BG", "bcm transcriptomics": "A1BG"})

File c:\Users\shang\Documents\cptac\venv\Lib\site-packages\cptac\cancers\cancer.py:525, in Cancer.multi_join(self, join_dict, mutations_filter, flatten, levels_to_drop, how, tissue_type)
521 raise DataFrameNotIncludedError(
522 f"{source} {datatype} is not a valid dataframe in the {self.get_cancer_type()} dataset.")
524 # Get the relevant columns
--> 525 columns = self._get_columns(datatype, source, data_key, tissue_type, mutations_filter)
527 # Set flag that mutations data in join_dict
528 if datatype == "somatic_mutation":

File c:\Users\shang\Documents\cptac\venv\Lib\site-packages\cptac\cancers\cancer.py:467, in Cancer._get_columns(self, datatype, source, data_key, tissue_type, mutations_filter)
465 columns = self._get_omics_cols(datatype, source, found_genes or None, tissue_type=tissue_type)
466 else:
--> 467 columns = self._get_omics_cols(datatype, source, data_key or None, tissue_type=tissue_type)
468 # If key belongs to metadata
469 elif datatype in self._valid_metadata_dfs:

File c:\Users\shang\Documents\cptac\venv\Lib\site-packages\cptac\cancers\cancer.py:778, in Cancer._get_omics_cols(self, omics_df_name, source, genes, tissue_type)
775 self._check_df_valid(omics_df_name, source, "omics")
777 # Get our omics df, using get_dataframe to catch invalid requests
--> 778 omics_df = self.get_dataframe(omics_df_name, source, tissue_type).copy()
780 # Process genes parameter
...
--> 126 if local_hash != cptac.INDEX.loc[cptac.INDEX['filename']==prefixed_file, 'checksum'].item():
127 warn(FailedChecksumWarning("Local file and online file have different checksums; redownloading data"))
128 os.remove(file_path)

AttributeError: module 'cptac' has no attribute 'INDEX'

@bm600
Copy link
Collaborator

bm600 commented Aug 27, 2024

Hey sorry for the delay. I've run the same code on my machine and on google colab and it seems to work as intended. Do you have any more details that could be helpful? Are you sure you're on the latest version? This is the code that I've run that works on my machine:

import cptac

ov = cptac.Ov()
A1BG_cross = ov.multi_join({"umich proteomics": "A1BG", "bcm transcriptomics": "A1BG"})
A1BG_cross.head()

Let me know if there's anything I can do to help! Thanks!

@sooheon
Copy link

sooheon commented Nov 6, 2024

I am getting the same error. cptac.version() is 1.5.14, python is 3.12.4

@sooheon
Copy link

sooheon commented Nov 6, 2024

Seems like a python issue -- rerunning with python 3.10 avoids this error

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

3 participants