molstar / pdbe-molstar

Molstar PDBe implementation
Apache License 2.0
96 stars 33 forks source link

can't config the plugin to N-terminus to C-terminus (rainbow) style #110

Open yyli2022 opened 4 months ago

yyli2022 commented 4 months ago

hi, dear, i can't config the plugin to N-terminus to C-terminus (rainbow) style. what i can do? there is my code. THX ` const options = { "customData": { url: pdbPath, format: 'pdb' }, "sequencePanel": true, "hideControls": true, "bgColor": { r: 255, g: 255, b: 255 }, "alphafoldView": true, visualStyle: 'cartoon', // cartoon | ball-and-stick | carbohydrate | ellipsoid | gaussian-surface | molecular-surface | point | putty | spacefill hideStructure: ['het', 'water'], loadMaps: true, mapSettings: { '2fo-fc': { opacity: 0.8, wireframe: true } }, highlightColor: '#ffff00', selectColor: '#77bbff', lighting: 'metallic', // flat | matte | glossy | metallic | plastic

// BEHAVIOR
validationAnnotation: true,
domainAnnotation: true,
symmetryAnnotation: true,
// pdbeUrl: 'https://www.ebi.ac.uk/pdbe/',
// encoding: 'cif', // cif | bcif
lowPrecisionCoords: true,
selectInteraction: false,
granularity: 'chainInstances', // element | residue | chain | entity | model | operator | structure | elementInstances | residueInstances | chainInstances
subscribeEvents: true,

"defaultPreset": "all-models",
"superpositionParams": { matrixAccession: 'P08684', segment: 1, ligandView: true, ligandColor: { r: 255, g: 255, b: 50 } }

};`

midlik commented 2 months ago

Hi, this is possible in PDBe Molstar version 3.3.0:

const options = {
    moleculeId: '1cbs',
    visualStyle: { type:'cartoon', color: 'sequence-id' },
};

If you want to keep default visual styles for ligands etc., you'll need to list style for each component individually (I admit it's a bit annoying):

const options = {
    moleculeId: '1cbs',
    visualStyle: {
        polymer: { type: 'cartoon', color: 'sequence-id' },
        het: { type: 'ball-and-stick', color: 'element-symbol' },
        water: { type: 'ball-and-stick', color: 'element-symbol' },
        carbs: { type: 'carbohydrate', color: 'carbohydrate-symbol' },
        nonStandard: { type: 'ball-and-stick', color: 'element-symbol' },
    },
};

Copy links for PDBe Molstar 3.3.0 from here: https://github.com/molstar/pdbe-molstar/wiki/1.-PDBe-Molstar-as-JS-plugin#1-include-the-style-and-script-files-of-the-library-in-your-web-page