Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use CIF format instead of discontinued MMTF #548

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const galleryPanels = [
</>
),
image: '4TNW',
value: 'mmtf:4TNW',
value: 'cif:4TNW',
query: 'p=macro&c=SQ&v=1xQCuQgIrbUHD9arAmmsnPIj8NL/mF6u%2Bx26BPg%3D%3D',
},
];
Expand Down
2 changes: 1 addition & 1 deletion packages/miew/demo/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h3 class="panel-title">Gallery</h3>
<div class="caption text-center">5B40 <small>(11.8k)</small></div>
</a>
</div>
<div class="col-xs-6 col-sm-4" data-toggle="preset-pdb" data-value="mmtf:4TNW" data-query="p=macro&c=SQ&v=1xQCuQgIrbUHD9arAmmsnPIj8NL/mF6u%2Bx26BPg%3D%3D">
<div class="col-xs-6 col-sm-4" data-toggle="preset-pdb" data-value="cif:4TNW" data-query="p=macro&c=SQ&v=1xQCuQgIrbUHD9arAmmsnPIj8NL/mF6u%2Bx26BPg%3D%3D">
<a href="#" class="thumbnail">
<img src="images/4TNW.png">
<div class="caption text-center">4TNW <small>(30.4k)</small></div>
Expand Down
4 changes: 2 additions & 2 deletions packages/miew/docs/Thumbnails.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you decide to update the thumbnails, here are the instructions.

1. Use the following URL Query String to see 1AID file from the fixed viewpoint.

?l=mmtf:1AID&r=0&m=VW&s=not+water&c=CF&v=18KeRwuF6IsJGtmPAs%2B8XPZrOGD9xy0I/ku/APQ==&fogFarFactor=0.4&fogNearFactor=0&axes=false&fxaa=false&ao=true
?l=cif:1AID&r=0&m=VW&s=not+water&c=CF&v=18KeRwuF6IsJGtmPAs%2B8XPZrOGD9xy0I/ku/APQ==&fogFarFactor=0.4&fogNearFactor=0&axes=false&fxaa=false&ao=true

2. Select the desired coloring.
3. Open the terminal window and take a 512 &times; 512 screenshot.
Expand Down Expand Up @@ -63,7 +63,7 @@ If you decide to update the thumbnails, here are the instructions.

1. Use the following URL Query String to see Glycine from the fixed viewpoint.

?l=mmtf:1CRN&p=macro&s=sequence+22:34&r=1&s=sequence+2:3&v=1bjwPwW3%2BQsFuFMbA1kUQPpO4Wj8/v1K/zsjhPg%3D%3D&bg.color=0xCCCCCC&axes=false&fog=false
?l=cif:1CRN&p=macro&s=sequence+22:34&r=1&s=sequence+2:3&v=1bjwPwW3%2BQsFuFMbA1kUQPpO4Wj8/v1K/zsjhPg%3D%3D&bg.color=0xCCCCCC&axes=false&fog=false


2. Select the desired palette.
Expand Down
6 changes: 3 additions & 3 deletions packages/miew/docs/getting-started-for-dummies.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ is found in more than ten coordinate files, including 1CRN, 1EJG, 3NIR, and so o
The primary format used in the protein bank is text [PDB][], but it has its
limitations in terms of the number of atoms and residues. As a result, it has
been replaced by the more verbose [CIF][] and binary
[MMTF][]. To load data directly from the bank, Miew supports using the unique
identifier (`1CRN`) and a format specifier (`cif:1CRN`, `mmtf:1CRN`).
[BCIF][]. To load data directly from the bank, Miew supports using the unique
identifier (`1CRN`) and a format specifier (`cif:1CRN`, `pdb:1CRN`).

Small molecules can be found in various formats such as [MOL/SDF][], CML, or
others. The [PubChem][] site is the primary source for coordinate files of common
Expand All @@ -155,7 +155,7 @@ data types, such as loading 3D geometry in widely used formats.
[4V88]: https://www.rcsb.org/structure/4v88
[PDB]: http://www.wwpdb.org/documentation/file-format-content/format33/v3.3.html
[CIF]: http://mmcif.wwpdb.org/
[MMTF]: https://mmtf.rcsb.org/
[BCIF]: https://github.com/molstar/BinaryCIF
[MOL/SDF]: http://www.wwpdb.org/documentation/file-format-content/format33/v3.3.html
[PubChem]: https://pubchem.ncbi.nlm.nih.gov/
[aspirin]: https://pubchem.ncbi.nlm.nih.gov/compound/2244
Expand Down
10 changes: 5 additions & 5 deletions packages/miew/docs/tutorials/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Data source:
You may choose a different file source: [`l=cif:4xn6`], [`l=pubchem:serotonin`].

