A few very useful features

13 replies [Last post]
kgutwin
User offline. Last seen 12 years 45 weeks ago. Offline
Joined: 07/14/2008
Posts:

Thanks for putting this together! I was very excited to see this in the App store, and as it is right now, I'm sure I'll find some use for it. I'm a biology (biophysics) grad student, and many times I'm away from my desk but would still like to look at some protein crystal structures.

There are a few relatively minor changes that would make this app even more helpful!

- Of course, different view modes have already been suggested. For me, I find "lines" the most helpful - where just hair-thin lines connect atomic centers. This is nice because it usually renders very fast, and is visually un-cluttered. You can represent non-bonded atoms with little '+' signs.

- Also, in lieu of a true "ribbons" mode, you could do "Calpha trace", where you hide all atoms except those of type CA, and connect those atoms with a line, sequentially within a chain. This view is very nice for getting a quick overview of the backbone structure of the protein.

- Chain coloring: change the color of just the carbon atoms in a chain-dependent manner. For simplicity of interface, you don't necessarily need to be able to specify the exact color of each chain; just a "rainbow" button would be nice to provide important distinction.

- Loading structures from personal files would be nice. Ideally, you could come up with a method which was OS-independent, such as through a web-link or saved from an email -- although I don't know what options are available in the iPhone SDK.

- Z-rotate: sometimes you want to be able to rotate the molecule around the axis perpendicular to the screen. My best interface suggestion for this is that if you touch the screen near the top or bottom, sliding your finger left or right will rotate the molecule about the Z-axis (perpendicular to the screen).

Finally, some pie-in-the-sky ideas:

- Inertia: One great gimmick/feature common on the iPhone is its ubiquitous use of inertia when scrolling. If you could figure out how to do that when rotating, that would be pretty cool. A settings slider would be nice to control the effect (amount of friction).

- Region selection: selectively highlight, show and hide certain residues, chains, atoms, etc. Save and restore these selections.

If you are able to release the source, I'd love to contribute what I can. This looks like it will be a very useful app for a lot of people!

Christoph
User offline. Last seen 12 years 45 weeks ago. Offline
Joined: 07/15/2008
Posts:

I second kgutwin's feelings. This is a great start toward a truly useful application, especially for quick sharing of structural insights when a laptop or desktop are not available or too cumbersome.
A few comments on some feature requests, with a view towards what works on a non-desktop platform:

kgutwin wrote:

- Of course, different view modes have already been suggested. For me, I find "lines" the most helpful - where just hair-thin lines connect atomic centers. This is nice because it usually renders very fast, and is visually un-cluttered. You can represent non-bonded atoms with little '+' signs.

Partially disagree on that. A straightforward line rep will wash out in all but the most favorable lighting conditions, especially outdoors. iPhones and iPod Touch are meant to be used everywhere, so meticulous attention to usability in any environment is key. I suggest a pseudo-line representation with spacefilling, capped cylinders. Still very fast and uncluttered, but with the advantage of much improved visibility and depth perception due to OpenGL lighting.

Quote:

- Also, in lieu of a true "ribbons" mode, you could do "Calpha trace", where you hide all atoms except those of type CA, and connect those atoms with a line, sequentially within a chain. This view is very nice for getting a quick overview of the backbone structure of the protein.

Same as above. Use narrow cylinders instead of lines. If ball-and-stick works well enough now, this will fly.

Quote:

- Chain coloring: change the color of just the carbon atoms in a chain-dependent manner. For simplicity of interface, you don't necessarily need to be able to specify the exact color of each chain; just a "rainbow" button would be nice to provide important distinction.

Very good suggestion! I strongly suggest to break with the 30 year old convention of using saturated primary colors and use a nice palette of light, bright colors instead. David Goodsell of "Molecule of the Month" fame has it right, IMHO.

Quote:

- Loading structures from personal files would be nice. Ideally, you could come up with a method which was OS-independent, such as through a web-link or saved from an email -- although I don't know what options are available in the iPhone SDK.

There's this cool little database in the iPhone OS to store stuff. Again, break with the past and move away from files, except for reading and writing on the fly as they stream in and out via network connections.

[snip]

Quote:

Finally, some pie-in-the-sky ideas:

- Inertia: One great gimmick/feature common on the iPhone is its ubiquitous use of inertia when scrolling. If you could figure out how to do that when rotating, that would be pretty cool. A settings slider would be nice to control the effect (amount of friction).

It's not inertia really, it's simple detection of orientation of the device relative to the gravity field, AFAIK. But I agree, a potentially complex app like Molecules needs to take advantage of all features of the iPhone to remain simple to use. I imagine translation of the displayed object could be dependent on how you hold the device, i.e. letting the molecule "slide" across the screen under the influence of gravity. Maybe this needs a "button" for activation to control when we want it and when not.

Quote:

- Region selection: selectively highlight, show and hide certain residues, chains, atoms, etc. Save and restore these selections.

