How to use the bio-parsers.anyToJson 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 / withEditorProps / index.js View on Github external
reader.onload = function(evt) {
    const content = evt.target.result;
    anyToJson(
      content,
      async result => {
        // TODO maybe handle import errors/warnings better
        const failed = !result[0].success;
        const messages = result[0].messages;
        if (messages && messages.length) {
          messages.forEach(msg => {
            const type = msg
              .substr(0, 20)
              .toLowerCase()
              .includes("error")
              ? failed
                ? "error"
                : "warning"
              : "info";
            window.toastr[type](msg);
github TeselaGen / openVectorEditor / src / Editor / DropHandler.js View on Github external
reader.onload = function(evt: Object) {
      const content: string = evt.target.result;
      anyToJson(
        content,
        result => {
          updateSequenceData(result[0].parsedSequence);
        },
        { fileName: file.name, acceptParts: true }
      );
    };
    reader.onerror = function() {
github TeselaGen / openVectorEditor / src / ToolBar / alignmentTool.js View on Github external
flatMap(files, async file => {
      const results = await anyToJson(file.originalFileObj, {
        fileName: file.name,
        acceptParts: true
      });
      return results.forEach(result => {
        if (result.success) {
          array.push("addedSequences", result.parsedSequence);
        } else {
          return window.toastr.warning("Error parsing file: ", file.name);
        }
      });
    });
    onChange([]);

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