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

Unable to use load_data() for class Multiomics #165

Open
piyushm27 opened this issue Oct 21, 2021 · 4 comments
Open

Unable to use load_data() for class Multiomics #165

piyushm27 opened this issue Oct 21, 2021 · 4 comments

Comments

@piyushm27
Copy link

piyushm27 commented Oct 21, 2021

  • openOmics version: 0.8.8
  • Python version: 3.9.7
  • Operating System: 20.04.1-Ubuntu

Description

What I was trying to get done?
I was trying to use the function load_data() of class Multiomics. Instead it gave the error elaborated below

What I Did

//The command that raised the error [Here, luad_data is an object of class Multiomics]:

X_multiomics, y = luad_data.load_data(omics="all", target=["pathologic_stage"])

//And it gave the below error:

~/*****************/site-packages/openomics/multiomics.py in load_data(self, omics, target, pathologic_stages, histological_subtypes, predicted_subtypes, tumor_normal, samples_barcode)
251
252 # Filter y target column labels
--> 253 y = y.filter(target)
254 y.dropna(axis=0, inplace=True)
255 matched_samples = y.index

AttributeError: 'tuple' object has no attribute 'filter'

I tried goiong through the function description for the arguments of the function given, and it seems I'm not passing absurd arguments.

I'm guessing that this error is raised becuase the y used in line 253 of multiomics.py is an tuple of an Index object (pandas.core.indexes.base.Index) and numpy.ndarray object instead of DataFrame object (pandas.core.frame.DataFrame).

@JonnyTran
Copy link
Owner

JonnyTran commented Nov 8, 2021

Hi @piyushm27 thanks for pointing this bug out. y in that function should be a DataFrame, so y = y.filter(target) shouldn't give an error and y shouldn't be a tuple. I will check the unit tests again to see nothing odds is happening.

Just to make sure, did you pass any values to these arguments, pathologic_stages, histological_subtypes, predicted_subtypes, tumor_normal?

Can you also check what's the output of luad_data.data["SAMPLES"]?

@piyushm27
Copy link
Author

piyushm27 commented Nov 8, 2021 via email

@anhdpham
Copy link

I'm having the same problem after loading the example dataset. I think the problem is with the clinical data. If I only load the omics data I can use the luad_data.load_data(omics="all"), if I load the clinical data together with the omics data, I cannot even use luad_data.load_data(omics="all")

@JonnyTran
Copy link
Owner

Hi @anhdpham, thanks for pointing this out. I will dig further for a fix of this bug. Honestly the luad_data.load_data() functionality hasn't been updated since the first releases, so the code needs some rewriting.

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