GRIT-1.1.3 - TypeError: object of type 'generator' has no len()

158 views
Skip to first unread message

Vikas Bansal

unread,
Aug 13, 2014, 10:11:59 AM8/13/14
to grit...@googlegroups.com
Dear Nathan,

I am running GRIT on the test data you provided. Command line used-

run_grit.py --control AdMatedF_Ecl_20days_Heads.control.txt --reference flybase-r5.45.chr4.gtf -t 20

I am getting an error. Please see below some part of error. In the end I do not get any transcripts in gtf file.

Thanks in advance and best wishes,
Vikas







Waiting for gene to process (1)
FINISHED Finding Exons in Chrm 4 Strand + Pos 1085081-1099332
Waiting for gene to process (1)
Waiting for gene to process (1)
Waiting for gene to process (1)
Waiting for gene to process (1)
Waiting for gene to process (1)


Loading discovered.AdMatedF_Ecl_20days_Heads.elements.bed
Finished Loading discovered.AdMatedF_Ecl_20days_Heads.elements.bed
Estimating the fragment length distribution
Finished estimating the fragment length distribution
Initializing processing data
Clustering elements into genes for 4:-

Clustering elements into genes for 4:+

Finished initializing processing data
Spawning new worker child
Initializing background writer
Spawning new worker child
Spawning new worker child
Building transcript and ORFs for Gene 4_p_34
Spawning new worker child
Building transcript and ORFs for Gene 4_p_33
FINISHED Building transcript and ORFs for Gene 4_p_34
Spawning new worker child

FINISHED Building transcript and ORFs for Gene 4_p_33
Finding design matrix for Gene 4_p_34
Spawning new worker child
Building transcript and ORFs for Gene 4_p_32

Finding design matrix for Gene 4_p_34(4:+:1219475-1226882) - 2 transcripts
Finding design matrix for Gene 4_p_33
Spawning new worker child
Building transcript and ORFs for Gene 4_p_31
FINISHED Building transcript and ORFs for Gene 4_p_32
Finding design matrix for Gene 4_p_33(4:+:1206428-1213165) - 4 transcripts
Building transcript and ORFs for Gene 4_p_30
Spawning new worker child

Finding design matrix for Gene 4_p_32
FINISHED Building transcript and ORFs for Gene 4_p_30
Building transcript and ORFs for Gene 4_p_29
Spawning new worker child
Finding design matrix for Gene 4_p_32(4:+:1168076-1190969) - 12 transcripts

Waiting for write queue to fill.
FINISHED Building transcript and ORFs for Gene 4_p_29
Finding design matrix for Gene 4_p_30
Spawning new worker child
Building transcript and ORFs for Gene 4_p_28
Building transcript and ORFs for Gene 4_p_27

Finding design matrix for Gene 4_p_30(4:+:1144789-1145888) - 2 transcripts
Spawning new worker child
Finding design matrix for Gene 4_p_29
FINISHED Building transcript and ORFs for Gene 4_p_28
FINISHED Building transcript and ORFs for Gene 4_p_27
Building transcript and ORFs for Gene 4_p_26
Spawning new worker child


Finding design matrix for Gene 4_p_27
FINISHED Building transcript and ORFs for Gene 4_p_26
Finding design matrix for Gene 4_p_28
Process Process-131:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 754, in worker
    (rnaseq_reads, promoter_reads, polya_reads) )
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 472, in build_design_matrices_worker
    config.MAX_NUM_TRANSCRIPTS)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 834, in __init__
    self._build_rnaseq_arrays(gene, rnaseq_reads, fl_dists)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 693, in _build_rnaseq_arrays
    expected_rnaseq_array, observed_rnaseq_array)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 600, in cluster_rows
    (len(clusters), expected_rnaseq_array.shape[1]) )
TypeError: object of type 'generator' has no len()
Building transcript and ORFs for Gene 4_p_25
Spawning new worker child
FINISHED Building transcript and ORFs for Gene 4_p_31
Finding design matrix for Gene 4_p_27(4:+:1052488-1055186) - 1 transcripts
Finding design matrix for Gene 4_p_28(4:+:1081591-1081888) - 1 transcripts

Finding design matrix for Gene 4_p_26
FINISHED Building transcript and ORFs for Gene 4_p_25
Building transcript and ORFs for Gene 4_p_24
Spawning new worker child
Building transcript and ORFs for Gene 4_p_23
Finding design matrix for Gene 4_p_26(4:+:1010344-1028353) - 8 transcripts

Process Process-133:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 754, in worker
    (rnaseq_reads, promoter_reads, polya_reads) )
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 472, in build_design_matrices_worker
    config.MAX_NUM_TRANSCRIPTS)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 834, in __init__
FINISHED Building transcript and ORFs for Gene 4_p_24
    self._build_rnaseq_arrays(gene, rnaseq_reads, fl_dists)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 693, in _build_rnaseq_arrays
    expected_rnaseq_array, observed_rnaseq_array)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 600, in cluster_rows
    (len(clusters), expected_rnaseq_array.shape[1]) )
TypeError: object of type 'generator' has no len()




Waiting for write queue to fill.
Process Process-247:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 754, in worker
    (rnaseq_reads, promoter_reads, polya_reads) )
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 472, in build_design_matrices_worker
    config.MAX_NUM_TRANSCRIPTS)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 834, in __init__
    self._build_rnaseq_arrays(gene, rnaseq_reads, fl_dists)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 693, in _build_rnaseq_arrays
    expected_rnaseq_array, observed_rnaseq_array)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 600, in cluster_rows
    (len(clusters), expected_rnaseq_array.shape[1]) )
TypeError: object of type 'generator' has no len()
Process Process-205:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 754, in worker
    (rnaseq_reads, promoter_reads, polya_reads) )
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/build_transcripts.py", line 472, in build_design_matrices_worker
    config.MAX_NUM_TRANSCRIPTS)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 834, in __init__
    self._build_rnaseq_arrays(gene, rnaseq_reads, fl_dists)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 693, in _build_rnaseq_arrays
    expected_rnaseq_array, observed_rnaseq_array)
  File "/usr/local/lib/python2.7/dist-packages/GRIT-1.1.3-py2.7-linux-x86_64.egg/grit/f_matrix.py", line 600, in cluster_rows
    (len(clusters), expected_rnaseq_array.shape[1]) )
TypeError: object of type 'generator' has no len()
Finished building transcripts


Message has been deleted

Vikas Bansal

unread,
Aug 14, 2014, 6:20:11 AM8/14/14
to grit...@googlegroups.com, mikael...@versailles.inra.fr
Bingo! Thanks to Mikael (see below). It works like a charm.


 
Hi Vikas,

I recently installed GRIT, and i've got a similar problem.


"Error: object of type 'generator' has no len()"

Please check the python module version of python-networkx it must be 1.7.

rm -rf /lib/python2.7/site-packages/networkx-1.9-py2.7.egg (or where ever the networkx-1.9-py2.7.egg is located)
pip install networkx==1.7

After downgrading this module version it seems to work for me.

Regards,

Mikael

njster

unread,
Sep 5, 2014, 3:37:05 PM9/5/14
to grit...@googlegroups.com, mikael...@versailles.inra.fr
Hi! 

I just wonder if there is another way to solve this problem? I work on our company's cluster and there is no way I can do this. I tried to install networkx-1.7 under my user folder and still got a bunch of error messages.

I use python-2.7.7 and networkx on our cluster is 1.9. I tried python-2.7.4 with networkx-1.7, but got the error with cython and gcc versions.

Thanks a lot,

Ying
Reply all
Reply to author
Forward
0 new messages