NAME
    ModifyPDBFiles.pl - Modify data in PDBFile(s)

SYNOPSIS
    ModifyPDBFiles.pl PDBFile(s)...

    ModifyPDBFiles.pl [-a, --AtomNumberStart number] [-c, --ChainIDStart
    character] [--ChainIDRenameEmpty yes | no] [-h, --help] [-k,
    --KeepOldRecords yes | no] [-m, --mode RenumberAtoms | RenumberResidues
    | RenumberWaters | RenameChainIDs] [--ModifyHeader yes | no] [-o,
    --overwrite] [--ResidueNumberMode Sequential | PerChain]
    [--ResidueNumberStart number] [--ResidueNumberHetatmMode automatic |
    specify] [--ResidueNumberStarHetatm number] [-r, --root rootname]
    [--WaterResidueNames Automatic | "ResidueName, [ResidueName,...]"]
    [--WaterResidueStart number] [-w, --WorkingDir dirname] PDBFile(s)...

DESCRIPTION
    Modify data in *PDBFile(s)*: renumber atoms, residues, and water
    residues or assign new chain IDs. Multiple PDBFile names are separated
    by spaces. The valid file extension is *.pdb*. All other file name
    extensions are ignored during the wild card expansion. All the PDB files
    in a current directory can be specified either by **.pdb* or the current
    directory name.

OPTIONS
    -a, --AtomNumberStart *number*
        Starting atom number to use during *RenumberAtoms* value of -m,
        --mode option. Default: *1*. Valid values: positive integers.

    -c, --ChainIDStart *character*
        A single character to use for starting IDs for chains during
        *RenameChainIDs* value of -m, --mode option. Default: *A*. Valid
        values: *A to Z*.

    --ChainIDRenameEmpty *Yes | No*
        Specify whether to rename empty chain IDs during *RenameChainIDs*
        -m, --mode value. By default, ATOM and HETATM records with no chain
        IDs are left unchanged. Possible values: *yes | no*. Default: *No*.

    -h, --help
        Print this help message.

    -k, --KeepOldRecords *yes | no*
        Specify whether to transfer old non ATOM and HETATM records from
        input PDBFile(s) to new PDBFile(s). By default, except for the
        HEADER record, all records other than ATOM/HETATM are dropped during
        the generation of new PDB files. Possible values: *yes | no*.
        Default: *no*.

    -m, --mode *RenumberAtoms | RenumberResidues | RenumberWaters |
    RenameChainIDs*
        Specify how to modify *PDBFile(s)*. Possible values: *RenumberAtoms
        | RenumberResidues | RenumberWaters | RenameChainIDs*. Default:
        *RenumberResidues*.

        For *RenumberAtoms* mode, residue number in ATOM and HETATM records
        are reassigned sequentially starting using value of -a,
        --AtomNumberStart option.

        For *RenumberResidues* mode, serial number in ATOM and HETATM
        records are reassigned either sequentially or statring from
        specified values for ATOM and HETATM records in each chain.

        For *RenumberWaters* mode, residue number for waters are reassigned
        starting from a specific value.

        For *RenameChainIDs* mode, all the chain IDs are reassigned starting
        from a specific chain ID.

        During the generation of new PDB files, unnecessary CONECT records
        are dropped.

    --ModifyHeader *yes | no*
        Specify whether to modify HEADER record during the generation of new
        PDB files Possible values: *yes | no*. Default: *yes*. By defailt,
        Classification data is replaced by *Data modified using
        MayaChemTools* before writing out HEADER record.

    -o, --overwrite
        Overwrite existing files

    --ResidueNumberMode *Sequential | PerChain*
        Specify how to renumber residues: renumber residues sequentially
        across all the chains or start from the begining for each chain.
        Possible values: *Sequential | PerChain*. Default: *PerChain*.

    --ResidueNumberStart *number*
        Starting residue number to use for ATOM records in chains. Default:
        *1*. Valid values positive integers.

        For *Sequential* value of --ResidueNumberMode option, residue
        numbers are assigned sequentially across all the chains starting
        from the specified value.

        For *PerChain* value of --ResidueNumberMode option, residue numbers
        are starting again from the specified value for each chain.

        HETATM residues with in the chains are numbered using this value as
        well

    --ResidueNumberHetatmMode *automatic | specify*
        Specify how to start residue number for HETATM records: use the next
        sequential residue number after the last residue number from ATOM
        records or start from a specific residue number. Possible values:
        *automatic | specify*. Default: *automatic*

        For *automatic* , residue number after highest residue number of
        ATOM records is used as the starting residue number for HETATM
        records.

        For *specify*, value of option --ResidueNumberStarHetatm is used as
        the starting residue number for HETATM records.

        This option along with --ResidueNumberStartHetatm only applies to
        HETATM records outside the chains.

    --ResidueNumberStartHetatm *number*
        Starting residue number to use for HETATM records. Default: *6000*.
        Valid values positive integers.

    -r, --root *rootname*
        New PDB and sequence file name is generated using the root:
        <Root><Mode>.<Ext>. Default new file name: <PDBFileName><Mode>.pdb.
        This option is ignored for multiple input files.

    --WaterResidueNames *Automatic | "ResidueName,[ResidueName,...]"*
        Identification of water residues during *RenumberWaters* value of
        -m, --mode option. Possible values: *Automatic |
        "ResidueName,[ResidueName,...]"*. Default: *Automatic* which
        corresponds to "HOH,WAT,H20". You can also specify a different comma
        delimited list of residue names to use for water.

    --WaterResidueStart *number*
        Starting water residue number to use during *RenumberWaters* -m,
        --mode value. Default: *8000*. Valid values: positive integers.

    -w, --WorkingDir *dirname*
        Location of working directory. Default: current directory.

