Skip to content
Snippets Groups Projects
Commit 06bf2c39 authored by Alexander Rose's avatar Alexander Rose
Browse files

add pdb-dev download bcif encoding

parent 66a23bc2
No related branches found
No related tags found
No related merge requests found
......@@ -150,7 +150,10 @@ export class Viewer {
source: {
name: 'pdb-dev' as const,
params: {
provider: {
id: pdbDev,
encoding: 'bcif',
},
options: params.source.params.options,
}
}
......
......@@ -32,7 +32,7 @@ export const PdbDownloadProvider = {
encoding: PD.Select('bcif', [['cif', 'cif'], ['bcif', 'bcif']] as ['cif' | 'bcif', string][]),
}, { label: 'RCSB PDB', isFlat: true }),
'pdbe': PD.Group({
variant: PD.Select('updated-bcif', [['updated-bcif', 'Updated (bcif)'], ['updated', 'Updated'], ['archival', 'Archival']] as ['updated' | 'archival', string][]),
variant: PD.Select('updated-bcif', [['updated-bcif', 'Updated (bcif)'], ['updated', 'Updated'], ['archival', 'Archival']] as ['updated' | 'updtaed-bcif' | 'archival', string][]),
}, { label: 'PDBe', isFlat: true }),
};
export type PdbDownloadProvider = keyof typeof PdbDownloadProvider;
......@@ -55,7 +55,10 @@ const DownloadStructure = StateAction.build({
options
}, { isFlat: true, label: 'PDB' }),
'pdb-dev': PD.Group({
provider: PD.Group({
id: PD.Text('PDBDEV_00000001', { label: 'PDBDev Id(s)', description: 'One or more comma/space separated ids.' }),
encoding: PD.Select('bcif', [['cif', 'cif'], ['bcif', 'bcif']] as ['cif' | 'bcif', string][]),
}, { pivot: 'id' }),
options
}, { isFlat: true, label: 'PDBDEV' }),
'bcif-static': PD.Group({
......@@ -104,13 +107,15 @@ const DownloadStructure = StateAction.build({
asTrajectory = !!src.params.options.asTrajectory;
break;
case 'pdb-dev':
downloadParams = getDownloadParams(src.params.id,
downloadParams = getDownloadParams(src.params.provider.id,
id => {
const nId = id.toUpperCase().startsWith('PDBDEV_') ? id : `PDBDEV_${id.padStart(8, '0')}`;
return `https://pdb-dev.wwpdb.org/cif/${nId.toUpperCase()}.cif`;
return src.params.provider.encoding === 'bcif'
? `https://pdb-dev.wwpdb.org/bcif/${nId.toUpperCase()}.bcif`
: `https://pdb-dev.wwpdb.org/cif/${nId.toUpperCase()}.cif`;
},
id => id.toUpperCase().startsWith('PDBDEV_') ? id : `PDBDEV_${id.padStart(8, '0')}`,
false
src.params.provider.encoding === 'bcif'
);
asTrajectory = !!src.params.options.asTrajectory;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment