Skip to content

Instantly share code, notes, and snippets.

import cv2
import numpy as np
from datetime import datetime
# Get initial image
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
# Select ROI for reference (background)
  1. Generate problem.pddl by running xdl_to_pddl.py.
python xdl_to_pddl.py procedure.xdl

Three problems will be generated. Save one of them as problem.pddl

(define (problem tmp)
  (:domain xdl)
 (:objects beaker red_cabbage_soup baking_soda_solution vinegar)
import numpy as np
from selfies import encoder, decoder, selfies_alphabet
gene_length = 300
# assign 5 bits for each alphabet (0 - 31)
bits_per_symbol = 5
gene_max = 2**bits_per_symbol - 1
def chromosome_to_selfies(chromosome):
alphabets = selfies_alphabet()
@n-yoshikawa
n-yoshikawa / random_selfies.ipynb
Created November 24, 2019 20:48
Evaluate random SELFIES string
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@n-yoshikawa
n-yoshikawa / README.md
Created November 22, 2019 22:31
Benchmarking xyz2mol

Benchmarking XYZ2mol

This is a small benchmark for xyz2mol by Jan Jensen.

I used a criteria that the conversion is successful when canonical SMILES from SDF file and XYZ files are the same. I compared xyz2mol and Open Babel 3.0.

Requirements

  • xyz2mol.py from xyz2mol
  • RDKit
  • networkx
import torch
import torch.nn as nn
from torch.nn import Softplus
from torch.utils.data import Dataset, DataLoader
import dgl
import dgl.function as fn
from dgl.batched_graph import sum_nodes
from dgl.data.chem.utils import mol_to_complete_graph
import numpy as np
from collections import defaultdict
@n-yoshikawa
n-yoshikawa / result.txt
Created September 17, 2019 22:48
How to parse "CCC1CC(CCC1CC)CC" in CFG
(smiles
(chain
(chain
(chain
(chain
(chain
(chain
(chain (branched_atom (atom (aliphatic_organic C))))
(branched_atom (atom (aliphatic_organic C))))
(branched_atom
0CO_3CS6_A
OpenBabel06211905503D
76 79 0 0 1 0 0 0 0 0999 V2000
3.9824 3.9435 -1.1687 C 0 0 0 0 0 0 0 0 0 0 0 0
3.3558 3.9999 0.0052 C 0 0 0 0 0 0 0 0 0 0 0 0
1.9598 4.3426 -0.2972 C 0 0 0 0 0 0 0 0 0 0 0 0
1.3168 3.2716 -0.4635 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0541 3.2334 -0.2169 C 0 0 1 0 0 0 0 0 0 0 0 0
-0.4429 1.8599 -0.1287 C 0 0 2 0 0 0 0 0 0 0 0 0
%chk=/home/yoshikawa/naphthalene_excited.chk
#p HF/3-21G Opt CIS
Naphthalene excited structure calculation
0 1
C 2.44670 -0.67152 0.02374
C 2.42779 0.72015 0.01820
C 1.20948 1.40137 0.00470
C -0.00617 0.69817 -0.00343
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.