- **t**, **type** = _typeId_
Specify explicit type of the loaded file: [`t=mmtf&l=http://mmtf.rcsb.org/v1.0/full/4xn6`].
Specify explicit type of the loaded file: [`t=cif&l=https://files.rcsb.org/view/4XN6.cif`].
By default, the application determines the data type automatically by the file name (extension) or the
file source used.

Expand Down Expand Up @@ -136,7 +136,7 @@ Visual representation:
[`l=4xn6`]: https://miew.opensource.epam.com/?l=4xn6
[`l=cif:4xn6`]: https://miew.opensource.epam.com/?l=cif:4xn6
[`l=pubchem:serotonin`]:https://miew.opensource.epam.com/?l=pubchem:serotonin
[`t=mmtf&l=http://mmtf.rcsb.org/v1.0/full/4xn6`]: https://miew.opensource.epam.com/?t=mmtf&l=http://mmtf.rcsb.org/v1.0/full/4xn6
[`t=cif&l=https://files.rcsb.org/view/4XN6.cif`]: https://miew.opensource.epam.com/?t=cif&l=https://files.rcsb.org/view/4XN6.cif
[`l=3s95&u=2`]: https://miew.opensource.epam.com/?l=3s95&u=2
[`p=wire`]: https://miew.opensource.epam.com/?p=wire
[`s=residue+ALA,CYS`]: https://miew.opensource.epam.com/?s=residue+ALA,CYS
Expand All @@ -149,13 +149,13 @@ Visual representation:

A complex example follows (whitespaces are for better readability):

