annotate zinbra.py @ 4:d76a6b6398d4

Noone will paste commit information twice, forget.
author oleg@oleg-desktop.times.labs.intellij.net
date Wed, 28 Oct 2015 19:02:21 +0300
parents 0eb50728861a
children 7d532e820976
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
2 """
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
3 Python wrapper for zinbra.xml
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
4 Usage: zinbra.py "${genome}" "${bed}" "${bin}" "${fdr}"
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
5 """
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
6
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
7 import os
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
8 import sys
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
9 import subprocess
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
10
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
11 argv = sys.argv[1:]
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
12 print 'Arguments {0}'.format(argv)
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
13 genome, bed, bin, fdr = argv
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
14
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
15 # Configure main jar path
2
0eb50728861a Released version:
oleg@oleg-desktop.times.labs.intellij.net
parents: 1
diff changeset
16 jar = os.environ.get("INTEGRATION_JAR")
1
8cbb06892b62 Release version:
Oleg Shpynov <oleg.shpynov@gmail.com>
parents: 0
diff changeset
17 print 'Using JAR distributive file {0}'.format(jar)
0
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
18
1
8cbb06892b62 Release version:
Oleg Shpynov <oleg.shpynov@gmail.com>
parents: 0
diff changeset
19 cmd = 'java -cp {0} org.jetbrains.bio.genestack.FastaToTwoBitCLA {1} reference.2bit'.format(jar, genome)
8cbb06892b62 Release version:
Oleg Shpynov <oleg.shpynov@gmail.com>
parents: 0
diff changeset
20 print 'Converting reference genome fasta to 2bit: {0}'.format(cmd)
8cbb06892b62 Release version:
Oleg Shpynov <oleg.shpynov@gmail.com>
parents: 0
diff changeset
21 subprocess.check_call(cmd, cwd=None, shell=True)
0
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
22
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
23 # See https://github.com/JetBrains-Research/zinbra for command line options
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
24 # cla.argument_string_list() is configured at ZinbraApplications#rebuildArgumentStringsFromVisualOptions
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
25 cmd = 'java -cp {0} org.jetbrains.bio.zinbra.ZinbraCLA ' \
1
8cbb06892b62 Release version:
Oleg Shpynov <oleg.shpynov@gmail.com>
parents: 0
diff changeset
26 'analyze -i {1} -bed result.bed -r reference.2bit -b {3} -fdr {4}'.format(jar,
8cbb06892b62 Release version:
Oleg Shpynov <oleg.shpynov@gmail.com>
parents: 0
diff changeset
27 bed,
8cbb06892b62 Release version:
Oleg Shpynov <oleg.shpynov@gmail.com>
parents: 0
diff changeset
28 bin, fdr)
0
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
29 print 'Launching zinbra: {0}'.format(cmd)
5f97f28e65ca Initial commit
Oleg Shpynov <oleg.shpynov@gmail.com>
parents:
diff changeset
30 subprocess.check_call(cmd, cwd=None, shell=True)