Mercurial > repos > jetbrains > zinbra
annotate zinbra.py @ 6:7d532e820976
Support comparison in zinbra. 3fba761
author | oleg@oleg-desktop.times.labs.intellij.net |
---|---|
date | Wed, 28 Oct 2015 20:08:20 +0300 |
parents | 0eb50728861a |
children |
rev | line source |
---|---|
0 | 1 #!/usr/bin/env python |
2 """ | |
3 Python wrapper for zinbra.xml | |
4 """ | |
5 | |
6 import os | |
7 import sys | |
8 import subprocess | |
9 | |
10 argv = sys.argv[1:] | |
11 print 'Arguments {0}'.format(argv) | |
6
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
12 |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
13 # Check command |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
14 if len(argv) == 5: |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
15 genome, bin, fdr, action, bed = argv |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
16 assert action == "analyze" |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
17 else: |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
18 genome, bin, fdr, action, bed1, bed2 = argv |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
19 assert action == "compare" |
0 | 20 |
21 # Configure main jar path | |
2 | 22 jar = os.environ.get("INTEGRATION_JAR") |
1 | 23 print 'Using JAR distributive file {0}'.format(jar) |
0 | 24 |
1 | 25 cmd = 'java -cp {0} org.jetbrains.bio.genestack.FastaToTwoBitCLA {1} reference.2bit'.format(jar, genome) |
26 print 'Converting reference genome fasta to 2bit: {0}'.format(cmd) | |
27 subprocess.check_call(cmd, cwd=None, shell=True) | |
0 | 28 |
29 # See https://github.com/JetBrains-Research/zinbra for command line options | |
6
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
30 if action == "analyze": |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
31 cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \ |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
32 'analyze -i {1} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed, bin, fdr) |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
33 else: |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
34 cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \ |
7d532e820976
Support comparison in zinbra. 3fba761
oleg@oleg-desktop.times.labs.intellij.net
parents:
2
diff
changeset
|
35 'compare -1 {1} -2 {2} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar, bed1, bed2, bin, fdr) |
0 | 36 print 'Launching zinbra: {0}'.format(cmd) |
37 subprocess.check_call(cmd, cwd=None, shell=True) |