def copyFromCasp2CcpnArchive(): inputDir = '/Users/jd/CASP-NMR-CING/caspNmrDbDivided' os.chdir(inputDir) for entryCode in entryList: # for entryCode in entryList[0:1]: ch23 = entryCode[1:3] for city in predList: # for city in cityList[0:1]: entryCodeNew = entryCode + city nTmessage("Working on: %s" % entryCodeNew) inputEntryDir = os.path.join(inputDir, ch23, entryCodeNew) outputEntryDir = os.path.join(dataDir, ch23, entryCodeNew) inputAuthorDir = os.path.join(outputEntryDir, 'Author') outputNijmegenDir = os.path.join(outputEntryDir, 'Nijmegen') if not os.path.exists(inputAuthorDir): mkdirs(inputAuthorDir) if not os.path.exists(outputNijmegenDir): mkdirs(outputNijmegenDir) # prevent junk patternList = "*.pdb *.upl *.aco *.tbl".split() fnList = globMultiplePatterns(inputEntryDir, patternList) for fn in fnList: orgFn = os.path.join(inputEntryDir, fn) # nTmessage("Copying from %s" % fn) # fnBaseName = os.path.basename(fn) dstFn = os.path.join(inputAuthorDir, fn) nTmessage("Copying from %s to %s" % (orgFn, dstFn)) copy(orgFn, dstFn)
def copyFromCasdNmr2CcpnArchive(): #inputDir = '/Users/jd/CASD-NMR-CING/casdNmrDbDivided' programHoH = convertToProgram(participationTable) os.chdir(inputDir) for entryCode in entryList: # for entryCode in entryList[0:1]: ch23 = entryCode[1:3] for city in cityList: # for city in cityList[0:1]: entryCodeNew = entryCode + city programId = getDeepByKeys(programHoH, entryCode, city) if not (city == 'Test' or programId): # nTdebug("Skipping %s" % entryCodeNew) continue # else: # nTdebug("Looking at %s" % entryCodeNew) # continue # TODO disable premature stop. nTmessage("Working on: %s" % entryCodeNew) inputEntryDir = os.path.join(inputDir, ch23, entryCodeNew) outputEntryDir = os.path.join(dataDir, ch23, entryCodeNew) inputAuthorDir = os.path.join(outputEntryDir, 'Author') outputNijmegenDir = os.path.join(outputEntryDir, 'Nijmegen') if not os.path.exists(inputAuthorDir): mkdirs(inputAuthorDir) if not os.path.exists(outputNijmegenDir): mkdirs(outputNijmegenDir) # prevent junk patternList = "*.pdb *.upl *.aco *.tbl".split() fnList = globMultiplePatterns(inputEntryDir, patternList) for fn in fnList: orgFn = os.path.join(inputEntryDir, fn) # nTmessage("Copying from %s" % fn) # fnBaseName = os.path.basename(fn) dstFn = os.path.join(inputAuthorDir, fn) nTmessage("Copying from %s to %s" % (orgFn, dstFn)) copy(orgFn, dstFn)