Example #1
0
def get_parser():
    version = os.path.basename(os.path.dirname(
        os.path.abspath(__file__))), get_version(__file__)
    version = version[1].strip()
    parser = argparse.ArgumentParser(
        description=__doc__, formatter_class=argparse.RawTextHelpFormatter)

    parser.add_argument('--version',
                        help='',
                        action='version',
                        version=version)

    parser.add_argument('-r',
                        '--report',
                        help='get report',
                        action='store_true')

    parser.add_argument('--no-progress-bar',
                        help='for --no-progress-bar for --rpr',
                        action='store_true')

    parser.add_argument('--renum-atoms',
                        help='renumber atoms, tested with --get-seq',
                        action='store_true')

    parser.add_argument('--renum-nmr', help='', action='store_true')

    parser.add_argument('--renum-residues-dirty', help='', action='store_true')

    parser.add_argument(
        '--undo',
        help=
        'undo operation of action done --inplace, , rename "backup files" .pdb~ to pdb, ALL files in the folder, not only ~ related to the last action (that you might want to revert, so be careful)',
        action='store_true')

    parser.add_argument(
        '--delete-anisou',
        help='remove files with ANISOU records, works with --inplace',
        action='store_true')

    parser.add_argument(
        '--fix',
        help=
        'fix a PDB file, ! external program, pdbfixer used to fix missing atoms',
        action='store_true')

    parser.add_argument(
        '--to-mol2',
        help=
        'fix a PDB file, ! external program, pdbfixer used to fix missing atoms',
        action='store_true')

    parser.add_argument('--split-alt-locations',
                        help='@todo',
                        action='store_true')

    parser.add_argument('-c',
                        '--clean',
                        help='get clean structure',
                        action='store_true')

    parser.add_argument('--is-pdb',
                        help='check if a file is in the pdb format',
                        action='store_true')

    parser.add_argument('--is-nmr',
                        help='check if a file is NMR-style multiple model pdb',
                        action='store_true')

    parser.add_argument(
        '--nmr-dir',
        help='make NMR-style multiple model pdb file from a set of files \n\n'
        +
        "  rna_pdb_toolsx.py --nmr-dir . 'cwc15_u5_fragments*.pdb' > ~/Desktop/cwc15-u5.pdb\n\n"
        +
        "please use '' for pattern file recognition, this is a hack to deal with folders with\n"
        "thousands of models, if you used only *.pdb then the terminal will complain that you\n"
        "selected to many files.")

    parser.add_argument(
        '--un-nmr',
        help=
        'split NMR-style multiple model pdb files into individual models [biopython]',
        action='store_true')

    parser.add_argument('--orgmode',
                        help='get a structure in org-mode format <sick!>',
                        action='store_true')

    parser.add_argument(
        '--get-chain',
        help='get chain, one or many, e.g, A, but now also ABC works')

    parser.add_argument(
        '--fetch',
        action='store_true',
        help='fetch file from the PDB db, e.g., 1xjr,\nuse \'rp\' to fetch' +
        'the RNA-Puzzles standardized_dataset [around 100 MB]')

    parser.add_argument('--fetch-ba',
                        action='store_true',
                        help='fetch biological assembly from the PDB db')

    parser.add_argument('--fetch-chain',
                        action='store_true',
                        help='fetch a structure in extract chain, e.g. 6bk8 H')

    parser.add_argument('--get-seq', help='get seq', action='store_true')

    parser.add_argument('--color-seq',
                        help='color seq, works with --get-seq',
                        action='store_true')

    parser.add_argument('--ignore-files',
                        help='files to be ingored, .e.g, \'solution\'')

    parser.add_argument(
        '--compact',
        help=textwrap.dedent("""with --get-seq, get it in compact view'
$ rna_pdb_toolsx.py --get-seq --compact *.pdb
# 20_Bujnicki_1
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_2
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_3
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_4

"""),
        action='store_true')

    parser.add_argument(
        '--hide-warnings',
        help=
        'hide warnings, works with --get-chain, it hides warnings that given changes are not detected in a PDB file',
        action='store_true')

    parser.add_argument('--get-ss',
                        help='get secondary structure',
                        action='store_true')

    parser.add_argument('--rosetta2generic',
                        help='convert ROSETTA-like format to a generic pdb',
                        action='store_true')

    parser.add_argument('--no-hr',
                        help='do not insert the header into files',
                        action='store_true')

    parser.add_argument('--renumber-residues',
                        help='by defult is false',
                        action='store_true')

    parser.add_argument(
        '--dont-rename-chains',
        help=textwrap.dedent("""used only with --get-rnapuzzle-ready.
By default:
   --get-rnapuzzle-ready rename chains from ABC.. to stop behavior switch on this option
"""),
        action='store_true')

    parser.add_argument('--dont-fix-missing-atoms',
                        help="""used only with --get-rnapuzzle-ready""",
                        action='store_true')

    parser.add_argument(
        '--inspect',
        help=
        "inspect missing atoms (technically decorator to --get-rnapuzzle-ready without actually doing anything but giving a report on problems)",
        action='store_true')

    parser.add_argument('--collapsed-view', help='', action='store_true')

    parser.add_argument('--cv',
                        help='alias to collapsed_view',
                        action='store_true')

    parser.add_argument('-v',
                        '--verbose',
                        help='tell me more what you\'re doing, please!',
                        action='store_true')

    parser.add_argument('--mutate',
                        help=textwrap.dedent("""mutate residues,
e.g.,
      --mutate "A:1a+2a+3a+4a,B:1a"
to mutate to adenines the first four nucleotides of the chain A
and the first nucleotide of the chain B"""))

    parser.add_argument('--edit',
                        dest="edit",
                        default='',
                        help="edit 'A:6>B:200', 'A:2-7>B:2-7'")

    parser.add_argument('--rename-chain',
                        help="edit 'A>B' to rename chain A to chain B")

    parser.add_argument('--swap-chains',
                        help='B>A, rename A to _, then B to A, then _ to B')

    parser.add_argument(
        '--set-chain',
        help='set chain for all ATOM lines and TER (quite brutal function)')

    parser.add_argument(
        '--replace-chain',
        default='',
        help=textwrap.dedent(
            """a file PDB name with one chain that will be used to
replace the chain in the original PDB file,
the chain id in this file has to be the same with the chain id of the original chain"""
        ))

    parser.add_argument(
        '--delete',  # type="string",
        dest="delete",
        default='',
        help=
        "delete the selected fragment, e.g. A:10-16, or for more than one fragment --delete 'A:1-25+30-57'"
    )

    parser.add_argument(
        '--extract',  # type="string",
        dest="extract",
        default='',
        help=
        "extract the selected fragment, e.g. A:10-16, or for more than one fragment --extract 'A:1-25+30-57'"
    )

    parser.add_argument('--extract-chain', help="extract chain, e.g. A")

    parser.add_argument('--uniq',
                        help=textwrap.dedent("""
rna_pdb_toolsx.py --get-seq --uniq '[:5]' --compact --chain-first * | sort
A:1-121        ACCUUGCGCAACUGGCGAAUCCUGGGGCUGCCGCCGGCAGUACCC...CA # rp13nc3295_min.out.1
A:1-123        ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # rp13cp0016_min.out.1
A:1-123        ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # zcp_6537608a_ALL-000001_AA
A:1-45 57-71   GGGUCGUGACUGGCGAACAGGUGGGAAACCACCGGGGAGCGACCCGCCGCCCGCCUGGGC # solution
"""))

    parser.add_argument('--chain-first', help="", action='store_true')
    parser.add_argument('--oneline', help="", action='store_true')

    parser.add_argument('--replace-htm', help="", action='store_true')

    parser.add_argument(
        '--fasta',
        help=textwrap.dedent("""with --get-seq, show sequences in fasta format,
can be combined with --compact (mind, chains will be separated with ' ' in one line)

$ rna_pdb_toolsx.py --get-seq --fasta --compact input/20_Bujnicki_1.pdb
> 20_Bujnicki_1
ACCCGCAAGGCCGACGGC GCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU

"""),
        action='store_true')

    parser.add_argument('--cif2pdb',
                        help="[PyMOL Python package required]",
                        action='store_true')
    parser.add_argument('--pdb2cif',
                        help="[PyMOL Python package required]",
                        action='store_true')

    parser.add_argument(
        '--mdr',
        help='get structures ready for MD (like rpr but without first)',
        action='store_true')

    x = parser.add_argument_group('RNAPUZZLE-READY')
    x.add_argument('--get-rnapuzzle-ready',
                   help=textwrap.dedent(
                       """get RNApuzzle ready (keep only standard atoms).'
Be default it does not renumber residues, use --renumber-residues
[requires BioPython]"""),
                   action='store_true')

    x.add_argument('--rpr',
                   help='alias to get_rnapuzzle ready)',
                   action='store_true')

    rpr = parser.add_argument_group(
        'CAN BE COMBINED WITH'
    )  # --get-rnapuzzle-ready (or --rpr) can be combined with')

    rpr.add_argument('--keep-hetatm',
                     help='keep hetatoms',
                     action='store_true')

    rpr.add_argument(
        '--inplace',
        help=textwrap.dedent("""in place edit the file! [experimental,
only for get_rnapuzzle_ready, --delete, --get-ss, --get-seq, --edit-pdb]"""),
        action='store_true')

    rpr.add_argument(
        '--here',
        help=textwrap.dedent(
            """save a file next to the original file with auto suffix
for --extract it's .extr.pdb"""),
        action='store_true')

    rpr.add_argument(
        '--suffix',
        help=textwrap.dedent(
            """when used with --inplace allows you to change a name of a new file, --suffix del will give <file>_del.pdb (mind added _)"""
        ))

    rpr.add_argument(
        '--replace-hetatm',
        help=
        "replace 'HETATM' with 'ATOM' [tested only with --get-rnapuzzle-ready]",
        action="store_true")

    rpr.add_argument('--dont-report-missing-atoms',
                     help="""used only with --get-rnapuzzle-ready""",
                     action='store_true')

    rpr.add_argument(
        '--backbone-only',
        help=
        """used only with --get-rnapuzzle-ready, keep only backbone (= remove bases)""",
        action='store_true')

    rpr.add_argument(
        '--no-backbone',
        help=
        """used only with --get-rnapuzzle-ready, remove atoms of backbone (define as P OP1 OP2 O5')""",
        action='store_true')

    rpr.add_argument(
        '--bases-only',
        help=
        """used only with --get-rnapuzzle-ready, keep only atoms of bases""",
        action='store_true')

    parser.add_argument('file', help='file', nargs='+')
    #parser.add_argument('outfile', help='outfile')
    return parser
