This application allows server-side conversion of a DNA map to an SVG file using the CircularView component from Teselagen's Open Vector Editor (OVE). It is integrated in BenchBaze.
An Express server renders the CircularView React component to an HTML string via ReactDOMServer.renderToString, extracts the <svg> element, and serves it as a downloadable file.
- Install dependencies:
yarn install- Build the app
yarn build- Optionally, start the development server for testing:
yarn startThe server listens on port 3000 by default.
Send a GET request with the following query parameters:
| Parameter | Required | Description |
|---|---|---|
path |
Yes | Path to the DNA map file to render (.gbk, .gb, or .dna) |
title |
No | Name used for the plasmid and the downloaded filename (defaults to plasmid) |
Supported file formats: GenBank (.gb, .gbk) and SnapGene (.dna).
Example
curl http://localhost:3000/?path=src/pHU6066.gbk&title=pHU6066The response is an SVG file downloaded as <title>.html.
| Status | Cause |
|---|---|
| 400 | path parameter missing or file extension not supported |
| 404 | File not found at the given path |
| 500 | Parse failure or render error (response body contains the specific error message) |
The server can be run as a systemd service directly or via PM2 (which may offer some advantages)
Directly
node ${BENCHBAZE_HOME}/collection/shared/map_dna/svg_converter/build/server.jssystemd unit file
[Unit]
Description=DNA-Map-to-SVG converter for BenchBaze
After=syslog.target network-online.target
[Service]
ExecStart=${NODE_BIN}/node ${BENCHBAZE_HOME}/collection/shared/map_dna/svg_converter/build/server.js
Type=exec
User=www-data
Group=www-data
[Install]
WantedBy=multi-user.targetPM2
npx pm2 start ${BENCHBAZE_HOME}/collection/shared/map_dna/svg_converter/build/server.js --name "map-dna-svg-converter"To make PM2 restore the process automatically after a server reboot:
npx pm2 save # snapshot the current process list
npx pm2 startup # install a systemd unit to restore the snapshot on bootpm2 startup prints a sudo command — copy and run it to complete the setup. If you later change which processes should autostart, run pm2 save again.
- Features whose names match
synthetic dna construct,recombinant plasmid, orsourceand that span the full plasmid length are automatically excluded from the map. - The rendered view shows features, parts, and axis numbers; translations, ORFs, cut sites, primers, and the sequence itself are hidden.