mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-16 15:45:04 +08:00
FASTQ Opt: No need to map(str) over chr and join, can just join chr's.
Prevent an extra array creation and chr-> str map per base. Shaves 10% off remaining run time of filter on SSD.
Kept 135848 of 250000 reads (54.34%).
117012863 function calls (116762863 primitive calls) in 46.897 seconds
Down from 48.272 seconds on previous changset. Main Difference:
(ncalls|tottime|percall|cumtime|percall|filename:lineno(function))
135848 0.502 0.000 22.979 0.000 fastq.py:99(convert_read_to_format)
-became-
135848 0.448 0.000 21.159 0.000 fastq.py:99(convert_read_to_format)
Not huge, but a consistent improvement.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#Dan Blankenberg
|
||||
##Dan Blankenberg
|
||||
import math
|
||||
import string
|
||||
import transform
|
||||
@@ -126,12 +126,10 @@ class fastqSequencingRead( SequencingRead ):
|
||||
new_encoding = force_quality_encoding
|
||||
if new_encoding == 'ascii':
|
||||
new_class.transform_scores_to_valid_range_ascii( score_list )
|
||||
restricted_scores = map( str, score_list )
|
||||
new_read.quality = "".join( restricted_scores )
|
||||
new_read.quality = "".join( score_list )
|
||||
else: # decimal
|
||||
new_class.transform_scores_to_valid_range( score_list )
|
||||
restricted_scores = map( str, score_list )
|
||||
new_read.quality = "%s " % " ".join( restricted_scores ) #need trailing space to be valid decimal fastq
|
||||
new_read.quality = "%s " % " ".join( score_list ) #need trailing space to be valid decimal fastq
|
||||
return new_read
|
||||
def get_sequence( self ):
|
||||
return self.sequence
|
||||
|
||||
Reference in New Issue
Block a user