Example #2
0
    rpr.add_argument(
        '--bases-only',
        help=
        """used only with --get-rnapuzzle-ready, keep only atoms of bases""",
        action='store_true')

    parser.add_argument('file', help='file', nargs='+')
    #parser.add_argument('outfile', help='outfile')
    return parser


# main
if __name__ == '__main__':
    # get version
    version = os.path.basename(os.path.dirname(
        os.path.abspath(__file__))), get_version(__file__)
    version = version[1].strip()

    # get parser and arguments
    parser = get_parser()

    args = parser.parse_args()

    # quick fix for one files vs file-s
    if list == type(args.file) and len(args.file) == 1:
        args.file = args.file[0]

    if args.report:
        s = RNAStructure(args.file)
        print(s.get_report)
        print(s.get_preview())
Example #3
0
$ rna_pdb_toolsx.py --get_seq --fasta --compact input/20_Bujnicki_1.pdb
> 20_Bujnicki_1
ACCCGCAAGGCCGACGGC GCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU

"""), action='store_true')

    parser.add_argument('file', help='file', nargs='+')
    #parser.add_argument('outfile', help='outfile')
    return parser


# main
if __name__ == '__main__':
    # get version
    version = os.path.basename(os.path.dirname(os.path.abspath(__file__))), get_version(__file__)
    version = version[1].strip()

    # get parser and arguments
    parser = get_parser()

    args = parser.parse_args()

    # quick fix for one files vs file-s
    if list == type(args.file) and len(args.file) == 1:
        args.file = args.file[0]

    if args.report:
        s = RNAStructure(args.file)
        print(s.get_report)
        print(s.get_preview())
Example #4
0
def get_parser():
    version = os.path.basename(os.path.dirname(os.path.abspath(__file__))), get_version(__file__)
    version = version[1].strip()
    parser = argparse.ArgumentParser(
        description=__doc__, formatter_class=argparse.RawTextHelpFormatter)

    parser.add_argument('--version', help='', action='version', version=version)

    parser.add_argument('-r', '--report', help='get report',
                        action='store_true')

    parser.add_argument('--delete-anisou', help='remove files with ANISOU records, works with --inplace',
                        action='store_true')

    parser.add_argument('--split-alt-locations', help='@todo',
                        action='store_true')

    parser.add_argument('-c', '--clean', help='get clean structure',
                        action='store_true')

    parser.add_argument('--is_pdb', help='check if a file is in the pdb format',
                        action='store_true')

    parser.add_argument('--is_nmr', help='check if a file is NMR-style multiple model pdb',
                        action='store_true')

    parser.add_argument('--un_nmr', help='Split NMR-style multiple model pdb files into individual models [biopython]',
                        action='store_true')

    parser.add_argument('--orgmode', help='get a structure in org-mode format <sick!>',
                        action='store_true')

    parser.add_argument('--get_chain', help='get chain, .e.g A')

    parser.add_argument('--fetch', action='store_true', help='fetch file from the PDB db')

    parser.add_argument('--fetch_ba', action='store_true',
                        help='fetch biological assembly from the PDB db')

    parser.add_argument('--get_seq', help='get seq', action='store_true')
    parser.add_argument('--compact',
                        help=textwrap.dedent("""with --get_seq, get it in compact view'