EXAMPLES
    To renumber ATOM and HETATM residues starting from 1 for each chain with
    continuation to HETATM residues outside TER records in Sample2.pdb and
    generate Sample2RenumberResidues.pdb file, type:

        % ModifyPDBFiles.pl Sample1.pdb

    To renumber ATOM and HETATM residues sequentially across all chains
    starting from 1 with continuation to HETATM residues outside TER records
    in Sample2.pdb and generate Sample2RenumberResidues.pdb file, type:

        % ModifyPDBFiles.pl --ResidueNumberMode Sequential -o Sample1.pdb

    To renumber ATOM and HETATM residues sequentially across all chains
    starting from 1 and HETATM residues outside TER records starting from
    6000 in Sample2.pdb and generate Sample2RenumberResidues.pdb file, type:

        % ModifyPDBFiles.pl --ResidueNumberMode Sequential
          --ResidueNumberHetatmMode Specify  -o Sample1.pdb

    To renumber ATOM and HETATM residues sequentially across all chains
    starting from 100 for ATOM/HETATM residues with in TER records and
    starting from 999 for HETATM residues outside TER records in Sample2.pdb
    and generate Sample2RenumberResidues.pdb file, type:

        % ModifyPDBFiles.pl --ResidueNumberMode Sequential
          --ResidueNumberHetatmMode Specify --ResidueNumberStart 100
          --ResidueNumberStartHetatm 999 -o Sample2.pdb

    To renumber ATOM and HETATM residues from 100 for each chain and
    starting from 999 for HETATM residues outside TER records in Sample2.pdb
    and generate Sample2RenumberResidues.pdb file, type:

        % ModifyPDBFiles.pl --ResidueNumberMode PerChain
          --ResidueNumberHetatmMode Specify --ResidueNumberStart 100
          --ResidueNumberStartHetatm 999 -o Sample2.pdb

    To renumber ATOM serial numbers sequentially starting from 100 in
    Sample1.pdb file and generate Sample1RenumberAtoms.pdb file, type:

        % ModifyPDBFiles.pl -m RenumberAtoms --AtomNumberStart 100
          -o Sample1.pdb

    To renumber water residues identified by "HOH,WAT" starting from residue
    number 1000 in Sample2.pdb file and generate Sample2RenumberWaters.pdb
    file, type:

        % ModifyPDBFiles.pl -m RenumberWaters --WaterResidueNames "HOH,WAT"
          -o --WaterResidueStart 950 Sample2.pdb

    To rename all chain IDs starting from A in Sample1.pdb file and generate
    Sample1RenameChainIDs.pdb file, type:

        % ModifyPDBFiles.pl -m RenameChainIDs -o Sample1.pdb

    To rename all chain IDs starting from B without assigning any chain IDs
    to ATOM/HETATOM with no chain IDs in Sample2.pdb file and generate
    Sample2RenameChainIDs.pdb file, type:

        % ModifyPDBFiles.pl l -m RenameChainIDs -c B --ChainIDRenameEmpty No
          -o Sample2.pdb

AUTHOR
    Manish Sud <msud@san.rr.com>

SEE ALSO
    ExtractFromPDBFiles.pl, InfoPDBFiles.pl

COPYRIGHT
    Copyright (C) 2018 Manish Sud. All rights reserved.

    This file is part of MayaChemTools.

    MayaChemTools is free software; you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 3 of the License, or (at
    your option) any later version.

