0
|
1 #!/usr/bin/env python
|
|
2 """
|
|
3 Python wrapper for zinbra.xml
|
|
4 Usage: zinbra.py "${genome}" "${bed}" "${bin}" "${fdr}"
|
|
5 """
|
|
6
|
|
7 import os
|
|
8 import sys
|
|
9 import subprocess
|
|
10
|
|
11 argv = sys.argv[1:]
|
|
12 print 'Arguments {0}'.format(argv)
|
|
13 genome, bed, bin, fdr = argv
|
|
14
|
|
15 # Configure main jar path
|
2
|
16 jar = os.environ.get("INTEGRATION_JAR")
|
1
|
17 print 'Using JAR distributive file {0}'.format(jar)
|
0
|
18
|
1
|
19 cmd = 'java -cp {0} org.jetbrains.bio.genestack.FastaToTwoBitCLA {1} reference.2bit'.format(jar, genome)
|
|
20 print 'Converting reference genome fasta to 2bit: {0}'.format(cmd)
|
|
21 subprocess.check_call(cmd, cwd=None, shell=True)
|
0
|
22
|
|
23 # See https://github.com/JetBrains-Research/zinbra for command line options
|
|
24 # cla.argument_string_list() is configured at ZinbraApplications#rebuildArgumentStringsFromVisualOptions
|
|
25 cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \
|
1
|
26 'analyze -i {1} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar,
|
|
27 bed,
|
|
28 bin, fdr)
|
0
|
29 print 'Launching zinbra: {0}'.format(cmd)
|
|
30 subprocess.check_call(cmd, cwd=None, shell=True)
|