Skip to main content

CLI tool to illustrate plasmids with a structure described by json.

Project description

Plasmid_render

CLI tool to illustrate plasmids with a structure described by json.

Example Image

This program is a CLI tool that can describe the plasmid structure in json and output it as an image in SVG format.

The output is in vector format, so there is no possibility of poor quality images being output.

Usage

Prerequisites

  • Python3

Download

Download the code with git clone.

git clone https://github.com/strelka145/Plasmid_render.git
cd Plasmid_render

Json file notation

Example Image

If you want to draw a plasmid like the one shown in the figure, you can write a json like this.

[
  {"type":"arrow","angle":"10","label":"primer","color":"black"},
  {"type":"space","angle":"10"},
  {"type":"tag","angle":"45","label":"EGFP","color":"green"},
  {"type":"space","angle":"10"},
  {"type":"arrow","angle":"-10","label":"primer","color":"black"},
  {"type":"space","angle":"20"},
  {"type":"tag","angle":"60","label":"RFP","color":"red"},
  {"type":"tag","angle":"60","label":"BFP","color":"#1E90FF"},
  {"type":"space","angle":"30"},
  {"type":"line","angle":"45","label":"BamHI","color":"black"}
]

type
If the value of type is "tag", a annular sector is drawn; if it is "space", nothing is drawn and a space is opened at the angle specified by angle.
If space is not described between tag as shown between RFP and BFP in the example of json, {"type":"space","angle":"5"} is automatically inserted. If you do not want gaps between the annular sectors, write {"type": "space", "angle": "0"}.

angle
Central angle of an annular sector or a gap. Specify the value using the degree method, NOT the radian method.

label
Text of an annular sector.

color
Color of an annular sector.

SVG output from json files

python3 main.py -i (Path of input json file) --output_svg_file (Path of output svg file)

SVG output from json string

python3 main.py --input_json (json code) --output_svg_file (Path of output svg file)

Output as png format

python3 main.py -i (Path of input json file) --output_png_file (Path of output png file)

Future

  • To be able to change the text style
  • Allow the hight of a annular sector to be changed
  • Allow adjustable line thickness

More future

  • Restriction Enzyme Indication
  • Show primer
  • Show translation direction

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plasmidrender-1.1.6.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plasmidrender-1.1.6-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file plasmidrender-1.1.6.tar.gz.

File metadata

  • Download URL: plasmidrender-1.1.6.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for plasmidrender-1.1.6.tar.gz
Algorithm Hash digest
SHA256 c50be52a1c581214a76a968bce248c830f11a2fd60759624395f1fc08fd07fd5
MD5 7ba7f052b94e4560ec11fb4d05f4c6af
BLAKE2b-256 3c84ec60d7bac3fabf7028032a65efbd60f89dd1418fba1a9875c22be97fa692

See more details on using hashes here.

File details

Details for the file plasmidrender-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: plasmidrender-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for plasmidrender-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d0230a7a098b3506baa5b7dab6bdfb2186af54ad4794927b69e5385847c45b13
MD5 299edcd31018163e4fb93c9a2ad6c5f6
BLAKE2b-256 02b60df04d85a5d893ce9fa97975e0447d06b7bdf206bac39711d75f4217a8b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page