$ rna_pdb_toolsx.py --get_seq --compact *.pdb
# 20_Bujnicki_1
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_2
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_3
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_4

"""), action='store_true')

    parser.add_argument('--get_ss', help='get secondary structure', action='store_true')

    parser.add_argument('--rosetta2generic', help='convert ROSETTA-like format to a generic pdb',
                        action='store_true')

    parser.add_argument('--get_rnapuzzle_ready',
                        help=textwrap.dedent("""get RNApuzzle ready (keep only standard atoms).'
Be default it does not renumber residues, use --renumber_residues
[requires BioPython]"""), action='store_true')

    parser.add_argument('--rpr', help='alias to get_rnapuzzle ready)',
                        action='store_true')

    parser.add_argument('--no_hr', help='do not insert the header into files',
                        action='store_true')

    parser.add_argument('--renumber_residues', help='by defult is false',
                        action='store_true')

    parser.add_argument('--dont_rename_chains',
                        help=textwrap.dedent("""used only with --get_rnapuzzle_ready.
By default:
   --get_rnapuzzle_ready rename chains from ABC.. to stop behavior switch on this option
"""),
                        action='store_true')

    parser.add_argument('--dont_fix_missing_atoms',
                        help="""used only with --get_rnapuzzle_ready""",
                        action='store_true')

    parser.add_argument('--dont_report_missing_atoms',
                        help="""used only with --get_rnapuzzle_ready""",
                        action='store_true')

    parser.add_argument('--collapsed_view', help='',
                        action='store_true')

    parser.add_argument('--cv', help='alias to collapsed_view',
                        action='store_true')

    parser.add_argument('-v', '--verbose', help='tell me more what you\'re doing, please!',
                        action='store_true')

    parser.add_argument('--replace_hetatm', help="replace 'HETATM' with 'ATOM' [tested only with --get_rnapuzzle_ready]",
                        action="store_true")

    parser.add_argument('--inplace', help=textwrap.dedent("""in place edit the file! [experimental,
only for get_rnapuzzle_ready, delete, get_ss, get_seq, edit_pdb]"""),
                        action='store_true')

    parser.add_argument('--mutate', help=textwrap.dedent("""mutate residues,
 e.g. A:1A+2A+3A+4A,B:1A to mutate the first nucleotide of the A chain to Adenine
 etc and the first nucleotide of the B chain"""))

    parser.add_argument('--edit',
                        dest="edit",
                        default='',
                        help="edit 'A:6>B:200', 'A:2-7>B:2-7'")

    parser.add_argument('--rename-chain',
                        help="edit 'A>B' to rename chain A to chain B")

    parser.add_argument('--replace-chain',
                        default='',
                        help=textwrap.dedent("""a file PDB name with one chain that will be used to
