Переглянути джерело

add ModelArchive to DownloadStructure action

Alexander Rose 3 роки тому
батько
коміт
694261c19c
2 змінених файлів з 10 додано та 0 видалено
  1. 1 0
      CHANGELOG.md
  2. 9 0
      src/mol-plugin-state/actions/structure.ts

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@ Note that since we don't clearly distinguish between a public and private interf
     - If there are session files (.molx or .molj) among the dropped files, only the first session will be loaded
 - Add ``PluginConfig.Structure.DefaultRepresentationPreset``
 - Add ModelArchive schema extensions (e.g., AlphaFold uses it for the pLDDT score)
+- Add ModelArchive option in DownloadStructure action
 - Improve support for loading AlphaFold structures
     - Automatic coloring by pLDDT
     - AlphaFold DB option in DownloadStructure action

+ 9 - 0
src/mol-plugin-state/actions/structure.ts

@@ -74,6 +74,10 @@ const DownloadStructure = StateAction.build({
                     id: PD.Text('Q8W3K0', { label: 'UniProtKB AC(s)', description: 'One or more comma/space separated ACs.' }),
                     options
                 }, { isFlat: true, label: 'AlphaFold DB', description: 'Loads the predicted model if available' }),
+                'modelarchive': PD.Group({
+                    id: PD.Text('ma-bak-cepc-0003', { label: 'Accession Code(s)', description: 'One or more comma/space separated ACs.' }),
+                    options
+                }, { isFlat: true, label: 'Model Archive' }),
                 'pubchem': PD.Group({
                     id: PD.Text('2244,2245', { label: 'PubChem ID', description: 'One or more comma/space separated IDs.' }),
                     options
@@ -140,6 +144,11 @@ const DownloadStructure = StateAction.build({
             asTrajectory = !!src.params.options.asTrajectory;
             format = 'mmcif';
             break;
+        case 'modelarchive':
+            downloadParams = await getDownloadParams(src.params.id, id => `https://www.modelarchive.org/doi/10.5452/${id.toLowerCase()}.cif`, id => `Model Archive: ${id}`, false);
+            asTrajectory = !!src.params.options.asTrajectory;
+            format = 'mmcif';
+            break;
         case 'pubchem':
             downloadParams = await getDownloadParams(src.params.id, id => `https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/CID/${id.trim()}/record/SDF/?record_type=3d`, id => `PubChem: ${id}`, false);
             asTrajectory = !!src.params.options.asTrajectory;