Mercurial > repos > portiahollyoak > pindel
annotate create_config_file.py @ 0:dd513c72ea56 draft
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
author | portiahollyoak |
---|---|
date | Tue, 17 May 2016 04:47:23 -0400 |
parents | |
children |
rev | line source |
---|---|
0
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
1 import argparse |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
2 |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
3 |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
4 description = ("This script will create a configuration file for samples to be run in Pindel") |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
5 |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
6 |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
7 parser = argparse.ArgumentParser() |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
8 parser.add_argument("--input_file", nargs="*", help="One or more alignment files") |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
9 parser.add_argument("--insert_size", nargs="+", help="Expected Insert size") |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
10 parser.add_argument("--sample_label", nargs="+", help="Sample label") |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
11 parser.add_argument("--output_config_file", help="Output config file") |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
12 args = parser.parse_args() |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
13 |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
14 template = "{input_file}\t{insert_size}\t{sample_label}\n" |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
15 with open(args.output_config_file, "w") as output: |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
16 for input_file, insert_size, sample_label in zip(args.input_file, args.insert_size, args.sample_label): |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
17 config_line = template.format(input_file=input_file, insert_size=insert_size, sample_label=sample_label) |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
18 output.write(config_line) |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
19 |
dd513c72ea56
planemo upload for repository https://github.com/portiahollyoak/Tools commit 1f1c277219ca756c9baa453592b455597fd593d8-dirty
portiahollyoak
parents:
diff
changeset
|
20 |