sbol_utilities.conversion

Module Contents

Functions

command_line_converter(args_dict: Dict[str, Any])

Run conversions from the command line by first reading/converting input to SBOL3, then writing/converting output

convert2to3(sbol2_doc: Union[str, sbol2.Document], namespaces=None) → sbol3.Document

Convert an SBOL2 document to an equivalent SBOL3 document

convert3to2(doc3: sbol3.Document) → sbol2.Document

Convert an SBOL3 document to an equivalent SBOL2 document

convert_from_fasta(path: str, namespace: str, identity_map: Dict[str, str] = None) → sbol3.Document

Convert a FASTA nucleotide document on disk into an SBOL3 document

convert_from_genbank(path: str, namespace: str, allow_genbank_online: bool = False, force_new_converter: bool = False) → sbol3.Document

Convert a GenBank document on disk into an SBOL3 document

convert_identities2to3(sbol3_data: str) → str

Convert SBOL2 identities into SBOL3 identities.

convert_to_fasta(doc3: sbol3.Document, path: str) → None

Convert an SBOL3 document to a FASTA file, which is written to disk

convert_to_genbank(doc3: sbol3.Document, path: str, allow_genbank_online: bool = False, force_new_converter: bool = False) → List[Bio.SeqRecord.SeqRecord]

Convert an SBOL3 document to a GenBank file, which is written to disk

fasta2sbol()

Convert a FASTA file to an SBOL3 file

genbank2sbol()

Convert a GenBank file to an SBOL3 file

main()

Main wrapper: read from input file, invoke conversion based on type, then write to output file

sbol2fasta()

Convert an SBOL3 file to a FASTA file

sbol2genbank()

Convert an SBOL3 file to a GenBank file

sbol2to3()

Convert an SBOL2 file to an SBOL3 file

sbol3to2()

Convert an SBOL3 file to an SBOL2 file

Attributes

SBOLGRAPH

SBOLGRAPH
command_line_converter(args_dict: Dict[str, Any])

Run conversions from the command line by first reading/converting input to SBOL3, then writing/converting output

Parameters

args_dict – Parsed command line arguments

Returns

None

convert2to3(sbol2_doc: Union[str, sbol2.Document], namespaces=None) sbol3.Document

Convert an SBOL2 document to an equivalent SBOL3 document

Parameters
  • sbol2_doc – Document to convert

  • namespaces – list of URI prefixes to treat as namespaces

Returns

equivalent SBOL3 document

convert3to2(doc3: sbol3.Document) sbol2.Document

Convert an SBOL3 document to an equivalent SBOL2 document

Parameters

doc3 – Document to convert

Returns

equivalent SBOL2 document

convert_from_fasta(path: str, namespace: str, identity_map: Dict[str, str] = None) sbol3.Document

Convert a FASTA nucleotide document on disk into an SBOL3 document Specifically, every sequence in the FASTA will be converted into an SBOL Component and associated Sequence

Parameters
  • path – path to read FASTA file from

  • namespace – URIs of Components will be set to {namespace}/{fasta_id}

  • identity_map – dictionary mapping from displayId to identity, using for getting non-default namespaces

Returns

SBOL3 document containing converted materials

convert_from_genbank(path: str, namespace: str, allow_genbank_online: bool = False, force_new_converter: bool = False) sbol3.Document

Convert a GenBank document on disk into an SBOL3 document Specifically, the GenBank document is first imported to SBOL2, then converted from SBOL2 to SBOL3

Parameters
  • path – path to read GenBank file from

  • namespace – URIs of Components will be set to {namespace}/{genbank_id}

  • allow_genbank_online – Use the online converter, rather than the local converter

Returns

SBOL3 document containing converted materials

convert_identities2to3(sbol3_data: str) str

Convert SBOL2 identities into SBOL3 identities.

Takes RDF-XML data as a string, converts all SBOL2 identities into SBOL3 identities, and returns RDF-XML as a string.

convert_to_fasta(doc3: sbol3.Document, path: str) None

Convert an SBOL3 document to a FASTA file, which is written to disk Specifically, every Component with precisely one sequence of a nucleic acid type will result in a FASTA entry Components will no sequences will be silently omitted; those with multiple will result in a warning

Parameters
  • doc3 – SBOL3 document to convert

  • path – path to write FASTA file to

convert_to_genbank(doc3: sbol3.Document, path: str, allow_genbank_online: bool = False, force_new_converter: bool = False) List[Bio.SeqRecord.SeqRecord]

Convert an SBOL3 document to a GenBank file, which is written to disk Note that for compatibility with version control software, if no prov:modified term is available on each Component, then a fixed bogus datestamp of January 1, 2000 is given

Parameters
  • doc3 – SBOL3 document to convert

  • path – path to write GenBank file to

  • allow_genbank_online – use the online converter rather than the local converter

Returns

BioPython SeqRecord of the GenBank that was written

fasta2sbol()

Convert a FASTA file to an SBOL3 file

genbank2sbol()

Convert a GenBank file to an SBOL3 file

main()

Main wrapper: read from input file, invoke conversion based on type, then write to output file

sbol2fasta()

Convert an SBOL3 file to a FASTA file

sbol2genbank()

Convert an SBOL3 file to a GenBank file

sbol2to3()

Convert an SBOL2 file to an SBOL3 file

sbol3to2()

Convert an SBOL3 file to an SBOL2 file