Skip to content

Latest commit

 

History

History
113 lines (78 loc) · 3.93 KB

README.md

File metadata and controls

113 lines (78 loc) · 3.93 KB

CoordinateServer

About

CoordinateServer is a fast, web-based tool for querying a subset of mmCIF coordinate data for a PDB entry held in the PDB archive. The server is able to return the specific portions of the structure that are relevant, as specified in your query. For example, the coordinates of the atoms within a 5Å radius around the ligand binding site, including symmetry mates. As a result, it greatly reduces the time needed to transmit and manipulate the data.

The application is written in TypeScript on top of the LiteMol and CIFTools.js libraries.

There is an instance of the server at the WebChem and PDBe.

Running the Server

The server currently only works on mmCIF files.

  • Install Node.js (tested on Node 6.* and 7.*; x64 version is strongly preferred).

  • Get the code:

    git clone https://github.com/dsehnal/CoordinateServer.git
    

    or download it as ZIP. No building is required, only the build folder and the package.json file in the archive are needed.

  • "cd CoordinateServer"

  • Install production dependencies:

    npm install --only=production
    
  • Update build/server-config.js to link to your data and optionally tweak the other parameters.

    • Edit the appPrefix. This determines the prefix of the server after the domain name, for example appPrefix: 'CoordinateServer' => http://localhost:PORT/CoordinateServer.
    • Map to your mmCIF files.
    • Setup cache.
    • Setup server restarts (this requires forever.js or a similar tool to work). This is because of a flaw in Node.js/v8.
  • Run it:

    node build/server
    

    The server will then be running on http://localhost:PORT/APP_PREFIX, where PORT and APP_PREFIX are specified in build/ServerConfig.js. The default page will show documentation for the available queries.

    In production it is a good idea to use a service that will keep the server running, such as forever.js.

    Depending on the use case of the server, it might be a good idea to enable response caching on your server (for example Apache's mod_cache and mod_cache_disk).

Command Line Mode

Create one or more jobs.json files (refer to examplejobs.json for the template or see below) and run

node build/local jobs.json

It is recommended that you split queries of larger data sets into jobs that contain no more than 10000 entities.

Job entry template

The jobs.json file needs with specify a list of jobs using this template:

[{
    "inputFilename": "./data/1cbs.cif",
    "outputFilename": "./result/ligandInteraction/1cbs.bcif",
    "query": "ligandInteraction", 
    "params": {
        "name": "REA",
        "atomSitesOnly": "1",
        "encoding": "bcif"
    }
},
...
]

The values for query are the same as the names of the queries in the WebAPI. The param names in params are the same as well. For the available queries refer to the API reference or the default page of the CoordinateServer service.

Building

  • Get the code:

    git clone https://github.com/dsehnal/CoordinateServer.git
    
  • Install dependencies:

    cd CoordinateServer
    npm install gulp -g
    npm install
    
  • Build:

    gulp
    

License

This project is licensed under the Apache 2.0 license. See the LICENSE file for more info.