comparison zinbra_wrapper.py @ 10:eccf47de1192 draft default tip

Deleted selected files
author jetbrains
date Fri, 12 Oct 2018 06:05:06 -0400
parents 0bf15064d38e
children
comparison
equal deleted inserted replaced
9:0bf15064d38e 10:eccf47de1192
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)