This one is really, really hard on such a constrained device, but very definitely the most powerful of all features if implemented. I've spent my entire commute yesterday brainstorming this...
The simplest solution I can come up with is to compile a list of atoms, residues and chains as the PDB file is read in. Then present those arrays in a hierarchical list and let the user tap the desired features to prepare a selection to which a new representation will be applied. This also implies a hierarchical set of OpenGL representations displayed on the screen to render the final scene. This can quickly overwhelm a simple processor, but I suppose we don't know the limits just yet.

Quote:

If you are able to release the source, I'd love to contribute what I can. This looks like it will be a very useful app for a lot of people!

Same here.
I am registered with Apple as an iPhone developer and have the iPhone SDK on my MBP, but haven't gone beyond checking out a couple of example projects and hacking one a bit - I am not a coder, rather a veteran structural biologist who has maintained and occasionally hacked just about any relevant app you can name. Haven't reread the SDK license. However, I believe it does allow for enlarging one's team.

kgutwin
User offline. Last seen 12 years 45 weeks ago. Offline
Joined: 07/14/2008
Posts:

Christoph wrote:
It's not inertia really, it's simple detection of orientation of the device relative to the gravity field, AFAIK. But I agree, a potentially complex app like Molecules needs to take advantage of all features of the iPhone to remain simple to use. I imagine translation of the displayed object could be dependent on how you hold the device, i.e. letting the molecule "slide" across the screen under the influence of gravity. Maybe this needs a "button" for activation to control when we want it and when not.

Maybe we're thinking of different things :) I'm not talking about any accelerometer-based effect; instead, when you swipe your finger, the molecule keeps spinning for a bit. Like how when you scroll a list, it'll keep scrolling, gradually slowing down.

But the accelerometer would add a unique twist to this app... You mentioned translation -- I think rotation might be more interesting. Kind of like the iPhone was a window into a virtual world, you imagine the iPhone being on the surface of a virtual sphere, and rotation of the phone in the gravitational field moves the camera on that sphere appropriately. Then, if you wanted to look at the top of the molecule, you would hold the phone flat and look down; if you wanted to look at the bottom, you would hold the phone over your head and look up :)

Christoph wrote:
re: view modes
Partially disagree on that. A straightforward line rep will wash out in all but the most favorable lighting conditions, especially outdoors. iPhones and iPod Touch are meant to be used everywhere, so meticulous attention to usability in any environment is key. I suggest a pseudo-line representation with spacefilling, capped cylinders. Still very fast and uncluttered, but with the advantage of much improved visibility and depth perception due to OpenGL lighting.

To each his own. Personally, I find cylinders (also known as 'sticks' vs. 'lines') to be unnecessarily slow on my slower machines. Judging by the iPhone's performance rendering spheres on the ACE/Aricept structure, it isn't exactly an OpenGL speed demon. However, having both options is important, for all the reasons we have mentioned.

One other thought: This application could be invaluable for poster presentations. Many times it's very difficult to show an interesting 3D relationship on a 2D poster. It would be great to be able to answer people's questions with a 3D structure... in your pocket :) Of course, to get this right, you need all of the features we've discussed.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

These are great suggestions. Unfortunately, I'm getting a little swamped here at Semicon and due to lack of Wifi can't respond in as much detail as I'd like, but I'll follow on with more later.

In the meantime, if you have agreed to the NDA and downloaded the iPhone SDK, email me and I'll send you the source code. Documentation is a little sparse, but I'll post on the structure and function of it when I can.

Will-WAC
User offline. Last seen 12 years 37 weeks ago. Offline
Joined: 07/14/2008
Posts:

This is a fantastic app; thanks! Ball and sticks is best for me too!

kgutwin wrote:

- Loading structures from personal files would be nice.

As a chemist this would be extremely useful. I am not so interested in proteins and would love to be able to somehow put normal molecules on there. I have no idea how the software works, and whether it makes a difference, but I am able to save them as a .pdb file, or any other 3D file.

jhoch
User offline. Last seen 12 years 45 weeks ago. Offline
Joined: 07/16/2008
Posts:

The ability to load structures that are not yet deposited in the PDB would be awesome - and structural biologists like myself would use it as a research tool.

Also - many PDB files (e.g. NMR structures) contain more than one instance of the molecule. At present Molecules loads all of these and superimposes them. A way to select a single instance would be helpful. An example of the syntax used by some other applications is 1RW5:3

Will-WAC
User offline. Last seen 12 years 37 weeks ago. Offline
Joined: 07/14/2008
Posts:

jhoch wrote:
Also - many PDB files (e.g. NMR structures) contain more than one instance of the molecule. At present Molecules loads all of these and superimposes them. A way to select a single instance would be helpful. An example of the syntax used by some other applications is 1RW5:3

ohhh that's good, I thought it was just me. I tried openeing some calicheamicin thing and it had all 6 structures all displayed on top of one another. I hope that isn't too hard a problem to fix.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

Will-WAC wrote:
This is a fantastic app; thanks! Ball and sticks is best for me too!

