def getAquaAtomInfo(chemCompCodes = {}): aquaRefDir = getDataPath('ccp', 'aqua') files = os.listdir(aquaRefDir) for file in files: if file[0:8] == 'AtomLIB-': format = file[8:] readAquaFormats(joinPath(aquaRefDir,file),format,chemCompCodes) for file in files: if file[-8:] == 'LIB-aqua': info = file[0:-8] readAquaDefs(joinPath(aquaRefDir,file),info,chemCompCodes) return chemCompCodes
def __init__(self, version = None): self.patt = getRegularExpressions() self.readComponents = ['STARTGRP','HEADRES','RESIDUE','TAILRES'] self.refInfo = {} if version in ['2.1']: fileName = 'cyana2.1.lib' else: fileName = 'cyana.lib' self.read(getDataPath('ccp', 'cyana', fileName)) self.setAtomPosition() self.setAngleAtoms()
def __init__(self, parent, project, path = None, molTypeEntries = None, chemCompEntries = None, selectedChemComps = None, selectLinking = None, *args, **kw): Frame.__init__(self, parent, *args, **kw) self.project = project self.molTypeEntries = molTypeEntries self.chemCompEntries = chemCompEntries self.selectLinking = selectLinking if (not path): path = getDataPath() self.path = path # Check if all chemComps available locally self.path_allChemComps = getChemCompArchiveDataDir() if not os.path.exists(self.path_allChemComps): self.path_allChemComps = None self.chemCompInfoDict = {} self.chemCompInfoList = [] self.chemCompDownload = False self.chem_comps_shown = {} for entry in chemCompList: self.chemCompClasses[entry] = getattr(ccp.api.molecule.ChemComp, entry) self.grid_columnconfigure(0, weight=1) row = 0 if (molTypeEntries is None): headerText = "Show residues (select molecular type(s)):" else: headerText = "Show %s residues:" % (str(molTypeEntries)) # # # TODO TODO: HERE need to do some niftier stuff for displaying! # # headerTextWidget = Label(self, text = headerText) headerTextWidget.grid(row=row, column=0, sticky=Tkinter.W) row = row + 1 if (molTypeEntries is None): self.mol_type_buttons = CheckButtons(self, entries=molTypeList, select_callback=self.updateTables) self.mol_type_buttons.grid(row=row, column=0, sticky=Tkinter.EW) row = row + 1 else: self.mol_type_buttons = None # # The chemComps to display... # self.showLocalText = 'Show local' self.showWebText = 'Show available via web' self.display_buttons = CheckButtons(self, entries=[self.showLocalText,self.showWebText], select_callback=self.updateTables, selected = [self.showLocalText]) self.display_buttons.grid(row=row, column=0, sticky=Tkinter.EW) row = row + 1 self.grid_rowconfigure(row, weight=2) headings = ('number', 'show details', 'molType', 'ccpCode', 'code1Letter', 'cifCode', 'name') editWidgets = 7 * [ None ] editGetCallbacks = [ None, self.toggleShow, None, None, None, None, None ] editSetCallbacks = 7 * [ None ] self.chem_comp_table = ScrolledMatrix(self, headingList=headings, editWidgets=editWidgets, editGetCallbacks=editGetCallbacks, editSetCallbacks=editSetCallbacks) self.chem_comp_table.grid(row=row, column=0, sticky=Tkinter.NSEW) row = row + 1 texts = [ 'Show all in details window', 'Clear details window' ] commands = [ self.showAll, self.showNone ] buttons = ButtonList(self, texts=texts, commands=commands) buttons.grid(row=row, column=0, sticky=Tkinter.EW) row = row + 1 separator = Separator(self,height = 3) separator.setColor('black', bgColor = 'black') separator.grid(row=row, column=0, sticky=Tkinter.EW) row = row + 1 headerTextWidget = Label(self, text = "Select the residue variant:") headerTextWidget.grid(row=row, column=0, sticky=Tkinter.W) row = row + 1 if (chemCompEntries is None): self.chem_comp_buttons = CheckButtons(self, entries=chemCompList, selected=('ChemComp',), select_callback=self.updateChemCompVarTable) self.chem_comp_buttons.grid(row=row, column=0, sticky=Tkinter.EW) row = row + 1 else: self.chem_comp_buttons = None self.grid_rowconfigure(row, weight=1) headings = ('number', 'molType', 'ccpCode', 'linking', 'descriptor', 'molecularMass', 'formula', 'nonStereoSmiles', 'stereoSmiles') self.chem_comp_var_table = ScrolledMatrix(self, headingList=headings) self.chem_comp_var_table.grid(row=row, column=0, sticky=Tkinter.NSEW) self.chem_comp_var_headings = headings[1:] if selectedChemComps: for chemComp in selectedChemComps: key = (chemComp.molType, chemComp.ccpCode) self.chem_comps_shown[key] = 1 self.updateTables()
from ccp.general.Io import getDataPath from pdbe.general.Io import pdbeDataDir # # Tag for newly created chemComp(Coord)s - will be removed if modified afterwards!!! # freshTag = 'objectGeneratedFromScratch' # # Directory containing reference information for substituents # origMol2DataDir = getDataPath('ccp','mol2') # # Work chemComp directory, in all/ # try: from localConstants import workChemCompDir except: # Have to work on the actual repository directory for editing! workChemCompDir = joinPath(pdbeDataDir,'chemComp') refDataDir = os.path.join(workChemCompDir,'refData') tempChemCompDir = os.path.join(workChemCompDir,'tmp')
from ccp.general.Io import getDataPath # This maybe not so good? Or only relevant for large scale testing, not for people to work on own # workflow try: from localConstants import importDataDir except: importDataDir = getDataPath('ccpnmr', 'workflow') try: from localConstants import cnsExec except: cnsExec = 'cns_solve' programList = ['Aria', 'Cing', 'Cns', 'Fc', 'Haddock', 'Isd']
from memops.api.Implementation import MemopsRoot from memops.gui.Button import Button from memops.gui.MessageReporter import showInfo from ccp.general.Io import getDataPath project = MemopsRoot(name='p') root = Tkinter.Tk() root.top = root root.grid_rowconfigure(0, weight=1) root.grid_columnconfigure(0, weight=1) path = getDataPath() frame = ChemCompFrame(root, project, path = path) frame.grid(sticky=Tkinter.NSEW) def getSelected(): chemComp = frame.getSelectedChemComp() if (chemComp): if hasattr(chemComp,'chemComp'): ccType = 'chemCompVar' chemComp = chemComp.chemComp else: ccType = 'chemComp' showInfo('ChemComp', 'Selected %s = (%s, %s)' % (ccType,chemComp.molType, chemComp.ccpCode), parent=root)
try: from pdbe.general.localConstants import pdbeDataDir except: from ccp.general.Io import getDataPath pdbeDataDir = getDataPath('pdbe')
import os from ccp.general.Io import getDataPath pulProgFile = getDataPath('ccp', 'bruker', 'Pulprog.info') # # THIS HAS TO BECOME TEXT FILE!! # # THIS NOT USED YET! mappingToCcpn = { 'hnco': 'H[N[CO]]', # Experiment name - can find pathway by looping over all pathways and looking for this name. # Then need dimension information... WARNING what about reversed dimension stuff? # In case of hnco, would this generally be F1:1,F3:2,F2:3 (but AQSEQ? Can change?) # # For automatic mapping, almost have to read in experiment itself, then compare to possible pathway info # in Bruker pulse sequence to match up... then also need mapping between atom names (CO->C=O) though. # } stdExpNameDict = { 'adeq': 'ADEQUATE', 'apt': 'APT (attached proton test)', 'aring': 'Anti-ring', 'atocsy': 'Adiabatic TOCSY', '^b_': 'Best sequence (Brutscher)', '^c_': 'Carbon detected experiment', 'c6': 'Nucleic acid atom',