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

Update build_consensus_reference.py to prevent the AssertionError #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noranekonobokkusu
Copy link

When the largest identified cluster in clus_dict_all is smaller than the total number of individual cNMF results (self.num_results), pd.DataFrame.from_dict causes the assertion error, e.g.

Traceback (most recent call last):
  File “/home/unix/safina/.conda/envs/cnmf/lib/python3.10/site-packages/pandas/core/internals/construction.py”, line 939, in _finalize_columns_and_data
    columns = _validate_or_indexify_columns(contents, columns)
  File “/home/unix/safina/.conda/envs/cnmf/lib/python3.10/site-packages/pandas/core/internals/construction.py”, line 986, in _validate_or_indexify_columns
    raise AssertionError(
AssertionError: 6 columns passed, passed data had 4 columns

which occurs because the largest identified consensus program consists of four individual programs from a total of six independent cNMF runs. Replacing self.num_results with the size of the largest cluster solves the issue.

The update prevents the AssertionError which is triggered when the largest identified consensus cluster is smaller than the original number of cNMF runs.
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

Successfully merging this pull request may close these issues.

1 participant