replace the chain in the original PDB file,
the chain id in this file has to be the same with the chain id of the original chain"""))

    parser.add_argument('--delete',  # type="string",
                        dest="delete",
                        default='',
                        help="delete the selected fragment, e.g. A:10-16, or for more than one fragment --delete 'A:1-25+30-57'")

    parser.add_argument('--extract',  # type="string",
                        dest="extract",
                        default='',
                        help="extract the selected fragment, e.g. A:10-16, or for more than one fragment --extract 'A:1-25+30-57'")

    parser.add_argument('--uniq', help=textwrap.dedent("""
rna_pdb_toolsx.py --get_seq --uniq '[:5]' --compact --chain-first * | sort
A:1-121        ACCUUGCGCAACUGGCGAAUCCUGGGGCUGCCGCCGGCAGUACCC...CA # rp13nc3295_min.out.1
A:1-123        ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # rp13cp0016_min.out.1
A:1-123        ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # zcp_6537608a_ALL-000001_AA
A:1-45 57-71   GGGUCGUGACUGGCGAACAGGUGGGAAACCACCGGGGAGCGACCCGCCGCCCGCCUGGGC # solution
"""))

    parser.add_argument('--chain-first', help="", action='store_true')
    parser.add_argument('--oneline', help="", action='store_true')
    parser.add_argument('--fasta',
                        help= textwrap.dedent("""with --get-seq, show sequences in fasta format,
