# HG changeset patch # User urgi-team # Date 1461935478 14400 # Node ID 3d22562b4489c3ce102255f03823b364019e0860 Uploaded diff -r 000000000000 -r 3d22562b4489 TEiso/ClosestToStartSite_Wrapper.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TEiso/ClosestToStartSite_Wrapper.py Fri Apr 29 09:11:18 2016 -0400 @@ -0,0 +1,68 @@ +#!/usr/bin/env python + + +import subprocess, tempfile, sys, os, glob, shutil, time +from optparse import OptionParser +from commons.core.utils.RepetOptionParser import RepetOptionParser + + +class ClosestToStartSiteWrapper(object): + + def __init__(self): + self._options = None + + + def stop_err(self, msg ): + sys.stderr.write( "%s\n" % msg ) + sys.exit() + + + def setAttributesFromCmdLine(self): + self._toolVersion = "1.0" + description = "ClosestToStartSite version %s" % self._toolVersion + epilog = "\n parses a bed file and create a bed file to create a report about positions of features A to features B. \n" + epilog += "example: ClosestToStartSite.py -i -o \n" + parser = RepetOptionParser(description = description, epilog = epilog, version = self._toolVersion) + parser.add_option("-i", "--inputFile", dest = "inputFile", action = "store", type = "string", help = "Input GTF File name(transcript.gtf of Cufflinks).", default = "") + parser.add_option("-o", "--outputFile", dest = "outputFile", action = "store", type = "string", help = "output Bed File name", default = "") + parser.add_option("-v", "--verbosity", dest = "verbosity", action = "store", type = "int", help = "Verbosity [optional] [default: 3]",default = 3) + options = parser.parse_args()[0] + self._setAttributesFromOptions(options) + + def _setAttributesFromOptions(self, options): + self._options = options + + def run(self): + prg = "ClosestToStartSite.py" + args = "" + args += "-i %s" % self._options.inputFile + cmd = "%s %s" %(prg, args) + print cmd + + try: + tmp_err = tempfile.NamedTemporaryFile().name + tmp_stderr = open( tmp_err, 'wb' ) + proc = subprocess.Popen( args=cmd, shell=True, cwd=".", stderr=tmp_stderr ) + returncode = proc.wait() + tmp_stderr.close() + # get stderr, allowing for case where it's very large + tmp_stderr = open( tmp_err, 'rb' ) + stderr = '' + buffsize = 1048576 + try: + while True: + stderr += tmp_stderr.read( buffsize ) + if not stderr or len( stderr ) % buffsize != 0: + break + except OverflowError: + pass + tmp_stderr.close() + if stderr: + raise Exception, stderr + except Exception, e: + self.stop_err( 'Error in ClosestToStartSite:\n' + str( e ) ) + +if __name__ == "__main__": + iWrapper = ClosestToStartSiteWrapper() + iWrapper.setAttributesFromCmdLine() + iWrapper.run() diff -r 000000000000 -r 3d22562b4489 TEiso/ClosestToStartSite_Wrapper.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TEiso/ClosestToStartSite_Wrapper.xml Fri Apr 29 09:11:18 2016 -0400 @@ -0,0 +1,133 @@ + + ClosestToStartSite parses a bed file and create a bed file to create a report about positions of features A to features B. + + TEiso_Tools + + + ClosestToStartSite.py --version + + + ClosestToStartSite_Wrapper.py -i $inputFile -o $outputFile + + + + + + + + + ------------ + F[8] F[9] + + + F[1] F[2] + <========================= + --------------- + + +****** "B_overlap_TSS" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + F[1] gene F[2] + =========================> + ------------- + F[8] F[9] + + gene + F[1]=========================>F[2] + + F[8]---------------F[9] + + + + F[1]=============================>F[2] + F[8]---------------F[9] + + + F[1]<=============================F[2] + --------------------------- + F[8] F[9] + + + F[1]<=============================F[2] + F[8]---------------F[9] + + + F[1]<=============================F[2] + F[8]---------------F[9] + +****** "B-inclus-A" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + + F[1] gene F[2] + ============================== + ------------- + F[8] F[9] + +****** "A-inclus-B" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + F[1]======================F[2] + F[8]----------------------------------------------------F[9] + + + + + F[1]==================================>F[2] + F[8]----------------------------------------------------------F[9] + + + + F[1]<==================================F[2] + F[8]----------------------------------------------------------F[9] + + + +****** "A-inclus-B-inTSS" +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + F[1]<==================================F[2] + [8]----------------------------------------------------------F[9] + + + F[1]==================================>F[2] + F[8]----------------------------------------------------------F[9] + + +----- + +**reference :** + +]]> + + diff -r 000000000000 -r 3d22562b4489 TEiso/CufflinksGTFToBed_Wrapper.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TEiso/CufflinksGTFToBed_Wrapper.py Fri Apr 29 09:11:18 2016 -0400 @@ -0,0 +1,68 @@ +#!/usr/bin/env python + + +import subprocess, tempfile, sys, os, glob, shutil, time +from optparse import OptionParser +from commons.core.utils.RepetOptionParser import RepetOptionParser + + +class CufflinksGTFToBedWrapper(object): + + def __init__(self): + self._options = None + + + def stop_err(self, msg ): + sys.stderr.write( "%s\n" % msg ) + sys.exit() + + + def setAttributesFromCmdLine(self): + self._toolVersion = "1.0" + description = "CufflinksGTFToBed version %s" % self._toolVersion + epilog = "\n parses a GTF file of Cufflinks and create a bed file. \n" + epilog += "example: CufflinksGTFToBed.py -i -o \n" + parser = RepetOptionParser(description = description, epilog = epilog, version = self._toolVersion) + parser.add_option("-i", "--inputFile", dest = "inputFile", action = "store", type = "string", help = "Input GTF File name(transcript.gtf of Cufflinks).", default = "") + parser.add_option("-o", "--outputFile", dest = "outputFile", action = "store", type = "string", help = "output Bed File name", default = "") + parser.add_option("-v", "--verbosity", dest = "verbosity", action = "store", type = "int", help = "Verbosity [optional] [default: 3]",default = 3) + options = parser.parse_args()[0] + self._setAttributesFromOptions(options) + + def _setAttributesFromOptions(self, options): + self._options = options + + def run(self): + prg = "CufflinksGTFToBed.py" + args = "" + args += "-i %s" % self._options.inputFile + cmd = "%s %s" %(prg, args) + print cmd + + try: + tmp_err = tempfile.NamedTemporaryFile().name + tmp_stderr = open( tmp_err, 'wb' ) + proc = subprocess.Popen( args=cmd, shell=True, cwd=".", stderr=tmp_stderr ) + returncode = proc.wait() + tmp_stderr.close() + # get stderr, allowing for case where it's very large + tmp_stderr = open( tmp_err, 'rb' ) + stderr = '' + buffsize = 1048576 + try: + while True: + stderr += tmp_stderr.read( buffsize ) + if not stderr or len( stderr ) % buffsize != 0: + break + except OverflowError: + pass + tmp_stderr.close() + if stderr: + raise Exception, stderr + except Exception, e: + self.stop_err( 'Error in TranscriptToBed:\n' + str( e ) ) + +if __name__ == "__main__": + iWrapper = CufflinksGTFToBedWrapper() + iWrapper.setAttributesFromCmdLine() + iWrapper.run() diff -r 000000000000 -r 3d22562b4489 TEiso/CufflinksGTFToBed_Wrapper.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TEiso/CufflinksGTFToBed_Wrapper.xml Fri Apr 29 09:11:18 2016 -0400 @@ -0,0 +1,52 @@ + + CufflinksGTFToBed can convert a result GTF file of Cufflinks into a bed file. + + TEiso_Tools + + + CufflinksGTFToBed.py --version + + + CufflinksGTFToBed_Wrapper.py -i $inputFile -o $outputFile + + + + + + + + + + diff -r 000000000000 -r 3d22562b4489 TEiso/GFFToBed_Wrapper.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TEiso/GFFToBed_Wrapper.py Fri Apr 29 09:11:18 2016 -0400 @@ -0,0 +1,68 @@ +#!/usr/bin/env python + + +import subprocess, tempfile, sys, os, glob, shutil, time +from optparse import OptionParser +from commons.core.utils.RepetOptionParser import RepetOptionParser + + +class GFFToBedWrapper(object): + + def __init__(self): + self._options = None + + + def stop_err(self, msg ): + sys.stderr.write( "%s\n" % msg ) + sys.exit() + + + def setAttributesFromCmdLine(self): + self._toolVersion = "1.0" + description = "GFFToBed version %s" % self._toolVersion + epilog = "\n parses a GFF file and create a bed file. \n" + epilog += "example: GFFToBed.py -i -o \n" + parser = RepetOptionParser(description = description, epilog = epilog, version = self._toolVersion) + parser.add_option("-i", "--inputFile", dest = "inputFile", action = "store", type = "string", help = "Input GFF File name.", default = "") + parser.add_option("-o", "--outputFile", dest = "outputFile", action = "store", type = "string", help = "output Bed File name", default = "") + parser.add_option("-v", "--verbosity", dest = "verbosity", action = "store", type = "int", help = "Verbosity [optional] [default: 3]",default = 3) + options = parser.parse_args()[0] + self._setAttributesFromOptions(options) + + def _setAttributesFromOptions(self, options): + self._options = options + + def run(self): + prg = "GFFToBed.py" + args = "" + args += "-i %s" % self._options.inputFile + cmd = "%s %s" %(prg, args) + print cmd + + try: + tmp_err = tempfile.NamedTemporaryFile().name + tmp_stderr = open( tmp_err, 'wb' ) + proc = subprocess.Popen( args=cmd, shell=True, cwd=".", stderr=tmp_stderr ) + returncode = proc.wait() + tmp_stderr.close() + # get stderr, allowing for case where it's very large + tmp_stderr = open( tmp_err, 'rb' ) + stderr = '' + buffsize = 1048576 + try: + while True: + stderr += tmp_stderr.read( buffsize ) + if not stderr or len( stderr ) % buffsize != 0: + break + except OverflowError: + pass + tmp_stderr.close() + if stderr: + raise Exception, stderr + except Exception, e: + self.stop_err( 'Error in GFFToBed:\n' + str( e ) ) + +if __name__ == "__main__": + iWrapper = GFFToBedWrapper() + iWrapper.setAttributesFromCmdLine() + iWrapper.run() diff -r 000000000000 -r 3d22562b4489 TEiso/GFFToBed_Wrapper.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TEiso/GFFToBed_Wrapper.xml Fri Apr 29 09:11:18 2016 -0400 @@ -0,0 +1,53 @@ + + GFFToBed can convert a result GTF file of Cufflinks into a bed file. + + TEiso_Tools + + + GFFToBed.py --version + + + GFFToBedWrapper_Wrapper.py -i $inputFile -o $outputFile + + + + + + + + + + diff -r 000000000000 -r 3d22562b4489 TEiso/tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TEiso/tool_dependencies.xml Fri Apr 29 09:11:18 2016 -0400 @@ -0,0 +1,19 @@ + + + + + + https://urgi.versailles.inra.fr/download/TEiso/TEisotools-1.0.tar.gz + python setup_TEiso.py install + + . + $INSTALL_DIR + + + $INSTALL_DIR + $INSTALL_DIR/bin + + + + +