yoavram / curveball

Predicting microbial growth in a mixed culture from growth curve data
http://curveball.yoavram.com
Other
14 stars 5 forks source link

Use with Biotek Reader #152

Open behrimg opened 4 years ago

behrimg commented 4 years ago

Hi, I am trying to use curveball with data from a Biotek reader.

I edited your example titled "example_model_fitting.py" to now read:

#!/usr/bin/env python
import curveball
import pandas as pd
import warnings
warnings.simplefilter('ignore', FutureWarning)

if __name__ == '__main__':
        plate = pd.read_csv('BacillusPlate.txt')
        df = curveball.ioutils.read_biotek_xlsx('Bacillus_48W_Fitness.xlsx', plate=plate, PRINT=True)
        models, fig, ax = curveball.models.fit_model(df[df.Strain == 'S1'], PLOT=True, PRINT=False)
        fig.savefig('docs/_static/example_model_fitting.svg')

The workbook seems to initially get read into curveball correctly as it prints: Reading worksheet 0 with 83 lines from workbook Bacillus_48W_Fitness.xlsx

But then it quickly errors with:

Traceback (most recent call last):
File "CurveballBacillus.py", line 17, in <module>
    df = curveball.ioutils.read_biotek_xlsx('Bacillus_48W_Fitness.xlsx', plate=plate, PRINT=True)
File "/home/mbehrin2/.local/lib/python3.7/site-packages/curveball/ioutils.py", line 520, in read_biotek_xlsx
    df = pd.concat(dfs )
File "/packages/7x/anaconda3/5.3.0/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 228, in concat
    copy=copy, sort=sort)
File "/packages/7x/anaconda3/5.3.0/lib/python3.7/site-packages/pandas/core/reshape/concat.py", line 262, in __init__
    raise ValueError('No objects to concatenate')
ValueError: No objects to concatenate

I have attached the files that I'm using as my data and plate files here, I'm not sure if this recreates the error on your end. (The only difference is I changed the .csv suffix to .txt in my code above and in the file, as Github doesn't accept the .csv suffix when pasting a file into an issue. )

I'm using Anaconda v.5.3.0 and Python v.3.7

I'm sorry in advance if I am missing something obvious here that is causing the error.

Bacillus_48W_Fitness.xlsx

BacillusPlate.txt