diff SMART/galaxy/test/Test_F_WrappGetLetterDistribution.py @ 6:769e306b7933

Change the repository level.
author yufei-luo
date Fri, 18 Jan 2013 04:54:14 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SMART/galaxy/test/Test_F_WrappGetLetterDistribution.py	Fri Jan 18 04:54:14 2013 -0500
@@ -0,0 +1,91 @@
+import unittest
+import os
+from commons.core.utils.FileUtils import FileUtils
+from SMART.galaxy.WrappGetLetterDistribution import WrappGetLetterDistribution
+
+SMART_PATH = "%s/SMART" % os.environ["REPET_PATH"]
+SMART_DATA = SMART_PATH + "/data"
+
+class Test_F_WrappGetLetterDistribution(unittest.TestCase):
+
+
+    def setUp(self):
+        self._dirTest = "%s/galaxy/test" % SMART_PATH
+        self._iwrappFastq = WrappGetLetterDistribution()
+        self._iwrappFasta = WrappGetLetterDistribution()
+        self._expOutputCSV = "expOutputTomate.csv" 
+       
+    def test_wrappFasta(self):
+        self._iwrappFasta._inputFileName = "%s/SR1.fasta" % SMART_DATA
+        self._iwrappFasta._outputFileNamePrefix = "%s/galaxy/test/TomateFasta_res" % SMART_PATH
+        self._iwrappFasta._outputFileNamePNG = "%s/galaxy/test/TomateFasta_res.png" % SMART_PATH
+        self._iwrappFasta._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFasta_resPerNt.png" % SMART_PATH
+        self._iwrappFasta._outputFileNameCSV = "%s/galaxy/test/TomateFasta_res.csv" % SMART_PATH
+        self._iwrappFasta._inputFileFormat = "fasta"
+        self._iwrappFasta._csv = True
+        if not(FileUtils.isEmpty(self._iwrappFasta._inputFileName)):
+            self._iwrappFasta.wrapp()
+            self.assertTrue(os.path.exists(self._iwrappFasta._outputFileNamePNG))
+            self.assertTrue (os.path.exists(self._iwrappFasta._outputFileNamePerNtPNG))    
+            self.assertTrue (os.path.exists(self._iwrappFasta._outputFileNameCSV))
+            self.assertTrue(FileUtils.are2FilesIdentical(self._iwrappFasta._outputFileNameCSV,self._expOutputCSV))
+        else:
+            print "Problem : the input fasta file %s is empty!" % self._inputFileFasta
+         
+            
+#    def test_wrappFasta_withoutCSV_Opt(self):
+#        self._iwrappFasta._inputFileName = "%s/SR1.fasta" % SMART_DATA
+#        self._iwrappFasta._outputFileNamePrefix = "%s/galaxy/test/TomateFasta_res" % SMART_PATH
+#        self._iwrappFasta._outputFileNamePNG = "%s/galaxy/test/TomateFasta_res.png" % SMART_PATH
+#        self._iwrappFasta._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFasta_resPerNt.png" % SMART_PATH
+#        self._iwrappFasta._outputFileNameCSV = "%s/galaxy/test/TomateFasta_res.csv" % SMART_PATH
+#        self._iwrappFasta._inputFileFormat = "fasta"
+#        self._iwrappFasta._csv = False
+#        if not(FileUtils.isEmpty(self._iwrappFasta._inputFileName)):
+#            self._iwrappFasta.wrapp()
+#            self.assertTrue(os.path.exists(self._iwrappFasta._outputFileNamePNG))
+#            self.assertTrue (os.path.exists(self._iwrappFasta._outputFileNamePerNtPNG)) 
+#        else:            
+#            print "Problem : the input fasta file %s is empty!" % self._inputFileFasta
+#        os.system("rm %s/galaxy/test/*_res*.png" %SMART_PATH)
+#        os.system("rm %s/galaxy/test/*_res.csv" %SMART_PATH) 
+#        
+#                
+#    def test_wrappFastq(self):
+#        self._iwrappFastq._inputFileName = "%s/SR1.fastq" % SMART_DATA
+#        self._iwrappFastq._outputFileNamePrefix = "%s/galaxy/test/TomateFastq_res" % SMART_PATH
+#        self._iwrappFastq._outputFileNamePNG = "%s/galaxy/test/TomateFastq_res.png" % SMART_PATH
+#        self._iwrappFastq._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFastq_resPerNt.png" % SMART_PATH
+#        self._iwrappFastq._outputFileNameCSV = "%s/galaxy/test/TomateFastq_res.csv" % SMART_PATH
+#        self._iwrappFastq._inputFileFormat = "fastq"
+#        self._iwrappFastq._csv = True
+#        if not(FileUtils.isEmpty(self._iwrappFastq._inputFileName)):
+#            self._iwrappFastq.wrapp()
+#            self.assertTrue(os.path.exists(self._iwrappFastq._outputFileNamePNG))
+#            self.assertTrue (os.path.exists(self._iwrappFastq._outputFileNamePerNtPNG))    
+#            self.assertTrue (os.path.exists(self._iwrappFastq._outputFileNameCSV))
+#            self.assertTrue(FileUtils.are2FilesIdentical(self._iwrappFastq._outputFileNameCSV,self._expOutputCSV))
+#        else:
+#            print "Problem : the input fastq file %s is empty!" % self._inputFileFastq   
+#          
+#        
+#    def test_wrappFastq_withoutCSV_Opt(self):
+#        self._iwrappFastq._inputFileName = "%s/SR1.fastq" % SMART_DATA
+#        self._iwrappFastq._outputFileNamePrefix = "%s/galaxy/test/TomateFastq_res" % SMART_PATH
+#        self._iwrappFastq._outputFileNamePNG = "%s/galaxy/test/TomateFastq_res.png" % SMART_PATH
+#        self._iwrappFastq._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFastq_resPerNt.png" % SMART_PATH
+#        self._iwrappFastq._outputFileNameCSV = "%s/galaxy/test/TomateFastq_res.csv" % SMART_PATH
+#        self._iwrappFastq._inputFileFormat = "fastq"
+#        self._iwrappFastq._csv = False
+#        if not(FileUtils.isEmpty(self._iwrappFastq._inputFileName)):
+#            self._iwrappFastq.wrapp()
+#            self.assertTrue(os.path.exists(self._iwrappFastq._outputFileNamePNG))
+#            self.assertTrue (os.path.exists(self._iwrappFastq._outputFileNamePerNtPNG)) 
+#        else:            
+#            print "Problem : the input fastq file %s is empty!" % self._inputFileFastq
+#        os.system("rm %s/galaxy/test/*_res*.png" %SMART_PATH)
+#        os.system("rm %s/galaxy/test/*_res.csv" %SMART_PATH)
+       
+
+if __name__ == "__main__":
+    unittest.main()
\ No newline at end of file