lncLOOM / LncLOOMv2

The Python 3 version of LncLOOM
2 stars 0 forks source link

RecursionError: maximum recursion depth exceeded while calling a Python object #1

Open annalisaxamin opened 3 years ago

annalisaxamin commented 3 years ago

Hi! I'm getting this error when loading a file of around 2MB. Is this a problem of LncLOOM or a problem with the file? Here is the command I used and the stack trace of the error. Thank you.

(base) annalisa@annalisa-VirtualBox:~/Documents/Progetto_tesi$ LncLOOM --fasta allspecies.fasta --solver gurobi --startw 12 --outdir Allspecies
===================================================================================================
                                            LncLOOM                                                
=========================== Ulitsky Lab - Weizmann Institute of Science ===========================
 Graph-based framework to mine ordered combinations of short conserved kmers in lincRNA sequences  
===================================================================================================

==============================================================
INPUT ARGUMENTS VALID...STARTING PROGRAM...

Excluding identical sequences...

***************************************
FASTA FILE PARSED:
Total sequences extracted = 2742
Longest sequence = 11098 bases
Shortest sequence = 1 bases
***************************************

Building a new DB, current time: 04/16/2021 16:05:36
New DB name:   /home/annalisa/Documents/Progetto_tesi/Allspecies/LincMotif/Run_Files/Blast/Sequences_BLAST_DBmain
New DB title:  Allspecies/LincMotif/Run_Files/Sequences.fasta
Sequence type: Nucleotide
Keep MBits: T
Maximum file size: 1000000000B
Adding sequences from FASTA; added 2742 sequences in 0.108823 seconds.

==============================================================
BLAST SUCCESSFUL - SEQUENCES ORDERD BY HOMOLOGY...

NO CONSTRAINTS IMPOSED ON GRAPH CONSTRUCTION...
==============================================================

Building graph...kmer length = 12
Traceback (most recent call last):
  File "/home/annalisa/anaconda3/bin/LncLOOM", line 8, in <module>
    sys.exit(main())
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LncLOOM.py", line 341, in main
    Motif_Graph_Levels,MainGraph,Main_LOOM_Level,LOOM5,LOOM3,LOOM5_Levels,LOOM3_Levels,details5,details3 = SM.start_lncLOOM(sequences,seq_lengths,kmers_len,stopw,hsps,solver,prune,min_depth,shorttandem,maxedges,noconstraints,tolerance)
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 3326, in start_lncLOOM
    LOOM = build_LOOM(sequences,seq_lengths,kmers_len,stopw,hsps,solver,prune,min_depth,shorttandem,maxedges,noconstraints)
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2616, in build_LOOM
    FinalGraph = recursive_segmentation([[F,C,Complex_Graph]],kl,solver,LOOM_at_Levels,prune,level,min_depth,maxedges,noconstraints)
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2204, in recursive_segmentation
    RF = recursive_segmentation(graph_segments,kmers_len,solver,LevelGraphs,prune,level-1,min_depth,maxedges,noconstraints)
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2204, in recursive_segmentation
    RF = recursive_segmentation(graph_segments,kmers_len,solver,LevelGraphs,prune,level-1,min_depth,maxedges,noconstraints)
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2204, in recursive_segmentation
    RF = recursive_segmentation(graph_segments,kmers_len,solver,LevelGraphs,prune,level-1,min_depth,maxedges,noconstraints)
  [Previous line repeated 984 more times]
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2020, in recursive_segmentation
    C = prune_graph_level_plus(C,level)
  File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 527, in prune_graph_level_plus
    FR = F.reverse(copy=False)
  File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/digraph.py", line 1219, in reverse
    return nx.graphviews.reverse_view(self)
  File "<decorator-gen-12>", line 2, in reverse_view
  File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/utils/decorators.py", line 78, in _not_implemented_for
    return not_implement_for_func(*args, **kwargs)
  File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/graphviews.py", line 203, in reverse_view
    newG = generic_graph_view(G)
  File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/graphviews.py", line 44, in generic_graph_view
    newG = G.__class__()
  File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/digraph.py", line 307, in __init__
    self.graph = self.graph_attr_dict_factory()  # dictionary for graph attributes
RecursionError: maximum recursion depth exceeded while calling a Python object
lncLOOM commented 3 years ago

Hi, apologies for the late response. I was visiting my family overseas.

