synbiopython.genbabel.gensbolconv

Synbiopython (c) Global BioFoundry Alliance 2020

Synbiopython is licensed under the MIT License.

This module provides code to work with SBOL validator https://validator.sbolstandard.org/

Use sample sbol file from github (can also be obtained from iBioSim)

Reference:

https://github.com/SynBioDex/SBOL-Validator/blob/master/src/test/sequence1.xml http://synbiodex.github.io/SBOL-Validator/#query-parameters http://synbiodex.github.io/SBOL-Validator/#options http://biopython.org/DIST/docs/tutorial/Tutorial.html (Chapter 17 Graphics)

install:

pip install biopython reportlab

The URI prefix is required for FASTA and GenBank conversion, and optional for SBOL 1 conversion

class synbiopython.genbabel.gensbolconv.GenSBOLconv.GenSBOLconv[source]

Bases: object

Class to convert standard files (SBOL1, SBOL2, GenBank, Fasta, GFF3).

static access_sbolvalidator(input_file, Output, uri_Prefix='')[source]

Code to invoke the SBOL Validator server over the internet.

Parameters
  • input_file (str) – input filename or filepath

  • Output (str, ('GenBank', 'FASTA', 'GFF3', 'SBOL1', 'SBOL2')) – the type of Output file

  • uri_Prefix (str, optional) – ‘’ as default, URI Prefix is required for FASTA and GenBank input conversion

Returns

POST request response from webpage

Return type

object

export_outputfile(input_filename, Response, Output, outputfile=None)[source]

Export the converted output file.

Parameters
  • input_filename (str) – input filename or filepath

  • Response (object) – response from POST request to sbolvalidator web page

  • Output (str, ('GenBank', 'FASTA', 'GFF3', 'SBOL1', 'SBOL2')) – the type of Output file

  • outputfile (str, optional) – provide specific outputfilename or filepath

static export_plasmidmap(gbfile, filename=None)[source]

Export Linear and Circular Plasmid Map for the imported GenBank file.

Parameters
  • gbfile (str) – a genbank file in .gb format or the path the file if not in the same folder.

  • filename (tuple, optional) – the filenames/path to the filenames for the linear and circular plasmids in tuple

Returns

the version from the genbank file

Return type

str

static get_outputfile_extension(Filetype)[source]

Get the output file extension based on the requested output language.

Parameters

Filetype – the type of Output file

Returns

the specific file extension

Return type

str

run_sbolvalidator(Input_file, Output, uri_Prefix='', **kwargs)[source]

Wrapper function for the SBOL Validator.

Parameters
  • Input_file (str, filename or filepath) – input file or path to input file

  • Output (str, ('GenBank', 'FASTA', 'GFF3', 'SBOL1', 'SBOL2')) – the type of Output file

  • uri_Prefix (str, optional) – ‘’ as default, URI Prefix is required for FASTA and GenBank input conversion

Returns

the validity of the Response, and export output file.

Return type

str, “valid: True” if the conversion is done properly

Keyword Arguments
  • outputfile: specify outputfile