commit/galaxy-central: jgoecks: Fix GFFDataProvider bugs introduced in 9b7d5c1c0be6.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/dfdd405b4115/ changeset: dfdd405b4115 user: jgoecks date: 2011-11-19 21:28:16 summary: Fix GFFDataProvider bugs introduced in 9b7d5c1c0be6. affected #: 1 file diff -r 4c6f1004071d5055c9bf2d0b35f5bfe077b79e1e -r dfdd405b4115c1cf06bf7f362854088478560922 lib/galaxy/visualization/tracks/data_providers.py --- a/lib/galaxy/visualization/tracks/data_providers.py +++ b/lib/galaxy/visualization/tracks/data_providers.py @@ -99,7 +99,7 @@ pass - def get_data( self, chrom, start, end, start_val=0, max_vals=None, **kwargs ): + def get_data( self, chrom, start, end, start_val=0, max_vals=sys.maxint, **kwargs ): """ Returns data in region defined by chrom, start, and end. start_val and max_vals are used to denote the data to return: start_val is the first element to @@ -914,7 +914,15 @@ """ start, end = int( start ), int( end ) source = open( self.original_dataset.file_name ) - return GFFReaderWrapper( source, fix_strand=True ) + + def features_in_region_iter(): + for feature in GFFReaderWrapper( source, fix_strand=True ): + # Only provide features that are in region. + feature_start, feature_end = convert_gff_coords_to_bed( [ feature.start, feature.end ] ) + if feature.chrom != chrom or feature_start < start or feature_end > end: + continue + yield feature + return features_in_region_iter() def process_data( self, iterator, start_val=0, max_vals=None, **kwargs ): """ @@ -931,9 +939,6 @@ message = ERROR_MAX_VALS % ( max_vals, "reads" ) break - feature_start, feature_end = convert_gff_coords_to_bed( [ feature.start, feature.end ] ) - if feature.chrom != chrom or feature_start < start or feature_end > end: - continue payload = package_gff_feature( feature ) payload.insert( 0, offset ) results.append( payload ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket