genenetwork / genenetwork2

GeneNetwork (2nd generation)
http://gn2.genenetwork.org/
GNU Affero General Public License v3.0
34 stars 24 forks source link

Correlation on empty list bombs out #286

Closed pjotrp closed 5 years ago

pjotrp commented 6 years ago

When you open a collection and run correlation without selecting any entries in the list you get:

      GeneNetwork penguin:gene:2.11-rc1-production-e8353466b  http://gn2.genenetwork.org/corr_matrix ( 9:12AM UTC Feb 14, 2018)
       Traceback (most recent call last):
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
           rv = self.dispatch_request()
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
           return self.view_functions[rule.endpoint](**req.view_args)
         File "/home/production/gene/wqflask/wqflask/views.py", line 754, in corr_matrix_page
           return render_template("empty_collection.html", **{'tool':'Correlation Matrix'})
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/templating.py", line 133, in render_template
           return _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/environment.py", line 869, in get_or_select_template
           return self.get_template(template_name_or_list, parent, globals)
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/environment.py", line 830, in get_template
           return self._load_template(name, self.make_globals(globals))
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/environment.py", line 804, in _load_template
           template = self.loader.load(self, name, globals)
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/loaders.py", line 113, in load
           source, filename, uptodate = self.get_source(environment, name)
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/templating.py", line 57, in get_source
           return self._get_source_fast(environment, template)
         File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/templating.py", line 85, in _get_source_fast
           raise TemplateNotFound(template)
       TemplateNotFound: empty_collection.html

This should be a nicer message.

pjotrp commented 6 years ago

This is a minor bug.

Please check what happens when you select one or two items instead of zero. And same for CTL and other options. Thanks!

robwwilliams commented 6 years ago

Default behavior in this case (as in GN1) should be to

  1. automatically FORCE select all, or the first 10, items in the list:
  2. Run the job if it is simple (correlation matrix)
  3. Send an alert to user that "GN automatically select N items from your list"

I suppose we could change item 1 to select ALL items in collection, up to some reasonable max of 100.

On Wed, Feb 14, 2018 at 3:18 AM, Pjotr Prins notifications@github.com wrote:

When you open a collection and run correlation without selecting any entries in the list you get:

  GeneNetwork penguin:gene:2.11-rc1-production-e8353466b  http://gn2.genenetwork.org/corr_matrix ( 9:12AM UTC Feb 14, 2018)
   Traceback (most recent call last):
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
       return self.view_functions[rule.endpoint](**req.view_args)
     File "/home/production/gene/wqflask/wqflask/views.py", line 754, in corr_matrix_page
       return render_template("empty_collection.html", **{'tool':'Correlation Matrix'})
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/templating.py", line 133, in render_template
       return _render(ctx.app.jinja_env.get_or_select_template(template_name_or_list),
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/environment.py", line 869, in get_or_select_template
       return self.get_template(template_name_or_list, parent, globals)
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/environment.py", line 830, in get_template
       return self._load_template(name, self.make_globals(globals))
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/environment.py", line 804, in _load_template
       template = self.loader.load(self, name, globals)
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/jinja2/loaders.py", line 113, in load
       source, filename, uptodate = self.get_source(environment, name)
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/templating.py", line 57, in get_source
       return self._get_source_fast(environment, template)
     File "/usr/local/guix-profiles/gn2-2.11rc2/lib/python2.7/site-packages/flask/templating.py", line 85, in _get_source_fast
       raise TemplateNotFound(template)
   TemplateNotFound: empty_collection.html

This should be a nicer message.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/genenetwork/genenetwork2/issues/286, or mute the thread https://github.com/notifications/unsubscribe-auth/ALva_PIQO1b7fAo-kkUbMRvOt-jqU4Z8ks5tUqTQgaJpZM4SFADz .

-- Rob

Robert W. Williams, Ph.D. Chair: Department of Genetics, Genomics and Informatics 71 S Manassas St, Memphis TN 38163 University of Tennessee Health Science Center Office 901 448-7050 CELL 901 604 4752 Office: Translational Science Research Building, Room 407 EMAIL: rwilliams@uthsc.edu Alternative email: labwilliams@gmail.com SKYPE: robwwilliams

pjotrp commented 6 years ago

Still, when a user removes the list it should give a decent warning

zsloan commented 5 years ago

Error pages were added that notify the users if too few (or no) traits were selected for collection page features.