chip-job-ccat-format-bed 975 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python
import argparse
import os

# The ccat output is *mostly* correct, however simply sorting is not enough
# as the fourth column labels are not done in correct chromosome order
# After sorting the output looks like this:
# chr1    3086860 3087035 ccat_131620  4   0   5.483551    0.577000
# chr1    3318040 3318245 ccat_131610  4   0   5.483551    0.577000
# chr1    3372210 3372465 ccat_87299  5   0   6.854439    0.462000
# When it should look like this:
# chr1    3086860 3087035 ccat_0  4   0   5.483551    0.577000    -1
# chr1    3318040 3318245 ccat_1  4   0   5.483551    0.577000    -1
# chr1    3372210 3372465 ccat_2  5   0   6.854439    0.462000    -1

parser = argparse.ArgumentParser(description = "Format ccat result files.")
parser.add_argument("--input", "-i", dest="input", required=True, help="Path to input ccat file.")
parser.add_argument("--output", "-o", dest="output", required=True, help="Output file to write formatted results.")