Giter Club home page Giter Club logo

Comments (12)

max-unfried avatar max-unfried commented on September 10, 2024

I'm having the exact same issue - any idea why this is?

from hgraph2graph.

NiharikaVadlamudi avatar NiharikaVadlamudi commented on September 10, 2024

@wengong-jin Can you please suggest a solution for this ? Thanks

from hgraph2graph.

max-unfried avatar max-unfried commented on September 10, 2024

Anything that you could suggest - still hung up on it?

from hgraph2graph.

AdamIzdebski avatar AdamIzdebski commented on September 10, 2024

+1

from hgraph2graph.

marshallcase avatar marshallcase commented on September 10, 2024

Can you post a picture of your molecule / encoded graph? In my experience you get n-m > 1 when there's atoms that aren't connected to the rest of the molecule. This could be because the cluster generation process in find_clusters() wasn't built for a particular combination of rings / bonds

from hgraph2graph.

JonathanBroadbent avatar JonathanBroadbent commented on September 10, 2024

Hi, reopening this as I am currently experiencing the same problem.
It says the issue occurs in tree_decomp line 82

Has anybody found a fix yet?

from hgraph2graph.

orubaba avatar orubaba commented on September 10, 2024

from hgraph2graph.

JonathanBroadbent avatar JonathanBroadbent commented on September 10, 2024

from hgraph2graph.

orubaba avatar orubaba commented on September 10, 2024

from hgraph2graph.

JonathanBroadbent avatar JonathanBroadbent commented on September 10, 2024

from hgraph2graph.

orubaba avatar orubaba commented on September 10, 2024

import sys
import argparse
from hgraph import *
from rdkit import Chem
from multiprocessing.dummy import Pool

def process(data):
vocab = set()
for line in data:
s = line.strip("\r\n ")
hmol = MolGraph(s)
for node,attr in hmol.mol_tree.nodes(data=True):
smiles = attr['smiles']
vocab.add( attr['label'] )
for i,s in attr['inter_label']:
vocab.add( (smiles, s) )
return vocab

if name == "main":

parser = argparse.ArgumentParser()
parser.add_argument('--ncpu', type=int, default=1)
args = parser.parse_args()

data = [mol for line in sys.stdin for mol in line.split()[:2]]
data = list(set(data))

batch_size = len(data) // args.ncpu + 1
batches = [data[i : i + batch_size] for i in range(0, len(data), batch_size)]

with Pool(args.ncpu) as pool:
    vocab_list = pool.map(process, batches, chunksize=1)
    vocab = [(x,y) for vocab in vocab_list for x,y in vocab]

from hgraph2graph.

orubaba avatar orubaba commented on September 10, 2024

Interestingly, I removed all contents from line 34 downwards (I don't know why that should solve the problem for me) and it ran well. sorry you couldn't get the img. I was responding within my mail. let's see if it works. btw, chatgpt was really helpful with the error clearings.

from hgraph2graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.