comparison zinbra_wrapper.py @ 7:617b5857ce96

Snapshot 61f45be of dev repo
author oleg@oleg-desktop.times.labs.intellij.net
date Thu, 29 Oct 2015 11:57:02 +0300
parents
children
comparison
equal deleted inserted replaced
6:7d532e820976 7:617b5857ce96
1 #!/usr/bin/env python
2
3 import os
4 import sys
5 import subprocess
6
7 argv = sys.argv[1:]
8 print 'Arguments {0}'.format(argv)
9
10 # Check command
11 if len(argv) == 5:
12 genome, bin, fdr, action, bed = argv
13 assert action == "analyze"
14 else:
15 genome, bin, fdr, action, bed1, bed2 = argv
16 assert action == "compare"
17
18 # Configure main jar path
19 jar = os.environ.get("INTEGRATION_JAR")
20 print 'Using JAR distributive file {0}'.format(jar)
21
22 cmd = 'java -cp {0} org.jetbrains.bio.genestack.FastaToTwoBitCLA {1} reference.2bit'.format(jar, genome)
23 print 'Converting reference genome fasta to 2bit: {0}'.format(cmd)
24 subprocess.check_call(cmd, cwd=None, shell=True)
25
26 # See https://github.com/JetBrains-Research/zinbra for command line options
27 if action == "analyze":
28 cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \
29 'analyze -i {1} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed, bin, fdr)
30 else:
31 cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \
32 'compare -1 {1} -2 {2} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed1, bed2, bin, fdr)
33 print 'Launching zinbra: {0}'.format(cmd)
34 subprocess.check_call(cmd, cwd=None, shell=True)