Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Problems selecting molecule entity #80

Open
NRX-044 opened this issue Dec 16, 2023 · 2 comments
Open

Problems selecting molecule entity #80

NRX-044 opened this issue Dec 16, 2023 · 2 comments

Comments

@NRX-044
Copy link

NRX-044 commented Dec 16, 2023

Hello !
I am interested in integrating LiteMol into my web-based tool by including LiteMol-plugin.js into HTML page. It works well and can display model from uploaded string data. However, when I tried to select the molecule entity and highlight specific residues by indices, it failed to select any molecule model entity, my code is as follows:

    function display_3d(localdata,rid){
        var plugin = LiteMol.Plugin.create({target: '#app'});
        console.log("displaying structure from "+rid);
        plugin.loadMolecule({
            id: rid,
            data: localdata,
            modelRef: 'model',
            moleculeRef: 'molecule',
            format: 'pdb'
        })

        var molecule = plugin.context.select('model')[0];
        if(!molecule){
            console.log('molecule not loaded '+molecule);
        }else{
            console.log('molecule selected '+molecule);
        }
    }

after executing the above function, the model was displayed on the web page successfully , but the variable molecule remained undefined which indicated that it did not captured any entity. I've check the code from examples/Commands and still get no idea why it failed. Do I missed something? Or is there any alternative solution?
Would appreciate any help!

@dsehnal
Copy link
Owner

dsehnal commented Dec 17, 2023

Hi @NRX-044, that's for the interest. Would it work for you to integrate Mol* instead? It's an official successor to LiteMol.

@NRX-044
Copy link
Author

NRX-044 commented Dec 19, 2023

Hi @NRX-044, that's for the interest. Would it work for you to integrate Mol* instead? It's an official successor to LiteMol.

Thanks for the reply, I just found PDBe-Molstar provides compiled JS plugin which has custom control over plugin instances, I'll give it a try.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants