Download ParsePDB.pm
Transcript
8 Write the Whole or Parts of the PDB To write out specific parts of the PDB, the method ->Write is used. All parameters are identical with ->Get, so it is possible to write out for example only certain atom types or all alanine residues and so on. $PDB->Write (FileName => "file.pdb"); Header and Footer are included by default. The parameter FileName is mandatory, if it is omitted, the method throws a NoFile error. Sometimes it is required to split a protein into its models or chains. Since that is a standard task, there are two methods for it. @AllModels = $PDB->WriteModels; # extract all models in single files @AllChains = $PDB->WriteChains; # extract all chains in single files Most parameters of these two methods are identical with ->Get. Header and Footer are included by default. If the parameter ”FileName” is omitted, the base name of the PDB is taken. The suffix defined via ->new (ModelSuffix or ChainSuffix) is added plus the chain or model number, for example: file c1.pdb file c2.pdb file c3.pdb An array containing the names of the created files is returned. ->WriteChains can also write the chain IDs as letters instead of numbers. Numbers are the default, if letters are desired, ChainLabelAsLetter has to be set to 1 via ->new() or ->SetChainLabelAsLetter. If ->ChainLabelsValid returns false, the setting is ignored and chains can only be accessed via their sequential numbers given by ->IdentifyChains. If no Model is given to ->WriteChains, ”0” is taken by default. The routine can just process one model at a time. To loop over all models, the information provided by the method ->IdentifyModels can be used. When all models are processed, something like "FileName => "$BaseName-$Model" should be defined as file name. The following (additional) parameters can be given to ->WriteModels and ->WriteChains. • ModelSuffix => "-model-" To change the default suffix ”-m”. • ChainSuffix => "-chain-" 17