_init(node, order = 0, parentVertexId = null, isBranch = false) {
    // Create a new vertex object
    const element = node.atom.element ? node.atom.element : node.atom;
    let atom = new Atom(element, node.bond);

    if (element !== 'H' || !node.hasNext && parentVertexId === null) {
      atom.idx = this._atomIdx;
      this._atomIdx++;
    }

    atom.branchBond = node.branchBond;
    atom.ringbonds = node.ringbonds;
    atom.bracket = node.atom.element ? node.atom : null;
    atom.class = node.atom.class;
    let vertex = new Vertex(atom);
    let parentVertex = this.vertices[parentVertexId];
    this.addVertex(vertex);

    if (atom.idx !== null) {
      this.atomIdxToVertexId.push(vertex.id);
    } // Add the id of this node to the parent as child


    if (parentVertexId !== null) {
      vertex.setParentVertexId(parentVertexId);
      vertex.value.addNeighbouringElement(parentVertex.value.element);
      parentVertex.addChild(vertex.id);
      parentVertex.value.addNeighbouringElement(atom.element); // In addition create a spanningTreeChildren property, which later will
      // not contain the children added through ringbonds

      parentVertex.spanningTreeChildren.push(vertex.id); // Add edge between this node and its parent

      let edge = new Edge(parentVertexId, vertex.id, 1);
      let vertexId = null;

      if (isBranch) {
        edge.setBondType(vertex.value.branchBond || '-');
        vertexId = vertex.id;
        edge.setBondType(vertex.value.branchBond || '-');
        vertexId = vertex.id;
      } else {
        edge.setBondType(parentVertex.value.bondType || '-');
        vertexId = parentVertex.id;
      }

      let edgeId = this.addEdge(edge);
    }

    let offset = node.ringbondCount + 1;

    if (atom.bracket) {
      offset += atom.bracket.hcount;
    }

    let stereoHydrogens = 0;

    if (atom.bracket && atom.bracket.chirality) {
      atom.isStereoCenter = true;
      stereoHydrogens = atom.bracket.hcount;

      for (var i = 0; i < stereoHydrogens; i++) {
        this._init({
          atom: 'H',
          isBracket: 'false',
          branches: Array(),
          branchCount: 0,
          ringbonds: Array(),
          ringbondCount: false,
          next: null,
          hasNext: false,
          bond: '-'
        }, i, vertex.id, true);
      }
    }

    for (var i = 0; i < node.branchCount; i++) {
      this._init(node.branches[i], i + offset, vertex.id, true);
    }

    if (node.hasNext) {
      this._init(node.next, node.branchCount + offset, vertex.id);
    }
  }
PRIVATE FUNCTION. Initializing the graph from the parse tree.

@param {Object} node The current node in the parse tree.
@param {?Number} parentVertexId=null The id of the previous vertex.
@param {Boolean} isBranch=false Whether or not the bond leading to this vertex is a branch bond. Branches are represented by parentheses in smiles (e.g. CC(O)C).