MTStructure

Objects of type MTStructure are created by MTStructureFactory.

A structure consists of one or several models, each holding one or multiple chains (3.4). Models are treated like contexts, between which the user may switch.

Methods:

* read-only access  
-(NSString*)pdbcode returns a string representing the 4-letter PDB code
-(NSString*)header corresponds to HEADER line in PDB file
-(NSString*)title corresponds to TITLE line in PDB file
-(NSCalendarDate*)date extracted from HEADER line
-(NSCalendarDate*)revdate corresponds to latest revision as stated in REVDAT lines
-(ExperimentType)expdata returns the type of experimental method

Structure_XRay = 100  
Structure_NMR = 101  
Structure_TheoreticalModel = 102 
Structure_Other = 103 
Structure_Unknown = 104

-(float)resolution resolution as in REMARK 2 lines
-(NSArray*)keywords returns an array of keywords as parsed from KEYWDS lines
*descriptors  
-(id)getDescriptorForKey: (NSString*)key returns the descriptor for a given key
-(id)setDescriptor:(id) desc withKey: (NSString*)key adds a descriptor with a key
-(NSArray*)allDescriptorKeys returns an array of all descriptor keys
*model context  
-(int)models returns the number of models in this structure (1 .. n)
-(int)currentModel returns the index of the currently active model context (1 .. n)
-(void)switchToModel:(int)mnum changes the currently active model context to the model with the indicated index (1 .. n)
-(int)addModel adds a new model context to this structure, makes it the active model context and returns its index (1 .. n)
-(void)removeModel removes the currently active model context from this structure and sets the active model context to the next available; the single last model context cannot be removed
*query and various methods  
-(NSString*)hetnameForKey: (NSString*)key HETNAME lines indicate long names for residue names. This method returns the long name for the key of a residue (3.6).
-(void)writePDBToStream: (MTStream*)fn writes out the complete structure to a stream (5.1) in PDB format.
-(NSEnumerator*)allChains returns an enumerator (9.6) over all chains in the active model context
-(MTChain*)getChain: (NSNumber*)p_chain returns the chain (3.4) for a given code in the active model context
-(void)removeChain: (MTChain*)p_chain remove a chain (3.4) from this structure in the active model context

strx := MTStructureFactory newStructureFromPDBDirectory: '1GUA' .

chain := strx getChain: 66.     " access chain B = code 66. "

strx removeChain: chain.     " remove the chain. "

stream := MTCompressedFileStream streamToFile: 'test0.pdb.gz' .     " create the stream we will write to. "

strx writePDBToStream: stream.

stream close.     " close this stream and force it to be written to disk. "

moltalk@moltalk.org      version of this document: V3.0