[BioRuby] biographics

Jan Aerts jan.aerts at bbsrc.ac.uk
Thu Nov 8 09:06:02 UTC 2007


Hey George.

Thanks again for your interest in using Bio::Graphics.

Concerning your first question: I'm trying to implement the notion of
subfeatures in Bio::Graphics at the moment. I think that would serve
your purpose. Unfortunately, this requires some refactoring of one of
the core-classes in bioruby itself: Bio::Feature. I'm waiting for the
big guys at bioruby for their ideas on implementing that. So at the
moment, the best way of displaying this is to either display the domains
separately, or to use the spliced glyph: even though they're not exons,
this would at least link them up later.
Do you want to display that protein in its genomic environment as well?
Or do you just want to have the protein on its own with the domains?
Could you send us a mockup of how you'd like to have this type of
information (i.e. proteins and their domains) represented? Just a simple
drawing will do. I haven't had to do this type of visualization yet
myself, so would be interested in how you experts would like to do that.

Concerning your second question: it looks like you're referencing a
version of the library that I sent out a while ago on the mailing list.
All code development is now run via rubyforge. The moment I put it on
rubyforge the namespace was changed from BioExt (*bio*ruby *ext*ensions)
to just Bio. Did you install a version via rubyforge (i.e. following the
instructions on bio-graphics.rubyforge.org)? If so: change all
references to BioExt::Graphics to Bio::Graphics.
So the line
  my_panel = BioExt::Graphics::Panel.new(1000, 1200, false, 1, 600)
would become
  my_panel = Bio::Graphics::Panel.new(1000, 1200, false, 1, 600)

jan.

PS: I've CC'd this reply to the bioruby mailing list if that's OK...

On Thu, 2007-11-08 at 09:56 +0300, George wrote:
> Hi Dr Jan.
> 
> I have a chado based database system running on ruby on rails for 
> storing sequence and annotation data.
> The Feature table contains the biological sequences represented as 
> features and the Feature location table contains the locations or bio 
> coordinates for each feature.
> Let me explain with an example, a protein sequence is a feature. call it 
> prot_A. Our Prot_A can have domains A1, A2, etc. Now these domains are 
> actually features by themselves but they happen to be located within Prot_A.
> 
> So in the feature table i have Prot_A, Domain A1, A2.
> 
> In the Feature locations table call it Featureloc, (chado style)
> 
> ---------------------------------------------
> featureloc_id|     featuresrc_id |fmin     |fmax|
> ---------------------------------------------
> 1        null        1    200
> 2        1        1    20
> 3        1        30    60
> ----------------------------------------------
> 
> My aim is to represent these features graphically such that a user can 
> view a feature with its domains.
> I would like to generate simple graphics for these features from  a gff 
> formatted file which can be created on the fly from the database tables. 
> Any idea on how i can do that in rails and using the bio-graphics module?
> 
> Secondly am getting the error 
> "F:/Netbeans_folder/vargene/lib/biographics.rb:6: uninitialized constant 
> BioExt (NameError) when i try to access the Bioext::Graphics::Panel.new 
> method while running the following code.
> 
> require 'stringio'
> require 'base64'
> gem 'bio-graphics'
> require 'bio-graphics'
> 
> my_panel = BioExt::Graphics::Panel.new(1000, 1200, false, 1, 600)
>        
>        #Create and configure tracks
>        track_SNP = my_panel.add_track('SNP')
>        track_gene = my_panel.add_track('gene')
>        track_transcript = my_panel.add_track('transcript')
>        
>        track_SNP.feature_colour = [1,0,0]
>       track_SNP.feature_glyph = 'triangle'
>       track_gene.feature_glyph = 'directed_spliced'
>       track_transcript.feature_glyph = 'spliced'
>       track_transcript.feature_colour = [0,0.5,0]
>       
>       # Add data to tracks
>       DATA.each do |line|
>         line.chomp!
>         ref, type, name, location, link = line.split(/\s+/)
>         if link == ''
>           link = nil
>         end
>         if type == 'SNP'
>           track_SNP.add_feature(name, location, link)
>         elsif type == 'gene'
>           track_gene.add_feature(name, location, link)
>         elsif type == 'transcript'
>           track_transcript.add_feature(name, location, link)
>         end
>       end
>       
>       # And draw
>       my_panel.draw('c:/my_panel.png')
>       
>       __END__
>       chr1  gene        CYP2D6      complement(80..120)
>       chr1  gene        ALDH        100..449
>       chr1  SNP         rs1234      107
>       chr1  gene        bla         complement(400..430)
>       chr1  SNP         rs9876      44
>       chr1  gene        some_gene   
> complement(join(170..231,264..299,350..360,409..445))
>       chr1  transcript  transcript1 join(250..300,390..425)
>       chr1  transcript  transcript2 253..330
>       chr1  transcript  transcript3 266..344
>       chr1  transcript  transcript4 
> complement(join(410..430,239..286,129..151))
> 
> Is the Bioext module really available within the current implementation 
> of the biographics gem?
> 
> Thanks
> 
> George
> 
-- 

Dr Jan Aerts
Bioinformatics Group
Roslin Institute
Roslin EH25 9PS
Scotland, UK
tel: +44 131 527 4198
skype: aerts_ri
website: http://saaientist.blogspot.com

----...and the obligatory disclaimer----
Roslin Institute is a company limited by guarantee, registered in
Scotland (registered number SC157100) and a Scottish Charity (registered
number SC023592). Our registered office is at Roslin, Midlothian, EH25
9PS. VAT registration number 847380013.

The information contained in this e-mail (including any attachments) is
confidential and is intended for the use of  the addressee only. The
opinions expressed within this e-mail (including any attachments) are
the opinions of the sender and do not necessarily constitute those of
Roslin Institute (Edinburgh) ("the Institute") unless specifically
stated by a sender who is duly authorised to do so on behalf of the
Institute.




More information about the BioRuby mailing list