makeBashScripts.py 1.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python
# encoding: utf-8
"""
makeBashScripts.py
"""

import sys
import os


def main():
    tool_map =  {'annotate': 'annotateBed', 
                 'bamtobed': 'bamToBed', 
                 'bed12tobed6': 'bed12ToBed6', 
                 'bedpetobam': 'bedpeToBam', 
                 'bedtobam': 'bedToBam', 
17
                 'closest': 'closestBed',
18
                 'cluster': 'clusterBed',
19
20
21
22
                 'complement': 'complementBed',
                 'coverage': 'coverageBed', 
                 'flank': 'flankBed', 
                 'genomecov': 'genomeCoverageBed', 
23
24
                 'getfasta': 'fastaFromBed',
                 'groupby': 'groupBy',
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
                 'igv': 'bedToIgv', 
                 'intersect': 'intersectBed', 
                 'links': 'linksBed', 
                 'maskfasta': 'maskFastaFromBed', 
                 'merge': 'mergeBed', 
                 'multicov': 'multiBamCov', 
                 'multiinter': 'multiIntersectBed', 
                 'nuc': 'nucBed',
                 'overlap': 'getOverlap', 
                 'pairtobed': 'pairToBed', 
                 'pairtopair': 'pairToPair', 
                 'shuffle': 'shuffleBed', 
                 'slop': 'slopBed', 
                 'sort': 'sortBed', 
                 'subtract': 'subtractBed', 
                 'tag': 'tagBam', 
                 'unionbedg': 'unionBedGraphs', 
Aaron's avatar
Aaron committed
42
43
                 'window': 'windowBed',
                 'makewindows': 'windowMaker'}
44
45
46
47
48
49
50
51

    # create a BASH script for each old tool, mapping to the new CLI command.
    for tool in tool_map:
        new = tool
        old = tool_map[tool]
        
        script = open('bin/'  + old, 'w')
        script.write("#!/bin/sh\n")
Aaron's avatar
fix    
Aaron committed
52
        script.write("bedtools " + new + " \"$@\"\n")
53
54
55
56
        script.close()

if __name__ == "__main__":
    main()