@@ -99,33 +99,33 @@ def genecount(self, circ_coordinates, bamfile, ref, tid):
9999 start_coordinates .close ()
100100 end_coordinates .close ()
101101
102- print ( 'Started linear gene expression counting for %s' % bamfile )
102+ print (( 'Started linear gene expression counting for %s' % bamfile ) )
103103
104104 start = time .time ()
105105 # mpileup get the read counts of the start and end positions
106- print ( "\t => running mpileup for start positions [%s]" % bamfile )
106+ print (( "\t => running mpileup for start positions [%s]" % bamfile ) )
107107 mpileup_start = pysam .mpileup (bamfile , '-f' , ref , '-l' , self .tmp_dir + 'tmp_start_coordinates_' + tid )
108108 end = time .time () - start
109- print ( "\t => mpileup for start positions for %s took %d seconds" % (bamfile , end ))
109+ print (( "\t => mpileup for start positions for %s took %d seconds" % (bamfile , end ) ))
110110
111111 start = time .time ()
112112 # mpileup get the read counts of the start and end positions
113- print ( "\t => running mpileup for end positions [%s]" % bamfile )
113+ print (( "\t => running mpileup for end positions [%s]" % bamfile ) )
114114 mpileup_end = pysam .mpileup (bamfile , '-f' , ref , '-l' , self .tmp_dir + 'tmp_end_coordinates_' + tid )
115115 end = time .time () - start
116- print ( "\t => mpileup for end positions for %s took %d seconds" % (bamfile , end ))
116+ print (( "\t => mpileup for end positions for %s took %d seconds" % (bamfile , end ) ))
117117
118- print "\t => gathering read counts for start positions [%s]" % bamfile
118+ print ( "\t => gathering read counts for start positions [%s]" % bamfile )
119119 startcount = self .getreadscount (mpileup_start , countmapped = True )
120120
121- print "\t => gathering read counts for end positions [%s]" % bamfile
121+ print ( "\t => gathering read counts for end positions [%s]" % bamfile )
122122 endcount = self .getreadscount (mpileup_end , countmapped = True )
123123
124124 # remove tmp files
125125 # os.remove(self.tmp_dir + 'tmp_start_coordinates_' + tid)
126126 # os.remove(self.tmp_dir + 'tmp_end_coordinates_' + tid)
127127
128- print 'Finished linear gene expression counting for %s' % bamfile
128+ print ( 'Finished linear gene expression counting for %s' % bamfile )
129129
130130 return startcount , endcount
131131
@@ -194,29 +194,29 @@ def linearsplicedreadscount(self, circ_coor, bamfile, ref, header=True):
194194 start_coor_1 .close ()
195195 end_coor .close ()
196196 end_coor_1 .close ()
197- print ( 'Started linear spliced read counting for %s' % bamfile )
197+ print (( 'Started linear spliced read counting for %s' % bamfile ) )
198198
199199 # mpileup get the number of spliced reads at circle start position and (start-1) position.
200200
201- print ( "\t => running mpileup 1 for start positions [%s]" % bamfile )
201+ print (( "\t => running mpileup 1 for start positions [%s]" % bamfile ) )
202202 mpileup_start = pysam .mpileup (bamfile , '-f' , ref , '-l' , self .tmp_dir + 'tmp_start_coor_1' )
203203
204- print ( "\t => running mpileup 2 for start positions [%s]" % bamfile )
204+ print (( "\t => running mpileup 2 for start positions [%s]" % bamfile ) )
205205 mpileup_start_1 = pysam .mpileup (bamfile , '-f' , ref , '-l' , self .tmp_dir + 'tmp_start_coor_2' )
206206
207207 # mpileup get the number of spliced reads at circle end position and (end+1) position.
208- print ( "\t => running mpileup 1 for end positions [%s]" % bamfile )
208+ print (( "\t => running mpileup 1 for end positions [%s]" % bamfile ) )
209209 mpileup_end = pysam .mpileup (bamfile , '-f' , ref , '-l' , self .tmp_dir + 'tmp_end_coor_1' )
210210
211- print ( "\t => running mpileup 2 for end positions [%s]" % bamfile )
211+ print (( "\t => running mpileup 2 for end positions [%s]" % bamfile ) )
212212 mpileup_end_1 = pysam .mpileup (bamfile , '-f' , ref , '-l' , self .tmp_dir + 'tmp_end_coor_2' )
213213
214214 # get count
215215
216- print "\t => gathering read counts for start positions [%s]" % bamfile
216+ print ( "\t => gathering read counts for start positions [%s]" % bamfile )
217217 startcount = self .submpileup (self .getreadscount (mpileup_start_1 ), self .getreadscount (mpileup_start ))
218218
219- print "\t => gathering read counts for end positions [%s]" % bamfile
219+ print ( "\t => gathering read counts for end positions [%s]" % bamfile )
220220 endcount = self .submpileup (self .getreadscount (mpileup_end ), self .getreadscount (mpileup_end_1 ), left = False )
221221
222222 # remove tmp files
@@ -225,7 +225,7 @@ def linearsplicedreadscount(self, circ_coor, bamfile, ref, header=True):
225225 # os.remove(self.tmp_dir + 'tmp_end_coor')
226226 # os.remove(self.tmp_dir + 'tmp_end_coor_1')
227227
228- print 'Finished linear spliced read counting for %s' % bamfile
228+ print ( 'Finished linear spliced read counting for %s' % bamfile )
229229
230230 return startcount , endcount
231231
@@ -266,7 +266,7 @@ def comb_gen_count(self, circ_coor, bamfile, ref, output, countlinearsplicedread
266266 # call genecount to get the start and end positon read counts
267267 tmp_start , tmp_end = self .genecount (circ_coor , bamfile , ref , tid )
268268
269- print 'Ended linear gene expression counting %s' % bamfile
269+ print ( 'Ended linear gene expression counting %s' % bamfile )
270270 logging .info ('Ended linear gene expression counting %s' % bamfile )
271271
272272 for line in tmp_start :
@@ -314,6 +314,6 @@ def comb_gen_count(self, circ_coor, bamfile, ref, output, countlinearsplicedread
314314 # tmp_end.close()
315315 count_table .close ()
316316
317- print 'Ended post processing %s' % bamfile
317+ print ( 'Ended post processing %s' % bamfile )
318318 logging .info ('Ended post processing %s' % bamfile )
319319 return tid
0 commit comments