How can I create SnapGene map images using the command line?
Ensure SnapGene is not running before you attempt to start the executable from the command line.
To create a map image the input must be a DNA sequence in a SnapGene .dna file.
-createPreview options
-s --size (apparent size in pixels at specified pixels per inch)
-p --ppi (pixel density in pixels per inch. If not specified, SnapGene will use the native monitor ppi setting)
-t --transparent (adds transparency layer, applies to png)
-q --quality (applies to jpg)
-w --no-watermark (don't add the SnapGene watermark)
Create a Single Map
To generate a SnapGene map image in PNG format from the command line, type:
/path/to/SnapGene --createPreview \
--size 1000,1000 \
--ppi 72 \
--transparent
--input ~/Downloads/pUC19.dna \
--output ~/Desktop/test.png
Example Windows:
"%ProgramFiles%"\SnapGene\SnapGene.exe" --createPreview -s 1000,1000 -ppi 72 -i %UserProfile%/Desktop/pUC19.dna -o %UserProfile%/Desktop/pUC19.png
Example macOS:
/Applications/SnapGene.app/Contents/MacOS/SnapGene --createPreview -s 1000,1000 -ppi 72 -i ~/Desktop/pUC19.dna -o ~/Desktop/pUC19.png
Example Ubuntu
/opt/gslbiotech/snapgene/snapgene.sh --createPreview -s 1000,1000 -ppi 72 -i ~/Desktop/pUC19.dna -o ~/Desktop/pUC19.png
To generate a SnapGene map image in JPEG format, replace "png" with "jpg".
Create Maps in Batch
To generate two or more SnapGene map images from the command line, type:
/path/to/SnapGene --createPreview \
--size 300,300 \
--input-list listOfInputFiles.txt \
--output-list listOfOutputFilenames.txt
Configure Map Options
It is possible to configure the image size, quality, resolution and watermark. To see the full set of options, type:
/path/to/SnapGene --help