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

Improve validation of medium types on import #8

Open
Mechah opened this issue Sep 14, 2020 · 5 comments
Open

Improve validation of medium types on import #8

Mechah opened this issue Sep 14, 2020 · 5 comments
Labels
feature New feature or request

Comments

@Mechah
Copy link

Mechah commented Sep 14, 2020

Hey, I created an adapted per sample diet model with the following structure for my dataset:

flux	dilution	metabolite	reaction	sample_id

0 0.000135232 0.1 fru_m EX_fru_m ORS18-017
1 0.000329774 0.1 glc_m EX_glc_m ORS18-017
2 4.99876E-05 0.1 gal_m EX_gal_m ORS18-017
3 0.0148986 0.1 man_m EX_man_m ORS18-017
4 0.000161329 0.1 mnl_m EX_mnl_m ORS18-017
5 0.0148986 0.1 fuc_L_m EX_fuc_L_m ORS18-017

However, after import as --type MicomMedium[PerSample] I receive the following error with the qiime micom grow command:

Plugin error from micom:

'DataFrame' object has no attribute 'reaction'

Hope you can help!
Thanks!

@cdiener
Copy link
Contributor

cdiener commented Sep 14, 2020

What file type did you import? Media have to be CSV files not tab-delimited. Also the initial index column (0, 1, 2, ...) has to be removed.

@Mechah
Copy link
Author

Mechah commented Sep 15, 2020

I used CSV and removed the initial index column, but I received the same error again...

Plugin error from micom:

'DataFrame' object has no attribute 'reaction'

@cdiener
Copy link
Contributor

cdiener commented Sep 15, 2020

Assuming your imported file is called medium.qza. Could you run:

import qiime2 as q2                                                                                                                                                                    
import pandas as pd                                                                                                                                                                    

art = q2.Artifact.load("medium.qza")                                                                                                                                                   
art.view(pd.DataFrame)                                                                                                                                                                 

in your Qiime 2 env and post the output please. Also make sure your file does have a header row, so the first row should be literally flux,dilution,metabolite,reaction,sample_id.

@Mechah
Copy link
Author

Mechah commented Sep 16, 2020

I solved my error:
Unfortunately, my CSV export from Excel used semicolons and not commas as default separator... (I did not double check)

Would it make sense that the user receives an error already during import if the data format is not appropriate? (Due to my successful import of my per sample medium I thought the error is associated with the micom grow command...)

Thanks for your help Christian, sorry for bothering you and hopefully the air improves soon in the Pacific Northwest!

@cdiener
Copy link
Contributor

cdiener commented Sep 16, 2020

No problem 😁 Yeah I should use a more strict validation for the medium type. I'll leave that issue open but will change the title.

@cdiener cdiener changed the title per sample diet model Improve validation of medium types on import Sep 16, 2020
@cdiener cdiener added the feature New feature or request label Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants