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

from_delayed error when running grnboost2 #17

Open
scastlara opened this issue Aug 12, 2019 · 0 comments
Open

from_delayed error when running grnboost2 #17

scastlara opened this issue Aug 12, 2019 · 0 comments

Comments

@scastlara
Copy link

scastlara commented Aug 12, 2019

Hi,

I installed arboreto through pip and I can't successfully run the following code using the example data provided in this repository :

import pandas as pd
from distributed import Client, LocalCluster
from arboreto.utils import load_tf_names
from arboreto.algo import grnboost2

in_file  = 'net1_expression_data.tsv'
tf_file  = 'net1_transcription_factors.tsv'
out_file = 'net1_grn_output.tsv'

# ex_matrix is a DataFrame with gene names as column names
ex_matrix = pd.read_csv(in_file, sep='\t')

# tf_names is read using a utility function included in Arboreto
tf_names = load_tf_names(tf_file)

# compute the GRN
network = grnboost2(expression_data=ex_matrix, tf_names=tf_names)

When I run the code I get the following error, which prevents the program from running:

Exception: ValueError("Metadata mismatch found in `from_delayed`.\n\nThe columns in the computed data do not match the columns in the provided metadata.\n Index([u'TF', u'importance', u'target'], dtype='object')\n  :Index([u'TF', u'target', u'importance'], dtype='object')",)

Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/arboreto/algo.py", line 41, in grnboost2
    early_stop_window_length=early_stop_window_length, limit=limit, seed=seed, verbose=verbose)
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/arboreto/algo.py", line 135, in diy
    .compute(graph, sync=True) \
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/distributed/client.py", line 2758, in compute
    result = self.gather(futures)
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/distributed/client.py", line 1822, in gather
    asynchronous=asynchronous,
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/distributed/client.py", line 753, in sync
    return sync(self.loop, func, *args, **kwargs)
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/distributed/utils.py", line 331, in sync
    six.reraise(*error[0])
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/distributed/utils.py", line 316, in f
    result[0] = yield future
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/tornado/concurrent.py", line 261, in result
    raise_exc_info(self._exc_info)
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/distributed/client.py", line 1653, in _gather
    six.reraise(type(exception), exception, traceback)
  File "/home/compgen/users/scastillo/.local/lib/python2.7/site-packages/dask/dataframe/utils.py", line 598, in check_meta
    errmsg))
ValueError: Metadata mismatch found in `from_delayed`.

The columns in the computed data do not match the columns in the provided metadata.
 Index([u'TF', u'importance', u'target'], dtype='object')
  :Index([u'TF', u'target', u'importance'], dtype='object')

Is there something I am doing wrong? I have had the same error in two different machines with my own data, which made me look into using the provided examples.

Thank you.

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

1 participant