import pickle
import os
import numpy as np
from NozPiker_Funcs import main as NZ
import pandas as pd
from biopandas.pdb import PandasPdb
import subprocess
import os
import glob

print("The script is beginning now")

DATA_DIR = os.path.join(os.path.dirname(os.getcwd()),'data/build_data/')

files = glob.glob(DATA_DIR + "*.mrcs")
madefiles = []
for i in files:
    shortname = i.split('/')[-1].split('_')[1]
    madefiles.append(shortname)

rcsbdata = pd.read_table('/home/cns-mccafferty/NeuralNetFun/cmpd_res.idx', skiprows=4, header=None, names=['pdb', 'a', 'res', 'b', 'compound'])
rcsbdata = rcsbdata[['pdb', 'res', 'compound']]
nonorcsbdata = rcsbdata.dropna() # drops all rows with nan
highres = nonorcsbdata[nonorcsbdata['res'] <= 3] # drops all rows with resolution lower than 3A
reducedhighres = highres.drop_duplicates(subset='compound', keep="first") # only keeps first compound of repeats

# the steps above bring set of initial size 164264 to 128755

# topthous = reducedhighres.head(1000)
pdblist = list(reducedhighres['pdb'])

pdblist.remove('3P4A')
pdblist.remove('5VY7')
pdblist.remove('2C4S')
pdblist.remove('1C4S')
pdblist.remove('1CAP')

l3 = [x for x in pdblist if x not in madefiles]
print("The list is now shorter")
print(len(l3))

for i in l3:
    try:
        NZ.makeImages(DATA_DIR, i)
    except AttributeError:
        pass

25f718b7071f3540428fb9b4ccef83d69cc05487
<mask token>

<mask token>
print('The script is beginning now')
<mask token>
for i in files:
    shortname = i.split('/')[-1].split('_')[1]
    madefiles.append(shortname)
<mask token>
pdblist.remove('3P4A')
pdblist.remove('5VY7')
pdblist.remove('2C4S')
pdblist.remove('1C4S')
pdblist.remove('1CAP')
<mask token>
print('The list is now shorter')
print(len(l3))
for i in l3:
    try:
        NZ.makeImages(DATA_DIR, i)
    except AttributeError:
        pass

<mask token>
print('The script is beginning now')
DATA_DIR = os.path.join(os.path.dirname(os.getcwd()), 'data/build_data/')
files = glob.glob(DATA_DIR + '*.mrcs')
madefiles = []
for i in files:
    shortname = i.split('/')[-1].split('_')[1]
    madefiles.append(shortname)
rcsbdata = pd.read_table('/home/cns-mccafferty/NeuralNetFun/cmpd_res.idx',
    skiprows=4, header=None, names=['pdb', 'a', 'res', 'b', 'compound'])
rcsbdata = rcsbdata[['pdb', 'res', 'compound']]
nonorcsbdata = rcsbdata.dropna()
highres = nonorcsbdata[nonorcsbdata['res'] <= 3]
reducedhighres = highres.drop_duplicates(subset='compound', keep='first')
pdblist = list(reducedhighres['pdb'])
pdblist.remove('3P4A')
pdblist.remove('5VY7')
pdblist.remove('2C4S')
pdblist.remove('1C4S')
pdblist.remove('1CAP')
l3 = [x for x in pdblist if x not in madefiles]
print('The list is now shorter')
print(len(l3))
for i in l3:
    try:
        NZ.makeImages(DATA_DIR, i)
    except AttributeError:
        pass

import pickle
import os
import numpy as np
from NozPiker_Funcs import main as NZ
import pandas as pd
from biopandas.pdb import PandasPdb
import subprocess
import os
import glob
print('The script is beginning now')
DATA_DIR = os.path.join(os.path.dirname(os.getcwd()), 'data/build_data/')
files = glob.glob(DATA_DIR + '*.mrcs')
madefiles = []
for i in files:
    shortname = i.split('/')[-1].split('_')[1]
    madefiles.append(shortname)
rcsbdata = pd.read_table('/home/cns-mccafferty/NeuralNetFun/cmpd_res.idx',
    skiprows=4, header=None, names=['pdb', 'a', 'res', 'b', 'compound'])
rcsbdata = rcsbdata[['pdb', 'res', 'compound']]
nonorcsbdata = rcsbdata.dropna()
highres = nonorcsbdata[nonorcsbdata['res'] <= 3]
reducedhighres = highres.drop_duplicates(subset='compound', keep='first')
pdblist = list(reducedhighres['pdb'])
pdblist.remove('3P4A')
pdblist.remove('5VY7')
pdblist.remove('2C4S')
pdblist.remove('1C4S')
pdblist.remove('1CAP')
l3 = [x for x in pdblist if x not in madefiles]
print('The list is now shorter')
print(len(l3))
for i in l3:
    try:
        NZ.makeImages(DATA_DIR, i)
    except AttributeError:
        pass

import pickle
import os
import numpy as np
from NozPiker_Funcs import main as NZ
import pandas as pd
from biopandas.pdb import PandasPdb
import subprocess
import os
import glob

print("The script is beginning now")

DATA_DIR = os.path.join(os.path.dirname(os.getcwd()),'data/build_data/')

files = glob.glob(DATA_DIR + "*.mrcs")
madefiles = []
for i in files:
    shortname = i.split('/')[-1].split('_')[1]
    madefiles.append(shortname)

rcsbdata = pd.read_table('/home/cns-mccafferty/NeuralNetFun/cmpd_res.idx', skiprows=4, header=None, names=['pdb', 'a', 'res', 'b', 'compound'])
rcsbdata = rcsbdata[['pdb', 'res', 'compound']]
nonorcsbdata = rcsbdata.dropna() # drops all rows with nan
highres = nonorcsbdata[nonorcsbdata['res'] <= 3] # drops all rows with resolution lower than 3A
reducedhighres = highres.drop_duplicates(subset='compound', keep="first") # only keeps first compound of repeats

# the steps above bring set of initial size 164264 to 128755

# topthous = reducedhighres.head(1000)
pdblist = list(reducedhighres['pdb'])

pdblist.remove('3P4A')
pdblist.remove('5VY7')
pdblist.remove('2C4S')
pdblist.remove('1C4S')
pdblist.remove('1CAP')

l3 = [x for x in pdblist if x not in madefiles]
print("The list is now shorter")
print(len(l3))

for i in l3:
    try:
        NZ.makeImages(DATA_DIR, i)
    except AttributeError:
        pass
