ccsb-scripps / AutoDock-Vina

AutoDock Vina
http://vina.scripps.edu
Apache License 2.0
562 stars 199 forks source link

Improvements to dry script #202

Closed domiko96 closed 1 year ago

domiko96 commented 1 year ago

Hey, I have absolutely no idea of the code I worked on here - I just addressed 2 problems together with @SciChemBella while modelling one of her Inhibitor compounds. We think they make sense and produced a usable output for her.

The problems she hit were already mentioned in some open issues:

I just thought I'd share what we did so it might help others 🦄

Fixes:

coauthored by @SciChemBella

Serious-Huang commented 1 year ago

Hi, I'm new in GitHub. From my perspective, the problem "IndexError" is caused when one (x or y or z) is beyond the number of grid points. And I simply solved it as follows:

for x_ofs in range(-pt_scan, pt_scan+1):
    x = x_pt + x_ofs
    if x > pts[0]: # modified
        break
    if x < 0 :
        harvesting.append(0)
        break
    for y_ofs in range(-pt_scan, pt_scan+1):
        y = y_pt + y_ofs
        if y > pts[1]: # modified
            break
        if y < 0 :
            harvesting.append(0)
            break
        for z_ofs in range(-pt_scan, pt_scan+1):
            z = z_pt + z_ofs
            if z > pts[2]: # modified
                break
            if z < 0 :
                harvesting.append(0)
                break
            harvesting.append( data[z,y,x] )
            if data[z,y,x] < best:
                best = data[z,y,x]

It seems okay. Maybe there is no need to append harversting when it is out of range.

diogomart commented 1 year ago

Thank you @domiko96 and @Serious-Huang! Ended up removing variable harvesting as it wasn't used except for the debugging print.