comparison 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
comparison
equal deleted inserted replaced
5:ea3082881bf8 6:769e306b7933
1 import unittest
2 import os
3 from commons.core.utils.FileUtils import FileUtils
4 from SMART.galaxy.WrappGetLetterDistribution import WrappGetLetterDistribution
5
6 SMART_PATH = "%s/SMART" % os.environ["REPET_PATH"]
7 SMART_DATA = SMART_PATH + "/data"
8
9 class Test_F_WrappGetLetterDistribution(unittest.TestCase):
10
11
12 def setUp(self):
13 self._dirTest = "%s/galaxy/test" % SMART_PATH
14 self._iwrappFastq = WrappGetLetterDistribution()
15 self._iwrappFasta = WrappGetLetterDistribution()
16 self._expOutputCSV = "expOutputTomate.csv"
17
18 def test_wrappFasta(self):
19 self._iwrappFasta._inputFileName = "%s/SR1.fasta" % SMART_DATA
20 self._iwrappFasta._outputFileNamePrefix = "%s/galaxy/test/TomateFasta_res" % SMART_PATH
21 self._iwrappFasta._outputFileNamePNG = "%s/galaxy/test/TomateFasta_res.png" % SMART_PATH
22 self._iwrappFasta._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFasta_resPerNt.png" % SMART_PATH
23 self._iwrappFasta._outputFileNameCSV = "%s/galaxy/test/TomateFasta_res.csv" % SMART_PATH
24 self._iwrappFasta._inputFileFormat = "fasta"
25 self._iwrappFasta._csv = True
26 if not(FileUtils.isEmpty(self._iwrappFasta._inputFileName)):
27 self._iwrappFasta.wrapp()
28 self.assertTrue(os.path.exists(self._iwrappFasta._outputFileNamePNG))
29 self.assertTrue (os.path.exists(self._iwrappFasta._outputFileNamePerNtPNG))
30 self.assertTrue (os.path.exists(self._iwrappFasta._outputFileNameCSV))
31 self.assertTrue(FileUtils.are2FilesIdentical(self._iwrappFasta._outputFileNameCSV,self._expOutputCSV))
32 else:
33 print "Problem : the input fasta file %s is empty!" % self._inputFileFasta
34
35
36 # def test_wrappFasta_withoutCSV_Opt(self):
37 # self._iwrappFasta._inputFileName = "%s/SR1.fasta" % SMART_DATA
38 # self._iwrappFasta._outputFileNamePrefix = "%s/galaxy/test/TomateFasta_res" % SMART_PATH
39 # self._iwrappFasta._outputFileNamePNG = "%s/galaxy/test/TomateFasta_res.png" % SMART_PATH
40 # self._iwrappFasta._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFasta_resPerNt.png" % SMART_PATH
41 # self._iwrappFasta._outputFileNameCSV = "%s/galaxy/test/TomateFasta_res.csv" % SMART_PATH
42 # self._iwrappFasta._inputFileFormat = "fasta"
43 # self._iwrappFasta._csv = False
44 # if not(FileUtils.isEmpty(self._iwrappFasta._inputFileName)):
45 # self._iwrappFasta.wrapp()
46 # self.assertTrue(os.path.exists(self._iwrappFasta._outputFileNamePNG))
47 # self.assertTrue (os.path.exists(self._iwrappFasta._outputFileNamePerNtPNG))
48 # else:
49 # print "Problem : the input fasta file %s is empty!" % self._inputFileFasta
50 # os.system("rm %s/galaxy/test/*_res*.png" %SMART_PATH)
51 # os.system("rm %s/galaxy/test/*_res.csv" %SMART_PATH)
52 #
53 #
54 # def test_wrappFastq(self):
55 # self._iwrappFastq._inputFileName = "%s/SR1.fastq" % SMART_DATA
56 # self._iwrappFastq._outputFileNamePrefix = "%s/galaxy/test/TomateFastq_res" % SMART_PATH
57 # self._iwrappFastq._outputFileNamePNG = "%s/galaxy/test/TomateFastq_res.png" % SMART_PATH
58 # self._iwrappFastq._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFastq_resPerNt.png" % SMART_PATH
59 # self._iwrappFastq._outputFileNameCSV = "%s/galaxy/test/TomateFastq_res.csv" % SMART_PATH
60 # self._iwrappFastq._inputFileFormat = "fastq"
61 # self._iwrappFastq._csv = True
62 # if not(FileUtils.isEmpty(self._iwrappFastq._inputFileName)):
63 # self._iwrappFastq.wrapp()
64 # self.assertTrue(os.path.exists(self._iwrappFastq._outputFileNamePNG))
65 # self.assertTrue (os.path.exists(self._iwrappFastq._outputFileNamePerNtPNG))
66 # self.assertTrue (os.path.exists(self._iwrappFastq._outputFileNameCSV))
67 # self.assertTrue(FileUtils.are2FilesIdentical(self._iwrappFastq._outputFileNameCSV,self._expOutputCSV))
68 # else:
69 # print "Problem : the input fastq file %s is empty!" % self._inputFileFastq
70 #
71 #
72 # def test_wrappFastq_withoutCSV_Opt(self):
73 # self._iwrappFastq._inputFileName = "%s/SR1.fastq" % SMART_DATA
74 # self._iwrappFastq._outputFileNamePrefix = "%s/galaxy/test/TomateFastq_res" % SMART_PATH
75 # self._iwrappFastq._outputFileNamePNG = "%s/galaxy/test/TomateFastq_res.png" % SMART_PATH
76 # self._iwrappFastq._outputFileNamePerNtPNG = "%s/galaxy/test/TomateFastq_resPerNt.png" % SMART_PATH
77 # self._iwrappFastq._outputFileNameCSV = "%s/galaxy/test/TomateFastq_res.csv" % SMART_PATH
78 # self._iwrappFastq._inputFileFormat = "fastq"
79 # self._iwrappFastq._csv = False
80 # if not(FileUtils.isEmpty(self._iwrappFastq._inputFileName)):
81 # self._iwrappFastq.wrapp()
82 # self.assertTrue(os.path.exists(self._iwrappFastq._outputFileNamePNG))
83 # self.assertTrue (os.path.exists(self._iwrappFastq._outputFileNamePerNtPNG))
84 # else:
85 # print "Problem : the input fastq file %s is empty!" % self._inputFileFastq
86 # os.system("rm %s/galaxy/test/*_res*.png" %SMART_PATH)
87 # os.system("rm %s/galaxy/test/*_res.csv" %SMART_PATH)
88
89
90 if __name__ == "__main__":
91 unittest.main()