Opened 6 years ago

Closed 6 years ago

#3075 closed enhancement (fixed)

Slow coloring of large molecular surfaces

Reported by: goddard@… Owned by: Tom Goddard
Priority: normal Milestone:
Component: Surface Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-19.4.0-x86_64-i386-64bit
ChimeraX Version: 0.94 (2020-04-16)
Description
Coloring large molecular surfaces by atom is extremely slow.  For ecample 6owg (180,000 atoms) takes less than 0.1 second to color atoms bypolymer but 30 seconds to color surfaces bypolymer.

The problem is that there are 240 chain surfaces in this example and it is making a C++ set of all atoms about 480 times for inclusion testing.


Log:
UCSF ChimeraX version: 0.94.dev202004160103 (2020-04-16)  
© 2016-2020 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 6owg format mmCIF fromDatabase pdb

6owg title:  
Structure of a synthetic beta-carboxysome shell, T=4 [more info...]  
  
Chain information for 6owg #1  
---  
Chain | Description  
0 2 3 4 6 7 8 A A0 A1 A2 A4 A5 A6 A8 A9 AA AC AD AE AG AH AI AK AL AM AO AP AQ
AS AT AU AW AX AY B B0 B1 B2 B4 B5 B6 B8 B9 BA BC BD BE BG BH BI BK BL BM BO
BP BQ BS BT BU BW BX BY C C0 C1 C2 C4 C5 C6 C8 C9 CA CC CD CE CG CH CI CK CL
CM CO CP CQ CS CT CU CW CX CY D0 D1 D2 D4 D5 D6 D8 D9 DA DC DD DE DG DH DI DK
DL DM DO DP DQ DS DT DU DW DX DY E E0 E1 E2 E4 E5 E6 EA EC ED EE EG EH EI EK
EL EM EO EP EQ ES ET EU EW EX EY F G I J K M N O Q R S U V W Y Z a b c e f g i
j k m n o q r s u v w y z | Microcompartments protein  
1 5 9 A3 A7 AB AF AJ AN AR AV AZ B3 B7 BB BF BJ BN BR BV BZ C3 C7 CB CF CJ CN
CR CV CZ D D3 D7 DB DF DJ DN DR DV DZ E3 E7 EB EF EJ EN ER EV EZ H L P T X d h
l p t x | Ethanolamine utilization protein EutN/carboxysome structural protein
Ccml  
  
  

> surface

> time color bypolymer surface

> color bypolymer surfaces

color surf 1 8.13290524482727  
color surf 5 0.8555378913879395  
color surf 6 20.800276041030884  
color surf 3 21.676551342010498  
command time 29.83 seconds  
draw time 0.765 seconds  

> select all

178080 atoms, 180300 bonds, 1 model selected  

> time color tan atoms

> color tan atoms

command time 0.04302 seconds  
draw time 0.07911 seconds  

> time color bypolymer atoms

> color bypolymer atoms

command time 0.04849 seconds  
draw time 0.07511 seconds  




OpenGL version: 4.1 ATI-3.8.24
OpenGL renderer: AMD Radeon Pro Vega 20 OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (2)

comment:1 by Tom Goddard, 6 years ago

Component: UnassignedSurface
Owner: set to Tom Goddard
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionSlow coloring of large molecular surfaces
Type: defectenhancement

One optimization would be to detect that all surface atom patches are being colored to avoid the inclusion tests. This is probably by far the most common case. It would also be possible to optimize the inclusion test so a set of all the atoms is only made one time.

comment:2 by Tom Goddard, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

100x faster now on 6owg test case (0.3 seconds instead of 30 seconds).

I added a persistent C++ std::map to Collection to optimize intersections and masking. The slow coloring was caused by doing 480 repetitive atom set intersections to determine which surface atoms were in the atoms to be colored. With the cached persistent C++ map these tests are fast.

I also cleaned up the molecular surface patch coloring API and implementation.

Note: See TracTickets for help on using tickets.