# HG changeset patch
# User oleg@oleg-desktop
# Date 1446109487 -10800
# Node ID d7714f886224663b668ba8c9c84b838e5a79745e
Initial commit. Snapshot 61f45be
diff -r 000000000000 -r d7714f886224 cmeth.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmeth.xml	Thu Oct 29 12:04:47 2015 +0300
@@ -0,0 +1,47 @@
+
+    BS-Seq analysis
+    
+        integration_jar
+    
+    
+        
+        
+        
+    
+    
+        #if $action.selection == "analyze"
+            cmeth_wrapper.py "${genome}" "${fdr}" analyze "${bam}"
+        #else
+            cmeth_wrapper.py "${genome}" "${fdr}" compare "${bam1}" "${bam2}"
+        #end if
+    
+    
+        
+        
+        
+            
+                
+                
+            
+            
+                
+            
+            
+                
+                
+            
+        
+    
+    
+        #if $action.selection == "analyze"
+        
+        #else
+        
+        #end if
+    
+    
+Cmeth is a tool for analyzing and comparing cytosine methylation from WGBS (whole-genome bisulfite sequencing) data.
+Both procedures rely on the nonparametric Bayesian switching HMM.
+https://github.com/JetBrains-Research/cmeth
+    
+
diff -r 000000000000 -r d7714f886224 cmeth_wrapper.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmeth_wrapper.py	Thu Oct 29 12:04:47 2015 +0300
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import subprocess
+
+argv = sys.argv[1:]
+print 'Arguments {0}'.format(argv)
+
+# Check command
+if len(argv) == 4:
+    genome, fdr, action, bam = argv
+    assert action == "analyze"
+else:
+    genome, fdr, action, bam1, bam2 = argv
+    assert action == "compare"
+
+# Configure main jar path
+jar = os.environ.get("INTEGRATION_JAR")
+print 'Using JAR distributive file {0}'.format(jar)
+
+cmd = 'java -cp {0} org.jetbrains.bio.genestack.FastaToTwoBitCLA {1} reference.2bit'.format(jar, genome)
+print 'Converting reference genome fasta to 2bit: {0}'.format(cmd)
+subprocess.check_call(cmd, cwd=None, shell=True)
+
+# See https://github.com/JetBrains-Research/cmeth for command line options
+if action == "analyze":
+    cmd = 'java -cp {0} org.jetbrains.bio.cmeth.CmethCLA ' \
+          'analyze -i {1} -r reference.2bit -fdr {2}'.format(jar, bam, fdr)
+else:
+    cmd = 'java -cp {0} org.jetbrains.bio.cmeth.CmethCLA ' \
+          'compare -1 {1} -2 {2} -r reference.2bit -fdr {3}'.format(jar, bam1, bam2, fdr)
+print 'Launching cmeth: {0}'.format(cmd)
+subprocess.check_call(cmd, cwd=None, shell=True)
diff -r 000000000000 -r d7714f886224 integration_jar.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/integration_jar.xml	Thu Oct 29 12:04:47 2015 +0300
@@ -0,0 +1,23 @@
+
+
+    
+        
+            http://teamcity.jetbrains.com/guestAuth/repository/download/Epigenome_Tools_Integration/lastSuccessful/integration-Dev-all.jar
+            
+                .
+                $INSTALL_DIR/
+            
+            
+            
+                $INSTALL_DIR/integration-Dev-all.jar
+            
+        
+    
+    
+        Downloads epigenome integration JAR.
+    
+
diff -r 000000000000 -r d7714f886224 tool_dependencies.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Thu Oct 29 12:04:47 2015 +0300
@@ -0,0 +1,6 @@
+
+
+    
+    
+    
+