ngl icon indicating copy to clipboard operation
ngl copied to clipboard

CAlphaOnly not working when loading pdb from rcsb

Open martingraham opened this issue 6 years ago • 1 comments

This might be me not understanding what's possible, but using this adjusted codepen of Alex's, I've loaded the same protein 3 times, showing from left to right: 1. from a data:// source (in red), 2. from a data:// source with cAlphaOnly:true (in yellow), and 3. from a rcsb:// source with cAlphaOnly:true (in cyan)

https://codepen.io/anon/pen/WPqgpv

I expected the last two to be the same, but loading with rcsb:// seems to ignore the cAlphaOnly setting. Have I just got something in the wrong place, is it a bug or is it something that's not doable?

martingraham avatar Feb 22 '19 15:02 martingraham

looks like a bug, a workaround is the following

stage.loadFile( "rcsb://1crn.bb.mmtf", {cAlphaOnly:true}).then( function( o ){
    var p = new NGL.Vector3( -50, 0, 0 );
    o.setPosition( p );
    o.addRepresentation( "backbone", {color: "cyan"});
    stage.autoView();
} );

arose avatar Feb 22 '19 17:02 arose