Skip to content

Micom couldn't pick up column names when building community model #227

Description

@suetli19

Hi there,

I tried to input my data frame to build community model but encounter error which shows:

IndexError                                Traceback (most recent call last)
Cell In[89], line 1
----> 1 manifest = build(
      2     taxonomy,
      3     model_db="./agora201_gtdb207_species_1.qza",
      4     out_folder="br103_model",
      5     threads=2
      6 )

File ~/LUSTRE/miniconda3/lib/python3.9/site-packages/micom/workflows/build.py:111, in build(taxonomy, model_db, out_folder, cutoff, threads, solver)
    106 out_path = pd.Series({s: os.path.join(out_folder, s + ".pickle") for s in samples})
    107 args = [
    108     [s, taxonomy[taxonomy.sample_id == s], model_db, out_path[s], cutoff, solver]
    109     for s in samples
    110 ]
--> 111 res = workflow(build_and_save, args, threads)
    112 metrics = pd.concat(res)
    113 taxonomy = (
    114     taxonomy.groupby("sample_id")
    115     .apply(_reduce_group)
    116     .dropna(axis=1)
    117     .reset_index(drop=True)
    118 )

File ~/LUSTRE/miniconda3/lib/python3.9/site-packages/micom/workflows/core.py:55, in workflow(func, args, threads, description, progress)
     53         if progress:
     54             it = track(it, total=len(args), description="Running")
---> 55         results = list(it)
     56 finally:
     57     pool.close()

File ~/LUSTRE/miniconda3/lib/python3.9/site-packages/rich/progress.py:173, in track(sequence, description, total, completed, auto_refresh, console, transient, get_time, refresh_per_second, style, complete_style, finished_style, pulse_style, update_period, disable, show_speed)
    162 progress = Progress(
    163     *columns,
    164     auto_refresh=auto_refresh,
   (...)
    169     disable=disable,
    170 )
    172 with progress:
--> 173     yield from progress.track(
    174         sequence,
    175         total=total,
    176         completed=completed,
    177         description=description,
    178         update_period=update_period,
    179     )

File ~/LUSTRE/miniconda3/lib/python3.9/site-packages/rich/progress.py:1225, in Progress.track(self, sequence, total, completed, task_id, description, update_period)
   1223 if self.live.auto_refresh:
   1224     with _TrackThread(self, task_id, update_period) as track_thread:
-> 1225         for value in sequence:
   1226             yield value
   1227             track_thread.completed += 1

File ~/LUSTRE/miniconda3/lib/python3.9/multiprocessing/pool.py:870, in IMapIterator.next(self, timeout)
    868 if success:
    869     return value
--> 870 raise value

IndexError: index 0 is out of bounds for axis 0 with size 0



**This is my taxonomy columns when I check for "taxonomy.columns":**

Index(['sample_id', 'id', 'abundance', 'species', 'genus', 'family', 'order',
       'class', 'phylum'],
      dtype='object')

Could you help me to figure what has went wrong? Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions