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

TypeError: '<=' not supported between instances of 'list' and 'float' #102

Open
mhorlacher opened this issue Apr 22, 2022 · 4 comments
Open

Comments

@mhorlacher
Copy link

Getting the above error when running MoDisco.

Minimal example to reproduce the error:

import modisco
import numpy as np
import tensorflow as tf

one_hot = tf.one_hot(np.random.randint(low=0, high=3, size=100*50).reshape(50, 100), depth=4).numpy()
print(one_hot.shape)

impscores = tf.random.uniform(shape=one_hot.shape).numpy()
print(impscores.shape)

null_per_pos_scores = modisco.coordproducers.LaplaceNullDist(num_to_samp=500)

tfmodisco_results = modisco.tfmodisco_workflow.workflow.TfModiscoWorkflow(
            target_seqlet_fdr=0.25,
            seqlets_to_patterns_factory=
                modisco.tfmodisco_workflow.seqlets_to_patterns.TfModiscoSeqletsToPatternsFactory(
                    initclusterer_factory=modisco.clusterinit.memeinit.MemeInitClustererFactory(    
                        meme_command="meme", base_outdir="meme_out",   
                        #max_num_seqlets_to_use specifies the maximum number of seqlets to use
                        # with MEME (this is to speed up MEME in the cases where the number of seqlets is
                        #  very large)
                        max_num_seqlets_to_use=10000,
                        nmotifs=10,
                        n_jobs=4),
                    use_louvain=False,
                    #Adjust trim_to_window_size and initial_flank_to_add
                    # according to how big you expect
                    # the core motif to be; default value is 10
                    trim_to_window_size=8,
                    initial_flank_to_add=2,
                    final_flank_to_add=5,
                    final_min_cluster_size=20
            ),
       )(
    #There is only one task, so we just call this 'task0'
    task_names=["task0"],
    contrib_scores={'task0': impscores},                
    hypothetical_contribs={'task0': impscores},
    one_hot=one_hot,
    null_per_pos_scores=null_per_pos_scores)

Any help welcome.

@halasadi
Copy link

halasadi commented Nov 7, 2022

I get the same issue sometimes, seems to be dependent on input data.

@AvantiShri
Copy link
Collaborator

Hi, sorry for the slow response (I've graduated and am no longer actively involved with this project) - you may want to refer to the TF-MoDISco lite repository (https://github.com/jmschrei/tfmodisco-lite/) for a more efficient, actively maintained, and easier-to-use version of the same algorithm.

@AvantiShri
Copy link
Collaborator

But to answer the question to the best of my ability (easier with a stack trace/output logs): when random or low-quality importance scores are used, the number of seqlets passing the filtering steps tends to become very small, and my guess is that the error is due to that

@gz-mg
Copy link

gz-mg commented Sep 18, 2023

Hello, how did you solve it in the end?

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

4 participants