diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ad20a0e66a3ee1f4917c8e7fb6b5cdd50404427..1f834fc289fdc36416e4d5d46d0479bf6a2ad8ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,11 @@ Note that since we don't clearly distinguish between a public and private interf - Fix flickering during marking with camera at rest - Enable ``aromaticBonds`` in structure representations by default - Add ``PluginConfig.Structure.DefaultRepresentationPreset`` -- Add ModelArchive schema extensions (e.g., AlphaFold uses it for the pLDDT score) -- Add ModelArchive option in DownloadStructure action +- Add ModelArchive support + - schema extensions (e.g., AlphaFold uses it for the pLDDT score) + - ModelArchive option in DownloadStructure action + - ``model-archive`` GET parameter for Viewer app + - ``Viewer.loadModelArchive`` method - Improve support for loading AlphaFold structures - Automatic coloring by pLDDT - AlphaFold DB option in DownloadStructure action diff --git a/src/apps/viewer/index.html b/src/apps/viewer/index.html index 57bd5d87387a12b58c47ee40a196ef1730934a20..6de419c98e3dc00a3c34d29e6e3d330ca1606ec5 100644 --- a/src/apps/viewer/index.html +++ b/src/apps/viewer/index.html @@ -93,6 +93,9 @@ var afdb = getParam('afdb', '[^&]+').trim(); if (afdb) viewer.loadAfdb(afdb); + + var modelArchive = getParam('model-archive', '[^&]+').trim(); + if (modelArchive) viewer.loadModelArchive(modelArchive); </script> <!-- __MOLSTAR_ANALYTICS__ --> </body> diff --git a/src/apps/viewer/index.ts b/src/apps/viewer/index.ts index bac1aa6b25c65492fac5b5f983de4bf383de3bea..0ec98c510783e5eccb62b309a8a0d5f5e10072f6 100644 --- a/src/apps/viewer/index.ts +++ b/src/apps/viewer/index.ts @@ -274,6 +274,19 @@ export class Viewer { })); } + loadModelArchive(id: string) { + const params = DownloadStructure.createDefaultParams(this.plugin.state.data.root.obj!, this.plugin); + return this.plugin.runTask(this.plugin.state.data.applyAction(DownloadStructure, { + source: { + name: 'modelarchive' as const, + params: { + id, + options: params.source.params.options, + } + } + })); + } + /** * @example Load X-ray density from volume server viewer.loadVolumeFromUrl({