Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:PDB-REDO/alphafill into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Jan 14, 2025
2 parents 50ec255 + d9b9be5 commit 565f28f
Show file tree
Hide file tree
Showing 10 changed files with 3,325 additions and 3,002 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ docs/conf.py
new-alphafill.conf
docroot/_sources/
docroot/_static/
docroot/dist/
docroot/.doctrees/
docroot/.buildinfo
docroot/**/index.html
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cmake_minimum_required(VERSION 3.21)
# set the project name
project(
alphafill
VERSION 2.1.1
VERSION 2.2.0
LANGUAGES C CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
Expand Down Expand Up @@ -132,7 +132,7 @@ if(NOT zeep_FOUND)
FetchContent_Declare(
zeep
GIT_REPOSITORY https://github.com/mhekkel/libzeep.git
GIT_TAG v6.0.11)
GIT_TAG v6.0.16)
FetchContent_MakeAvailable(zeep)
endif()

Expand Down
3 changes: 3 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 2.2.0
- Added support for

Version 2.1.1
- Fix a bug that caused too many residues being placed where
they are not unique.
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@babel/runtime-corejs3": "^7.16.0",
"bootstrap": "^5.1.3",
"core-js": "^3.19.1",
"molstar": "^2.3.5"
"gyp": "^0.5.0",
"molstar": "^4.10.0"
},
"scripts": {
"build": "webpack --config webpack.config.js",
Expand All @@ -21,17 +22,21 @@
"@babel/preset-env": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@popperjs/core": "^2.10.2",
"babel-loader": "^8.2.3",
"babel-loader": "^9.2.1",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.5.0",
"css-loader": "^7.1.2",
"mini-css-extract-plugin": "^2.4.3",
"postcss": "^8.4.49",
"postcss-loader": "^8.1.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sass": "^1.43.4",
"sass-loader": "^12.3.0",
"sass-loader": "^16.0.4",
"terser-webpack-plugin": "^5.2.5",
"ts-loader": "^9.2.6",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^5.60.0",
"webpack-cli": "^4.9.1"
"webpack-cli": "^6.0.1"
},
"babel": {
"presets": [
Expand Down
5 changes: 5 additions & 0 deletions src/alphafill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,11 @@ zeep::json::element alphafill(cif::datablock &db, const std::vector<PAE_matrix>
auto entity_id = af_structure.create_non_poly_entity(comp_id);
auto asym_id = af_structure.create_non_poly(entity_id, res.atoms());

// Hack to get better molstar rendering
auto &rres = af_structure.get_residue(asym_id);
for (auto &atom : rres.atoms())
atom.set_property("label_alt_id", asym_id);

auto &hsp_t = r_hsp["transplants"].emplace_back(json{
{ "compound_id", comp_id },
// {"entity_id", entity_id},
Expand Down
2 changes: 1 addition & 1 deletion src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ int server_main(int argc, char *const argv[])
if (config.has("no-daemon"))
result = server.run_foreground(address, port);
else
result = server.start(address, port, 1, 16, user);
result = server.start(address, port, 16, user);
}
else if (command == "stop")
result = server.stop();
Expand Down
32 changes: 0 additions & 32 deletions webapp/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,36 +101,4 @@ window.addEventListener('load', () => {

window.location = `v1/aff/${AF_ID}/stripped/${selected.join(',')}/${IDENTITY}`;
});

// // Update PAE matrices
// const cv = [...document.querySelectorAll("td.pae-matrix canvas")];
// cv.forEach(c => {
// const ctx = c.getContext("2d");

// const pae = JSON.parse(c.getAttribute("data-pae"));

// const dim = Math.sqrt(pae.length);
// const scale = 32.0 / dim;

// ctx.scale(scale, scale);

// let i = 0;
// for (let x = 0; x < dim; ++x)
// {
// for (let y = 0; y < dim; ++y)
// {
// const v = 1.0 * pae[i];
// i += 1;

// console.log(v);

// const clr = `hsl(220,60%,${Math.round(25 + 50 * (v / 32.0))}%)`;

// ctx.fillStyle = clr;
// ctx.fillRect(x, y, 1, 1);
// }
// }
// });


})
54 changes: 35 additions & 19 deletions webapp/molstar.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
import "core-js/stable";
import 'molstar/build/viewer/molstar.css';
import { StructureSelection } from "molstar/lib/mol-model/structure";
import { createPlugin } from 'molstar/lib/mol-plugin-ui';
import { createPluginUI } from 'molstar/lib/mol-plugin-ui';
import { PluginUIContext } from 'molstar/lib/mol-plugin-ui/context';
import { DefaultPluginUISpec } from 'molstar/lib/mol-plugin-ui/spec';
import { DefaultPluginUISpec, PluginUISpec } from 'molstar/lib/mol-plugin-ui/spec';
import { Script } from "molstar/lib/mol-script/script";
import { Asset } from 'molstar/lib/mol-util/assets';
import { PluginConfig } from "molstar/lib/mol-plugin/config";
import { renderReact18 } from 'molstar/lib/mol-plugin-ui/react18';
import "regenerator-runtime/runtime";

export { PLUGIN_VERSION as version } from 'molstar/lib/mol-plugin/version';
export { setDebugMode, setProductionMode } from 'molstar/lib/mol-util/debug';

const AlphaFillMolstarSpec: PluginUISpec = {
...DefaultPluginUISpec(),
config: [
[PluginConfig.VolumeStreaming.Enabled, false],
],
layout: {
initial: {
isExpanded: false,
showControls: false
}
},
components: {
remoteState: 'none'
}

}

export class Viewer {
plugin: PluginUIContext

constructor(element: HTMLElement) {
this.plugin = createPlugin(element, {
...DefaultPluginUISpec(),
layout: {
initial: {
isExpanded: false,
showControls: false
}
},
components: {
remoteState: 'none'
}
this.createPlugin(element);
}

async createPlugin(element: HTMLElement) {
this.plugin = await createPluginUI({
target: element,
spec: AlphaFillMolstarSpec,
render: renderReact18
});
}

Expand All @@ -35,16 +51,16 @@ export class Viewer {

const data = await this.plugin.builders.data.rawData({ data: model }, { state: { isGhost: true } });
const trajectory = await this.plugin.builders.structure.parseTrajectory(data, 'mmcif');

await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default', {
structure: {
name: 'model',
params: { }
params: {}
},
showUnitcell: false,
representationPreset: 'auto'
});
});
});
}

loadStructureFromUrl(url: string) {
Expand All @@ -53,16 +69,16 @@ export class Viewer {

const data = await this.plugin.builders.data.download({ url: Asset.Url(url), isBinary: false }, { state: { isGhost: true } });
const trajectory = await this.plugin.builders.structure.parseTrajectory(data, 'mmcif');

await this.plugin.builders.structure.hierarchy.applyPreset(trajectory, 'default', {
structure: {
name: 'model',
params: { }
params: {}
},
showUnitcell: false,
representationPreset: 'auto'
});
});
});
}

handleResize() {
Expand Down
Loading

0 comments on commit 565f28f

Please sign in to comment.