3 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/c5da9bd8bbfc/ changeset: c5da9bd8bbfc user: jgoecks date: 2012-04-23 15:08:29 summary: Use tabix for indexing and getting data from GTF files. This is faster and more flexible than using interval index. affected #: 3 files diff -r 8b773372d0dce1d815b90d257efa073d5a039e72 -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 datatypes_conf.xml.sample --- a/datatypes_conf.xml.sample +++ b/datatypes_conf.xml.sample @@ -85,7 +85,11 @@ <datatype extension="gff3" type="galaxy.datatypes.interval:Gff3" display_in_upload="true"/><datatype extension="gif" type="galaxy.datatypes.images:Gif" mimetype="image/gif"/><datatype extension="gmaj.zip" type="galaxy.datatypes.images:Gmaj" mimetype="application/zip"/> - <datatype extension="gtf" type="galaxy.datatypes.interval:Gtf" display_in_upload="true"/> + <datatype extension="gtf" type="galaxy.datatypes.interval:Gtf" display_in_upload="true"> + <converter file="gff_to_bgzip_converter.xml" target_datatype="bgzip"/> + <converter file="gff_to_tabix_converter.xml" target_datatype="tabix" depends_on="bgzip"/> + <converter file="gff_to_summary_tree_converter.xml" target_datatype="summary_tree"/> + </datatype><datatype extension="h5" type="galaxy.datatypes.binary:Binary" mimetype="application/octet-stream" subclass="True" /><datatype extension="html" type="galaxy.datatypes.images:Html" mimetype="text/html"/><datatype extension="interval" type="galaxy.datatypes.interval:Interval" display_in_upload="true"> diff -r 8b773372d0dce1d815b90d257efa073d5a039e72 -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 lib/galaxy/datatypes/interval.py --- a/lib/galaxy/datatypes/interval.py +++ b/lib/galaxy/datatypes/interval.py @@ -953,6 +953,9 @@ dataset.metadata.attribute_types = attribute_types dataset.metadata.attributes = len( attribute_types ) Gff.set_meta( self, dataset, overwrite = overwrite, skip = i ) + + def get_track_type( self ): + return "FeatureTrack", {"data": "tabix", "index": "summary_tree"} class Wiggle( Tabular, _RemoteCallMixin ): diff -r 8b773372d0dce1d815b90d257efa073d5a039e72 -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 lib/galaxy/visualization/tracks/data_providers.py --- a/lib/galaxy/visualization/tracks/data_providers.py +++ b/lib/galaxy/visualization/tracks/data_providers.py @@ -1024,7 +1024,7 @@ """ start, end = int( start ), int( end ) source = open( self.original_dataset.file_name ) - + def features_in_region_iter(): offset = 0 for feature in GFFReaderWrapper( source, fix_strand=True ): @@ -1034,7 +1034,7 @@ yield feature, offset offset += feature.raw_size return features_in_region_iter() - + def process_data( self, iterator, start_val=0, max_vals=None, **kwargs ): """ Process data from an iterator to a format that can be provided to client. @@ -1057,6 +1057,47 @@ return { 'data': results, 'message': message } + +class GtfTabixDataProvider( TabixDataProvider ): + + def process_data( self, iterator, start_val=0, max_vals=None, **kwargs ): + # Loop through lines and group by transcript_id; each group is a feature. + features = {} + for count, line in enumerate( iterator ): + line_attrs = parse_gff_attributes( line.split('\t')[8] ) + transcript_id = line_attrs[ 'transcript_id' ] + if transcript_id in features: + feature = features[ transcript_id ] + else: + feature = [] + features[ transcript_id ] = feature + feature.append( line ) + + # Set up iterator for features. + def features_iterator(): + for transcript_id, feature in features.items(): + for line in feature: + yield line + + # Process data. + filter_cols = from_json_string( kwargs.get( "filter_cols", "[]" ) ) + no_detail = ( "no_detail" in kwargs ) + results = [] + message = None + + # TODO: remove reader-wrapper and create features directly. + for count, feature in enumerate( GFFReaderWrapper( features_iterator() ) ): + if count < start_val: + continue + if count-start_val >= max_vals: + message = ERROR_MAX_VALS % ( max_vals, "reads" ) + break + + payload = package_gff_feature( feature, no_detail=no_detail, filter_cols=filter_cols ) + payload.insert( 0, feature.intervals[ 0 ].attributes[ 'transcript_id' ] ) + results.append( payload ) + + return { 'data': results, 'message': message } # # -- ENCODE Peak data providers. @@ -1189,6 +1230,7 @@ "tabix": { Vcf: VcfTabixDataProvider, Bed: BedTabixDataProvider, + Gtf: GtfTabixDataProvider, ENCODEPeak: ENCODEPeakTabixDataProvider, Interval: IntervalTabixDataProvider, "default" : TabixDataProvider }, https://bitbucket.org/galaxy/galaxy-central/changeset/678ac108a4c4/ changeset: 678ac108a4c4 user: jgoecks date: 2012-04-23 15:28:12 summary: Fix style conflict between base.css and trackster.css affected #: 5 files diff -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 -r 678ac108a4c44b06693a22f6d7d301986a3b30f3 static/june_2007_style/base_sprites.less.tmpl --- a/static/june_2007_style/base_sprites.less.tmpl +++ b/static/june_2007_style/base_sprites.less.tmpl @@ -88,6 +88,10 @@ } .icon-button.plus-button { -sprite-group: fugue; + -sprite-image: fugue/plus-button-bw.png; +} +.icon-button.plus-button:hover { + -sprite-group: fugue; -sprite-image: fugue/plus-button.png; } .icon-button.gear { diff -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 -r 678ac108a4c44b06693a22f6d7d301986a3b30f3 static/june_2007_style/blue/base.css --- a/static/june_2007_style/blue/base.css +++ b/static/june_2007_style/blue/base.css @@ -751,9 +751,10 @@ .icon-button.go-to-full-screen{background:url(fugue.png) no-repeat 0px -286px;} .icon-button.import{background:url(fugue.png) no-repeat 0px -312px;} .icon-button.plus-button{background:url(fugue.png) no-repeat 0px -338px;} -.icon-button.gear{background:url(fugue.png) no-repeat 0px -364px;} -.icon-button.chart_curve{background:url(fugue.png) no-repeat 0px -390px;} -.text-and-autocomplete-select{background:url(fugue.png) no-repeat right -416px;} +.icon-button.plus-button:hover{background:url(fugue.png) no-repeat 0px -364px;} +.icon-button.gear{background:url(fugue.png) no-repeat 0px -390px;} +.icon-button.chart_curve{background:url(fugue.png) no-repeat 0px -416px;} +.text-and-autocomplete-select{background:url(fugue.png) no-repeat right -442px;} div.historyItem-error .state-icon{background:url(history-states.png) no-repeat 0px 0px;} div.historyItem-empty .state-icon{background:url(history-states.png) no-repeat 0px -25px;} div.historyItem-queued .state-icon{background:url(history-states.png) no-repeat 0px -50px;} diff -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 -r 678ac108a4c44b06693a22f6d7d301986a3b30f3 static/june_2007_style/blue/fugue.png Binary file static/june_2007_style/blue/fugue.png has changed diff -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 -r 678ac108a4c44b06693a22f6d7d301986a3b30f3 static/june_2007_style/blue/trackster.css --- a/static/june_2007_style/blue/trackster.css +++ b/static/june_2007_style/blue/trackster.css @@ -86,8 +86,6 @@ .icon-button.toggle-expand:hover{background:transparent url(../images/fugue/toggle-expand.png) no-repeat;} .icon-button.cross-circle{background:transparent url(../images/fugue/cross-circle-bw.png) no-repeat;margin-right:0px;} .icon-button.cross-circle:hover{background:transparent url(../images/fugue/cross-circle.png) no-repeat;} -.icon-button.plus-button{background:transparent url(../images/fugue/plus-button-bw.png) no-repeat;} -.icon-button.plus-button:hover{background:transparent url(../images/fugue/plus-button.png) no-repeat;} .icon-button.block--plus{background:transparent url(../images/fugue/block--plus-bw.png) no-repeat;} .icon-button.block--plus:hover{background:transparent url(../images/fugue/block--plus.png) no-repeat;} .icon-button.bookmarks{background:transparent url(../images/fugue/bookmarks-bw.png) no-repeat;} diff -r c5da9bd8bbfc1e2634b7981c836a62796f7b33f7 -r 678ac108a4c44b06693a22f6d7d301986a3b30f3 static/june_2007_style/trackster.css.tmpl --- a/static/june_2007_style/trackster.css.tmpl +++ b/static/june_2007_style/trackster.css.tmpl @@ -411,12 +411,6 @@ .icon-button.cross-circle:hover { background: transparent url(../images/fugue/cross-circle.png) no-repeat; } -.icon-button.plus-button { - background: transparent url(../images/fugue/plus-button-bw.png) no-repeat; -} -.icon-button.plus-button:hover { - background: transparent url(../images/fugue/plus-button.png) no-repeat; -} .icon-button.block--plus { background: transparent url(../images/fugue/block--plus-bw.png) no-repeat; } https://bitbucket.org/galaxy/galaxy-central/changeset/ebd5932ed7f1/ changeset: ebd5932ed7f1 user: jgoecks date: 2012-04-23 17:14:27 summary: Create GTF features directly rather than parsing from lines. This is much faster than parsing. affected #: 2 files diff -r 678ac108a4c44b06693a22f6d7d301986a3b30f3 -r ebd5932ed7f1d0b434383995ea1338609b9814f4 lib/galaxy/datatypes/util/gff_util.py --- a/lib/galaxy/datatypes/util/gff_util.py +++ b/lib/galaxy/datatypes/util/gff_util.py @@ -10,8 +10,8 @@ A GFF interval, including attributes. If file is strictly a GFF file, only attribute is 'group.' """ - def __init__( self, reader, fields, chrom_col, feature_col, start_col, end_col, \ - strand_col, score_col, default_strand, fix_strand=False ): + def __init__( self, reader, fields, chrom_col=0, feature_col=2, start_col=3, end_col=4, \ + strand_col=6, score_col=5, default_strand='.', fix_strand=False ): # HACK: GFF format allows '.' for strand but GenomicInterval does not. To get around this, # temporarily set strand and then unset after initing GenomicInterval. unknown_strand = False @@ -45,8 +45,8 @@ """ A GFF feature, which can include multiple intervals. """ - def __init__( self, reader, chrom_col, feature_col, start_col, end_col, \ - strand_col, score_col, default_strand, fix_strand=False, intervals=[], \ + def __init__( self, reader, chrom_col=0, feature_col=2, start_col=3, end_col=4, \ + strand_col=6, score_col=5, default_strand='.', fix_strand=False, intervals=[], \ raw_size=0 ): GFFInterval.__init__( self, reader, intervals[0].fields, chrom_col, feature_col, \ start_col, end_col, strand_col, score_col, default_strand, \ diff -r 678ac108a4c44b06693a22f6d7d301986a3b30f3 -r ebd5932ed7f1d0b434383995ea1338609b9814f4 lib/galaxy/visualization/tracks/data_providers.py --- a/lib/galaxy/visualization/tracks/data_providers.py +++ b/lib/galaxy/visualization/tracks/data_providers.py @@ -1071,28 +1071,22 @@ else: feature = [] features[ transcript_id ] = feature - feature.append( line ) - - # Set up iterator for features. - def features_iterator(): - for transcript_id, feature in features.items(): - for line in feature: - yield line - + feature.append( GFFInterval( None, line.split( '\t') ) ) + # Process data. filter_cols = from_json_string( kwargs.get( "filter_cols", "[]" ) ) no_detail = ( "no_detail" in kwargs ) results = [] message = None - # TODO: remove reader-wrapper and create features directly. - for count, feature in enumerate( GFFReaderWrapper( features_iterator() ) ): + for count, intervals in enumerate( features.values() ): if count < start_val: continue if count-start_val >= max_vals: message = ERROR_MAX_VALS % ( max_vals, "reads" ) break - + + feature = GFFFeature( None, intervals=intervals ) payload = package_gff_feature( feature, no_detail=no_detail, filter_cols=filter_cols ) payload.insert( 0, feature.intervals[ 0 ].attributes[ 'transcript_id' ] ) 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.