can be combined with --compact (mind, chains will be separated with ' ' in one line)

$ rna_pdb_toolsx.py --get_seq --fasta --compact input/20_Bujnicki_1.pdb
> 20_Bujnicki_1
ACCCGCAAGGCCGACGGC GCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU

"""), action='store_true')

    parser.add_argument('file', help='file', nargs='+')
    #parser.add_argument('outfile', help='outfile')
    return parser
Example #5
0
def get_parser():
    version = os.path.basename(os.path.dirname(
        os.path.abspath(__file__))), get_version(__file__)
    version = version[1].strip()
    parser = argparse.ArgumentParser(
        description=__doc__, formatter_class=argparse.RawTextHelpFormatter)

    parser.add_argument('--version',
                        help='',
                        action='version',
                        version=version)

    parser.add_argument('-r',
                        '--report',
                        help='get report',
                        action='store_true')

    parser.add_argument('--renum-atoms',
                        help='renumber atoms, tested with --get-seq',
                        action='store_true')

    parser.add_argument('--renum-residues-dirty', help='', action='store_true')

    parser.add_argument(
        '--delete-anisou',
        help='remove files with ANISOU records, works with --inplace',
        action='store_true')

    parser.add_argument('--split-alt-locations',
                        help='@todo',
                        action='store_true')

    parser.add_argument('-c',
                        '--clean',
                        help='get clean structure',
                        action='store_true')

    parser.add_argument('--is-pdb',
                        help='check if a file is in the pdb format',
                        action='store_true')

    parser.add_argument('--is-nmr',
                        help='check if a file is NMR-style multiple model pdb',
                        action='store_true')

    parser.add_argument(
        '--nmr-dir',
        help='make NMR-style multiple model pdb file from a set of files \n\n'
        +
        "  rna_pdb_toolsx.py --nmr-dir . 'cwc15_u5_fragments*.pdb' > ~/Desktop/cwc15-u5.pdb\n\n"
        +
        "please use '' for pattern file recognition, this is a hack to deal with folders with\n"
        "thousands of models, if you used only *.pdb then the terminal will complain that you\n"
        "selected to many files.")

    parser.add_argument(
        '--un-nmr',
        help=
        'split NMR-style multiple model pdb files into individual models [biopython]',
        action='store_true')

    parser.add_argument('--orgmode',
                        help='get a structure in org-mode format <sick!>',
                        action='store_true')

    parser.add_argument(
        '--get-chain',
        help='get chain, one or many, e.g, A, but now also ABC works')

    parser.add_argument('--fetch',
                        action='store_true',
                        help='fetch file from the PDB db')

    parser.add_argument('--fetch-ba',
                        action='store_true',
                        help='fetch biological assembly from the PDB db')

    parser.add_argument('--get-seq', help='get seq', action='store_true')
    parser.add_argument(
        '--hide-warnings',
        help=
        'hide warnings, works with --get-chain, it hides warnings that given changes are not detected in a PDB file',
        action='store_true')

    parser.add_argument(
        '--compact',
        help=textwrap.dedent("""with --get-seq, get it in compact view'
$ rna_pdb_toolsx.py --get-seq --compact *.pdb
# 20_Bujnicki_1
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_2
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_3
ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68
# 20_Bujnicki_4

"""),
        action='store_true')

    parser.add_argument('--get-ss',
                        help='get secondary structure',
                        action='store_true')

    parser.add_argument('--rosetta2generic',
                        help='convert ROSETTA-like format to a generic pdb',
                        action='store_true')

    parser.add_argument('--get-rnapuzzle-ready',
                        help=textwrap.dedent(
                            """get RNApuzzle ready (keep only standard atoms).'