kgutwin wrote:

- Loading structures from personal files would be nice.

As a chemist this would be extremely useful. I am not so interested in proteins and would love to be able to somehow put normal molecules on there. I have no idea how the software works, and whether it makes a difference, but I am able to save them as a .pdb file, or any other 3D file.

The tricky part of this is getting the structures on the device. Apple did not provide a means of syncing data through the tether via iTunes like it has for all its applications (with the weird exception of Notes). This is why I went with the direct download via the PDB, as kludgy as it is right now, because the PDB is an always-on, network-accessible source.

However, a couple of developers have put out applications that use Bonjour and a local network to transfer data, one or two even making the device look like a network-attached drive. If I can figure out how to do that, then it should be possible to let users load custom structures. In the worst case it might require a client program on the user's computer to transfer the files, but I was planning on porting Molecules across to the Mac anyways (a little UI work is needed, but the core Cocoa code would stay the same), so this could just be another function of that port.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

jhoch wrote:

Also - many PDB files (e.g. NMR structures) contain more than one instance of the molecule. At present Molecules loads all of these and superimposes them. A way to select a single instance would be helpful. An example of the syntax used by some other applications is 1RW5:3

Yeah, this was one of those things that I discovered after I submitted the application. I had just been looking at the X-ray structures and forgot about the NMR ones. It's also a tricky UI problem. Where would you suggest the choice of alternate structures be presented to the user? I'm thinking that it could be under the detail view for the molecule as a "Currently visible structure" item that, when tapped, slides over to a list where you can pick the structure to show. I haven't looked, but are the different structures identified by anything other than number in the PDB format? If so, that could be used as the labels in that list.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

kgutwin wrote:
Christoph wrote:
It's not inertia really, it's simple detection of orientation of the device relative to the gravity field, AFAIK. But I agree, a potentially complex app like Molecules needs to take advantage of all features of the iPhone to remain simple to use. I imagine translation of the displayed object could be dependent on how you hold the device, i.e. letting the molecule "slide" across the screen under the influence of gravity. Maybe this needs a "button" for activation to control when we want it and when not.

Maybe we're thinking of different things :) I'm not talking about any accelerometer-based effect; instead, when you swipe your finger, the molecule keeps spinning for a bit. Like how when you scroll a list, it'll keep scrolling, gradually slowing down.

But the accelerometer would add a unique twist to this app... You mentioned translation -- I think rotation might be more interesting. Kind of like the iPhone was a window into a virtual world, you imagine the iPhone being on the surface of a virtual sphere, and rotation of the phone in the gravitational field moves the camera on that sphere appropriately. Then, if you wanted to look at the top of the molecule, you would hold the phone flat and look down; if you wanted to look at the bottom, you would hold the phone over your head and look up :)

Like many iPhone developers, I thought the accelerometer was really cool and wanted to use it as an input method. Unfortunately, I tried it and it doesn't work too well in practice for this kind of application. It just doesn't provide you the same sort of precise control over rotation that a direct touch does. Besides, you'd have to hold the device perfectly flat in order to maintain a specific view angle on the molecule or do weird contortions to look at it from different angles.

That said, maybe rotating the view on a switch to landscape might have some advantages. I'll take a look at it.

As far as the inertia-based rotation, I think what you're looking for is if you flick the display you want the molecule to spin for a short duration after the flick, with the degree of rotation determined by the speed of the flick. This would be similar to the scrolling effect of the lists on the iPhone. Right now, rotation is determined by the instantaneous differences in position of your finger as it moves across the screen. To implement this suggestion, I'd need to differentiate between a slow and fast moving gesture, as well as one that stops before the finger is picked up or one where the finger leaves the surface as it is still moving. Then, I'd need to add a timing routine that moves the molecule at a set rotational velocity determined by the flick speed, and decelerating for a set period of time. This timing routine would need to be interruptible in case you wanted to stop the rotation before it was finished and move it a different direction.

It's doable, but It'd take a bit of time, so I don't think it will be a high priority until I've addressed the more important issues, like multiple data sources, ribbon visualization, overall performance, etc. Once you think about it, you start to appreciate all the stuff that Apple is doing under the hood for you in their control elements.

mwarren
User offline. Last seen 12 years 44 weeks ago. Offline
Joined: 07/22/2008
Posts:

The user interface I'm imagining would allow one to position the molecule using the current touch gestures. Once that was done, the accelerometer would then allow Molecules to hold the model in the same "virtual" orientation while the iPhone moved around.

For example, imagine an iPhone lying on a table with the DNA model oriented (using existing touch gestures) with the axis of the helix sticking up vertically out of the table. Now lift the top of the iPhone to tilt the screen up 45 degrees from the table; could Molecules use the accelerometer to dynamically reorient the DNA model so that the helix' axis continued to stick straight up from the table even though the iPhone changed position? Using the accelerometer in this way would, I think, make the model seem somewhat independent of the iPhone and thus a bit more "real".

Syndicate content