[l=mmtf:1rx1 &
[l=cif:1rx1 &
s=not+hetatm & m=CA & c=SS &
s=hetatm+and+not+water & m=LC & c=EL &
s=sequence+6:7,17:19,43:45,62:64,77,95:99 & m=CS & mt=PL &
bg.color=0xCCCCCC](https://miew.opensource.epam.com/?l=mmtf:1rx1&s=not+hetatm&m=CA&c=SS&s=hetatm+and+not+water&m=LC&c=EL&s=sequence+6:7,17:19,43:45,62:64,77,95:99&m=CS&mt=PL&bg.color=0xCCCCCC)
bg.color=0xCCCCCC](https://miew.opensource.epam.com/?l=cif:1rx1&s=not+hetatm&m=CA&c=SS&s=hetatm+and+not+water&m=LC&c=EL&s=sequence+6:7,17:19,43:45,62:64,77,95:99&m=CS&mt=PL&bg.color=0xCCCCCC)

- load 1RX1 in mmtf format;
- load 1RX1 in cif format;
- select "`not hetatm`", set Cartoon mode with Secondary Structure coloring;
- select "`hetatm and not water`", set Licorice mode with coloring by Element;
- select residues by their sequential numbers, set Contact Surface mode with the previous coloring (by Element)
Expand Down
2 changes: 1 addition & 1 deletion packages/miew/examples/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Use API to control the Miew</h1>
<div style="padding-top: 0.5em">
<button id="rotation">Toggle Rotation</button>
<button id="axes">Toggle Axes</button>
<button id="load-4xn6">Load 4XN6.mmtf</button>
<button id="load-4xn6">Load 4XN6.cif</button>
<button id="licorice">Licorice</button>
<button id="metallic">Metallic</button>
<button id="load-2hhb">Load 2HHB + setup</button>
Expand Down
2 changes: 1 addition & 1 deletion packages/miew/examples/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

document.getElementById('load-4xn6').addEventListener('click', function () {
viewer.unload();
viewer.load('mmtf:4XN6');
viewer.load('cif:4XN6');
});

document.getElementById('licorice').addEventListener('click', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/miew/examples/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>Using events in Miew</h1>
<div class="miew-container" style="width:640px; height:480px; position:relative;"></div>

<div style="padding-top: 0.5em">
<button id="load-4xn6">Load 4XN6.mmtf</button>
<button id="load-4xn6">Load 4XN6.cif</button>
<button id="load-1crn">Load 1CRN.pdb</button>
<button id="repAdd">Create new rep from selection</button>
<input type="checkbox" id="aoChange">
Expand Down
2 changes: 1 addition & 1 deletion packages/miew/examples/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

document.getElementById('load-4xn6').addEventListener('click', function () {
viewer.load('mmtf:4XN6');
viewer.load('cif:4XN6');
});

document.getElementById('load-1crn').addEventListener('click', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/miew/examples/multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h1 style="text-align: center;">Create multiple viewers on a page</h1>
<div>
<div class="miew-container" style="width:512px; height:512px; float:left" data-miew="load=1CRN"></div>
<div class="miew-container" style="width:512px; height:512px; float:right" data-miew="load=mmtf:1CRN"></div>
<div class="miew-container" style="width:512px; height:512px; float:right" data-miew="load=cif:1CRN"></div>
<div style="clear: both"></div>
</div>

Expand Down
7 changes: 2 additions & 5 deletions packages/miew/src/Miew.js
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ Miew.prototype._export = function (format) {
return Promise.reject(new Error('Unexpected format of data'));
};

const rePdbId = /^(?:(pdb|cif|mmtf|ccp4|dsn6):\s*)?(\d[a-z\d]{3})$/i;
const rePdbId = /^(?:(pdb|cif|ccp4|dsn6):\s*)?(\d[a-z\d]{3})$/i;
const rePubchem = /^(?:pc|pubchem):\s*([a-z]+)$/i;
const reUrlScheme = /^([a-z][a-z\d\-+.]*):/i;

Expand All @@ -1760,7 +1760,7 @@ function resolveSourceShortcut(source, opts) {
return source;
}

// e.g. "mmtf:1CRN"
// e.g. "cif:1CRN"
const matchesPdbId = rePdbId.exec(source);
if (matchesPdbId) {
let [, format = 'pdb', id] = matchesPdbId;
Expand All @@ -1775,9 +1775,6 @@ function resolveSourceShortcut(source, opts) {
case 'cif':
source = `https://files.rcsb.org/download/${id}.cif`;
break;
case 'mmtf':
source = `https://mmtf.rcsb.org/v1.0/full/${id}`;
break;
case 'ccp4':
source = `https://www.ebi.ac.uk/pdbe/coordinates/files/${id.toLowerCase()}.ccp4`;
break;
Expand Down
6 changes: 3 additions & 3 deletions packages/miew/src/options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ describe('options', () => {
options: {
view: '1+n4pwTVeI8Erh8LAHI6CPW63vD40uzs/Ne4ovg==',
unit: 1,
load: 'mmtf:1crn',
load: 'cif:1crn',
},
string: 'l=mmtf:1crn&u=1&v=1%2Bn4pwTVeI8Erh8LAHI6CPW63vD40uzs/Ne4ovg%3D%3D',
string: 'l=cif:1crn&u=1&v=1%2Bn4pwTVeI8Erh8LAHI6CPW63vD40uzs/Ne4ovg%3D%3D',
commands: [
'load "mmtf:1crn"',
'load "cif:1crn"',
'unit 1',
'view 1+n4pwTVeI8Erh8LAHI6CPW63vD40uzs/Ne4ovg==',
],
Expand Down
1 change: 0 additions & 1 deletion packages/miew/tools/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
formats = {
'pdb': {'type': '', 'url': 'http://files.rcsb.org/download/%s.pdb.gz', 'postprocess': lambda data: gzip.decompress(data).decode('ascii') },
'cif': {'type': '', 'url': 'http://files.rcsb.org/download/%s.cif.gz', 'postprocess': lambda data: gzip.decompress(data).decode('ascii') },
'mmtf': {'type': 'b', 'url': 'http://mmtf.rcsb.org/v1.0/full/%s', 'postprocess': lambda data: data },
'ccp4': {'type': 'b', 'url': 'https://www.ebi.ac.uk/pdbe/coordinates/files/%s.ccp4', 'postprocess': lambda data: data },
'dsn6': {'type': 'b', 'url': 'https://edmaps.rcsb.org/maps/%s_2fofc.dsn6', 'postprocess': lambda data: data },
'pubchem': {'type': '', 'url': 'https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/%s/JSON?record_type=3d', 'postprocess': lambda data: data.decode('ascii'), 'ext': 'json'},
Expand Down