| @@ 22-72 (lines=51) @@ | ||
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | def get_parser(): |
|
| 23 | parser = argparse.ArgumentParser( |
|
| 24 | description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) |
|
| 25 | ||
| 26 | #parser.add_argument('-', "--", help="", default="") |
|
| 27 | ||
| 28 | parser.add_argument('--save-to-file', help='<pdb>.fa', action='store_true') |
|
| 29 | ||
| 30 | parser.add_argument('--compact', |
|
| 31 | help=textwrap.dedent("""with --get-seq, get it in compact view' |
|
| 32 | $ rna_pdb_tools.py --get-seq --compact *.pdb |
|
| 33 | # 20_Bujnicki_1 |
|
| 34 | ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68 |
|
| 35 | # 20_Bujnicki_2 |
|
| 36 | ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68 |
|
| 37 | # 20_Bujnicki_3 |
|
| 38 | ACCCGCAAGGCCGACGGCGCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU # A:1-68 |
|
| 39 | # 20_Bujnicki_4 |
|
| 40 | ||
| 41 | """), action='store_true') |
|
| 42 | ||
| 43 | parser.add_argument('--color-seq', help='color seq, works with --get-seq', action='store_true') |
|
| 44 | ||
| 45 | parser.add_argument('--chain-first', help="", action='store_true') |
|
| 46 | ||
| 47 | parser.add_argument('--fasta', |
|
| 48 | help= textwrap.dedent("""with --get-seq, show sequences in fasta format, |
|
| 49 | can be combined with --compact (mind, chains will be separated with ' ' in one line) |
|
| 50 | ||
| 51 | $ rna_pdb_tools.py --get-seq --fasta --compact input/20_Bujnicki_1.pdb |
|
| 52 | > 20_Bujnicki_1 |
|
| 53 | ACCCGCAAGGCCGACGGC GCCGCCGCUGGUGCAAGUCCAGCCACGCUUCGGCGUGGGCGCUCAUGGGU |
|
| 54 | ||
| 55 | """), action='store_true') |
|
| 56 | parser.add_argument('--oneline', help="", action='store_true') |
|
| 57 | ||
| 58 | ||
| 59 | parser.add_argument('--uniq', help=textwrap.dedent(""" |
|
| 60 | rna_pdb_tools.py --get-seq --uniq '[:5]' --compact --chain-first * | sort |
|
| 61 | A:1-121 ACCUUGCGCAACUGGCGAAUCCUGGGGCUGCCGCCGGCAGUACCC...CA # rp13nc3295_min.out.1 |
|
| 62 | A:1-123 ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # rp13cp0016_min.out.1 |
|
| 63 | A:1-123 ACCUUGCGCGACUGGCGAAUCCUGAAGCUGCUUUGAGCGGCUUCG...AG # zcp_6537608a_ALL-000001_AA |
|
| 64 | A:1-45 57-71 GGGUCGUGACUGGCGAACAGGUGGGAAACCACCGGGGAGCGACCCGCCGCCCGCCUGGGC # solution |
|
| 65 | """)) |
|
| 66 | ||
| 67 | parser.add_argument('--renum-atoms', help='renumber atoms, tested with --get-seq', |
|
| 68 | action='store_true') |
|
| 69 | parser.add_argument("-v", "--verbose", |
|
| 70 | action="store_true", help="be verbose") |
|
| 71 | parser.add_argument("file", help="", default="") # nargs='+') |
|
| 72 | return parser |
|
| 73 | ||
| 74 | ||
| 75 | if __name__ == '__main__': |
|
| @@ 240-258 (lines=19) @@ | ||
| 237 | return l |
|
| 238 | ||
| 239 | ||
| 240 | def get_parser(): |
|
| 241 | parser = argparse.ArgumentParser( |
|
| 242 | description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) |
|
| 243 | ||
| 244 | parser.add_argument('-t',"--target", |
|
| 245 | help="target file") |
|
| 246 | parser.add_argument('--result', #default='out.rmsd', |
|
| 247 | help="result file") |
|
| 248 | parser.add_argument('--ignore-files', default='aligned', help="use to ignore files, .e.g. with 'aligned'") |
|
| 249 | parser.add_argument('--suffix', default='aligned', help="used with --saved, by default: aligned") |
|
| 250 | parser.add_argument('--way', help="e.g., backbone+sugar") |
|
| 251 | parser.add_argument('--triple-mode', help="same crazy strategy to align triples", action="store_true") |
|
| 252 | parser.add_argument('--column-name', help="name column for rmsd, by default 'rmsd', but can also be a name of the target file", |
|
| 253 | default="rmsd") |
|
| 254 | parser.add_argument("-s", "--save", action="store_true", help="set suffix with --suffix, by default: aligned") |
|
| 255 | parser.add_argument('files', help='files', nargs='+') |
|
| 256 | parser.add_argument("--debug", action="store_true") |
|
| 257 | parser.add_argument("--sort", action="store_true", help='sort results based on rmsd (ascending)') |
|
| 258 | return parser |
|
| 259 | ||
| 260 | # main |
|
| 261 | if __name__ == '__main__': |
|
| @@ 103-118 (lines=16) @@ | ||
| 100 | import argparse |
|
| 101 | import os |
|
| 102 | ||
| 103 | def get_parser(): |
|
| 104 | parser = argparse.ArgumentParser( |
|
| 105 | description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) |
|
| 106 | ||
| 107 | parser.add_argument('csv1', help="", default="") |
|
| 108 | parser.add_argument('--sep1', help="default is ,; can be also '\t'", default=",") |
|
| 109 | parser.add_argument('csv2', help="", default="") |
|
| 110 | parser.add_argument('--sep2', help="default is ,; can be also '\t'", default=",") |
|
| 111 | parser.add_argument('mergeon', help="merge on column", default="") |
|
| 112 | parser.add_argument('--how', help="inner | left | right | outer, default inner", default="inner") |
|
| 113 | parser.add_argument('--validate', help="default: one_to_one", default="one_to_one") |
|
| 114 | parser.add_argument("-v", "--verbose", |
|
| 115 | action="store_true", help="be verbose") |
|
| 116 | parser.add_argument('--output', help="output csv", default="merged.csv") |
|
| 117 | parser.add_argument('--force-writing-output', action="store_true") |
|
| 118 | return parser |
|
| 119 | ||
| 120 | ||
| 121 | if __name__ == '__main__': |
|