Question: Pdbs Not Downloading Into The Correct Location
0
gravatar for Harpalss
8.7 years ago by
Harpalss310
Harpalss310 wrote:

I'm using the code below to create a folder and then download the assocated PDBs with that protein. The problem I'm having is the PDBs are downloaded into the wrong location. They are downloaded into the loaction with the python script and not into the Cytochrome_C folder.

pdbs = [
['Cytochrome_C']
['1giw','TITLE']
['1lc1','TITLE']
['1lc2','TITLE']
]

for pdb in pdbs:

    if str(pdb[0]) == 'Cytochrome_C':
        os.popen('mkdir Cytochrome_C')
        os.popen('cd ./Cytochrome_C')


    if len(pdb) == 2:
        os.popen('wget <http://www.pdb.org/pdb/files/%s.pdb'> % (str(pdb[0])))
pdb python • 1.3k views
ADD COMMENTlink modified 8.7 years ago by iansealy250 • written 8.7 years ago by Harpalss310
3
gravatar for iansealy
8.7 years ago by
iansealy250
iansealy250 wrote:

Try changing:

os.popen('cd ./Cytochrome_C')

to:

os.chdir('Cytochrome_C')
ADD COMMENTlink written 8.7 years ago by iansealy250

D'oh! Silly me.

ADD REPLYlink written 8.7 years ago by Harpalss310
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1440 users visited in the last hour