Be default it does not renumber residues, use --renumber-residues
[requires BioPython]"""),
                        action='store_true')

    parser.add_argument('--rpr',
                        help='alias to get_rnapuzzle ready)',
                        action='store_true')

    parser.add_argument('--no-hr',
                        help='do not insert the header into files',
                        action='store_true')

    parser.add_argument('--renumber-residues',
                        help='by defult is false',
                        action='store_true')

    parser.add_argument(
        '--dont-rename-chains',
        help=textwrap.dedent("""used only with --get-rnapuzzle-ready.
By default:
   --get-rnapuzzle-ready rename chains from ABC.. to stop behavior switch on this option
"""),
        action='store_true')

    parser.add_argument('--dont-fix-missing-atoms',
                        help="""used only with --get-rnapuzzle-ready""",
                        action='store_true')

    parser.add_argument('--dont-report-missing-atoms',
                        help="""used only with --get-rnapuzzle-ready""",
                        action='store_true')

    parser.add_argument('--collapsed-view', help='', action='store_true')

    parser.add_argument('--cv',
                        help='alias to collapsed_view',
                        action='store_true')

    parser.add_argument('-v',
                        '--verbose',
                        help='tell me more what you\'re doing, please!',
                        action='store_true')

    parser.add_argument(
        '--replace-hetatm',
        help=
        "replace 'HETATM' with 'ATOM' [tested only with --get-rnapuzzle-ready]",
        action="store_true")

    parser.add_argument(
        '--inplace',
        help=textwrap.dedent("""in place edit the file! [experimental,
only for get_rnapuzzle_ready, delete, --get-ss, --get-seq, --edit-pdb]"""),
        action='store_true')

    parser.add_argument('--mutate',
                        help=textwrap.dedent("""mutate residues,
e.g.,
      --mutate "A:1A+2A+3A+4A,B:1A"
to mutate to adenines the first four nucleotides of the chain A
and the first nucleotide of the chain B"""))

    parser.add_argument('--edit',
                        dest="edit",
                        default='',
                        help="edit 'A:6>B:200', 'A:2-7>B:2-7'")

    parser.add_argument('--rename-chain',
                        help="edit 'A>B' to rename chain A to chain B")

    parser.add_argument('--swap-chains',
                        help='B>A, rename A to _, then B to A, then _ to B')

    parser.add_argument(
        '--replace-chain',
        default='',
        help=textwrap.dedent(
            """a file PDB name with one chain that will be used to
replace the chain in the original PDB file,
the chain id in this file has to be the same with the chain id of the original chain"""
        ))

    parser.add_argument(
        '--delete',  # type="string",
        dest="delete",
        default='',
        help=
        "delete the selected fragment, e.g. A:10-16, or for more than one fragment --delete 'A:1-25+30-57'"
    )

    parser.add_argument(
        '--extract',  # type="string",
        dest="extract",
        default='',
        help=
        "extract the selected fragment, e.g. A:10-16, or for more than one fragment --extract 'A:1-25+30-57'"
    )

    parser.add_argument('--extract-chain', help="extract chain, e.g. A")

    parser.add_argument('--uniq',
                        help=textwrap.dedent("""
rna_pdb_toolsx.py --get-seq --uniq '[:5]' --compact --chain-first * | sort
A:1-121        ACCUUGCGCAACUGGCGAAUCCUGGGGCUGCCGCCGGCAGUACCC...CA # rp13nc3295_min.out.1
A:1-123        ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # rp13cp0016_min.out.1
A:1-123        ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # zcp_6537608a_ALL-000001_AA
A:1-45 57-71   GGGUCGUGACUGGCGAACAGGUGGGAAACCACCGGGGAGCGACCCGCCGCCCGCCUGGGC # solution
"""))

    parser.add_argument('--chain-first', help="", action='store_true')
    parser.add_argument('--oneline', help="", action='store_true')
    parser.add_argument(
        '--fasta',
        help=textwrap.dedent("""with --get-seq, show sequences in fasta format,
can be combined with --compact (mind, chains will be separated with ' ' in one line)

$ rna_pdb_toolsx.py --get-seq --fasta --compact input/20_Bujnicki_1.pdb
> 20_Bujnicki_1
ACCCGCAAGGCCGACGGC GCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU

"""),
        action='store_true')

    parser.add_argument('--cif2pdb',
                        help="[PyMOL Python package required]",
                        action='store_true')
    parser.add_argument('--pdb2cif',
                        help="[PyMOL Python package required]",
                        action='store_true')

    parser.add_argument('file', help='file', nargs='+')
    #parser.add_argument('outfile', help='outfile')
    return parser