This error is occurring because of the large number of sequences (2742) you are analyzing. The code was designed for smaller datasets. Please send me a copy of your fasta file directly to : @.*** (attachments via the GitHub sometimes are not received). I will adapt and test the code to handle larger datasets and will send you an update.

Kind regards Caroline


From: annalisaxamin @.> Sent: Friday, April 16, 2021 4:29 PM To: lncLOOM/LncLOOMv2 @.> Cc: Subscribed @.***> Subject: [lncLOOM/LncLOOMv2] RecursionError: maximum recursion depth exceeded while calling a Python object (#1)

(base) @.***VirtualBox:~/Documents/Progetto_tesi$ LncLOOM --fasta allspecies.fasta --solver gurobi --startw 12 --outdir Allspecies

                                        LncLOOM

=========================== Ulitsky Lab - Weizmann Institute of Science =========================== Graph-based framework to mine ordered combinations of short conserved kmers in lincRNA sequences

============================================================== INPUT ARGUMENTS VALID...STARTING PROGRAM...

Excluding identical sequences...


FASTA FILE PARSED: Total sequences extracted = 2742 Longest sequence = 11098 bases Shortest sequence = 1 bases


Building a new DB, current time: 04/16/2021 16:05:36 New DB name: /home/annalisa/Documents/Progetto_tesi/Allspecies/LincMotif/Run_Files/Blast/Sequences_BLAST_DBmain New DB title: Allspecies/LincMotif/Run_Files/Sequences.fasta Sequence type: Nucleotide Keep MBits: T Maximum file size: 1000000000B Adding sequences from FASTA; added 2742 sequences in 0.108823 seconds.

============================================================== BLAST SUCCESSFUL - SEQUENCES ORDERD BY HOMOLOGY...

NO CONSTRAINTS IMPOSED ON GRAPH CONSTRUCTION...

Building graph...kmer length = 12 Traceback (most recent call last): File "/home/annalisa/anaconda3/bin/LncLOOM", line 8, in sys.exit(main()) File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LncLOOM.py", line 341, in main Motif_Graph_Levels,MainGraph,Main_LOOM_Level,LOOM5,LOOM3,LOOM5_Levels,LOOM3_Levels,details5,details3 = SM.start_lncLOOM(sequences,seq_lengths,kmers_len,stopw,hsps,solver,prune,min_depth,shorttandem,maxedges,noconstraints,tolerance) File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 3326, in start_lncLOOM LOOM = build_LOOM(sequences,seq_lengths,kmers_len,stopw,hsps,solver,prune,min_depth,shorttandem,maxedges,noconstraints) File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2616, in build_LOOM FinalGraph = recursive_segmentation([[F,C,Complex_Graph]],kl,solver,LOOM_at_Levels,prune,level,min_depth,maxedges,noconstraints) File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2204, in recursive_segmentation RF = recursive_segmentation(graph_segments,kmers_len,solver,LevelGraphs,prune,level-1,min_depth,maxedges,noconstraints) File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2204, in recursive_segmentation RF = recursive_segmentation(graph_segments,kmers_len,solver,LevelGraphs,prune,level-1,min_depth,maxedges,noconstraints) File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2204, in recursive_segmentation RF = recursive_segmentation(graph_segments,kmers_len,solver,LevelGraphs,prune,level-1,min_depth,maxedges,noconstraints) [Previous line repeated 984 more times] File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 2020, in recursive_segmentation C = prune_graph_level_plus(C,level) File "/home/annalisa/anaconda3/lib/python3.8/site-packages/LncLOOMv2/LincMotif.py", line 527, in prune_graph_level_plus FR = F.reverse(copy=False) File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/digraph.py", line 1219, in reverse return nx.graphviews.reverse_view(self) File "", line 2, in reverse_view File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/utils/decorators.py", line 78, in _not_implemented_for return not_implement_for_func(*args, **kwargs) File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/graphviews.py", line 203, in reverse_view newG = generic_graph_view(G) File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/graphviews.py", line 44, in generic_graph_view newG = G.class() File "/home/annalisa/.local/lib/python3.8/site-packages/networkx/classes/digraph.py", line 307, in init self.graph = self.graph_attr_dict_factory() # dictionary for graph attributes RecursionError: maximum recursion depth exceeded while calling a Python object

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/lncLOOM/LncLOOMv2/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQL2ECIJEL5WCIRQCQTXS23TJBCTJANCNFSM43BUTBUA.