How to use the bio-parsers.jsonToGenbank function in bio-parsers

To help you get started, we’ve selected a few bio-parsers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TeselaGen / openVectorEditor / src / helperComponents / PropertiesDialog / GenbankView.js View on Github external
render() {
    const { sequenceData = {} } = this.props;
    let filestring;
    switch (this.state.fileTypeToView) {
      case "fasta":
        filestring = jsonToFasta(sequenceData);
        break;
      case "teselagen":
        filestring = JSON.stringify(
          cleanUpTeselagenJsonForExport(sequenceData),
          null,
          4
        );
        break;
      default:
        filestring = jsonToGenbank(sequenceData);
    }

    return (
      <div>
         {
            this.setState({ fileTypeToView: e.target.value });
          }}
        /&gt;
        </div>
github TeselaGen / openVectorEditor / src / withEditorInteractions / index.js View on Github external
function getGenbankFromSelection(selectedSeqData, sequenceData) {
  const spansEntireSeq =
    sequenceData.sequence.length === selectedSeqData.sequence.length;
  const feats = map(selectedSeqData.features);
  const just1Feat = feats.length === 1;

  return {
    sequence: jsonToGenbank({
      ...selectedSeqData,
      name: spansEntireSeq
        ? selectedSeqData.name
        : just1Feat
        ? feats[0].name
        : selectedSeqData.name + "_partial",
      circular: spansEntireSeq ? selectedSeqData.circular : false
    })
  };
}

bio-parsers

A library of parsers for interconverting between genbank, fasta, and (eventually) sbol through Teselagen's intermediary json format

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis