Pdbs Not Downloading Into The Correct Location
1
0
Entering edit mode
12.5 years ago
Harpalss ▴ 310

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.9k views
ADD COMMENT
3
Entering edit mode
12.5 years ago
iansealy ▴ 260

Try changing:

os.popen('cd ./Cytochrome_C')

to:

os.chdir('Cytochrome_C')
ADD COMMENT
0
Entering edit mode

D'oh! Silly me.

ADD REPLY

Login before adding your answer.

Traffic: 2133 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6