From 04b4ebcbb9dd56cbe443a7e03e66126018362c80 Mon Sep 17 00:00:00 2001 From: ppillot Date: Sun, 23 Jun 2024 15:24:36 +0200 Subject: [PATCH 1/2] PDBe: mmtf not supported default to binary cif when no extension provided --- src/datasource/pdbe-datasource.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datasource/pdbe-datasource.ts b/src/datasource/pdbe-datasource.ts index 8da1d7f0..b8a10718 100644 --- a/src/datasource/pdbe-datasource.ts +++ b/src/datasource/pdbe-datasource.ts @@ -49,7 +49,7 @@ class PDBeDatasource extends Datasource { getExt (src: string) { const ext = getFileInfo(src).ext - return ext ? ext : 'mmtf' + return ext ? ext : 'bcif' } } From 8484421b95de462d279c984b3755c21d27228f91 Mon Sep 17 00:00:00 2001 From: ppillot Date: Sun, 23 Jun 2024 17:35:17 +0200 Subject: [PATCH 2/2] rcsb provider: remove mmtf support, always use https RCSB redirects calls from http to https, but the redirection is not handled by the Streamer code. MMTF support has now been removed from RCSB. Default to bfic for compatibility and log warnings. --- src/datasource/rcsb-datasource.ts | 34 +++++++++++++------------------ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/datasource/rcsb-datasource.ts b/src/datasource/rcsb-datasource.ts index ff1082a5..e753511a 100644 --- a/src/datasource/rcsb-datasource.ts +++ b/src/datasource/rcsb-datasource.ts @@ -5,15 +5,12 @@ */ import { Log, DatasourceRegistry } from '../globals' -import { getProtocol } from '../utils' import { getFileInfo } from '../loader/loader-utils' import Datasource from './datasource' const baseUrl = '//files.rcsb.org/download/' -const mmtfBaseUrl = '//mmtf.rcsb.org/v1.0/' -const mmtfFullUrl = mmtfBaseUrl + 'full/' -const mmtfReducedUrl = mmtfBaseUrl + 'reduced/' const bcifBaseUrl = '//models.rcsb.org/' +const protocol = 'https:' class RcsbDatasource extends Datasource { getUrl (src: string) { @@ -22,35 +19,32 @@ class RcsbDatasource extends Datasource { // XXXX defaults to XXXX.cif const info = getFileInfo(src) const pdbid = info.name.indexOf('_') > -1 ? info.name : info.name.substring(0, 4) // Allow extended pdb codes and alphafold codes - let url if ([ 'pdb', 'cif' ].includes(info.ext) && (info.compressed === false || info.compressed === 'gz') ) { - url = baseUrl + info.path - } else if (info.ext === 'mmtf') { - Log.warn('MMTF files distribution is discontinued by RCSB PDB as of July 2, 2024.\n Consider using bcif format instead. See https://www.rcsb.org/news/65a1af31c76ca3abcc925d0c for the deprecation notice') + return protocol + baseUrl + info.path + } + + if (info.ext === 'mmtf') { + Log.warn('MMTF files distribution has been discontinued by RCSB PDB as of July 2024.\n Defaulting to bcif format instead. See https://www.rcsb.org/news/65a1af31c76ca3abcc925d0c for the deprecation notice') if (info.base.endsWith('.bb')) { - url = mmtfReducedUrl + pdbid - } else { - url = mmtfFullUrl + pdbid + Log.warn('Backbone only files are not available from RCSB PDB anymore.') } - } else if (info.ext === 'bcif' && - (info.compressed === false || info.compressed === 'gz') - ) { - url = bcifBaseUrl + info.path - } else if (!info.ext) { + info.ext = '' + } + + if (!info.ext) { Log.warn('mmCif files available from RCSB PDB lack connectivity information.\n Consider using PDBe as the data provider for using "Updated mmCif files" that contain residues connectivity records.') - url = bcifBaseUrl + pdbid + '.bcif.gz' } else { Log.warn('unsupported ext', info.ext) - url = bcifBaseUrl + pdbid + '.bcif.gz' } - return getProtocol() + url + + return protocol + bcifBaseUrl + pdbid + '.bcif.gz' } getExt (src: string) { const ext = getFileInfo(src).ext - return ext ? ext : 'mmtf' + return ext ? ext : 'bcif' } }