Skip to content

Generate cartoon depictions of your gene knockouts

Notifications You must be signed in to change notification settings

i-dcc/allele_image

Repository files navigation

allele_image

DESCRIPTION:

Generate allele images in a specified format from a genomic data. By default the genomic data will be in GenBank format and the images will be rendered in PNG format.

Only 10 “TYPE”s of things are in our cassette regions:

[

'SSR_site',
'polyA_site',
'misc_feature',
'gateway',
'gene',
'LRPCR_primer',
'intron',
'primer_bind',
'promoter',
'PCR_primer',
'exon'

]

How many of these are we interested in displaying (probably all). What do we want to display in each case. Which of these are “main” features and which are “annotation” features?

Based on www.sanger.ac.uk/htgt/report/gene_report?project_id=47462, we may have to change the way we process the rows and sections. It may mean that we do not have to separate the annotation features from the main features. We should just not consider the annotation features when we are calculating the widths of sections.

Bill has an example of what the images should look like in the link below. Develop the images to that specification:

www.knockoutmouse.org/about/view-all-ikmc-allele-types

TODO/REFACTOR

--------                   ----------

INPUT -> / parser / -> CONSTRUCT -> / renderer / -> OUTPUT

--------                   ----------

(new selects the INPUT parser and the render displays the image in the OUTPUT format)

CONSTRUCT could be a JSON string, Ruby Hash, or perhaps a more sophisticated object. It should have the following attributes:

:features => [ { :name, :type, :start, :stop } ]
:circular => Bool
:label    => String

It should perhaps also have the following (have not decided) attributes as well OR :features should be split into the following groups:

:cassette
:backbone
:five_arm
:three_arm
:five_flank
:three_flank

The renderer has to decide on how to navigate the features and render it to the given format based on these attributes. The defaults for INPUT and OUTPUT are GenBank and PNG respectively.

The code layout should be something like the following:

CONSTRUCT::IMAGE
CONSTRUCT::RENDERABLE_FEATURES
CONSTRUCT::PARSER::INPUT
CONSTRUCT::RENDERER::OUTPUT

That way, when we want to create a new CONSTRUCT::IMAGE object, it selects the PARSER and RENDERER to use based on the specified INPUT and OUTPUT formats:

CONSTRUCT::IMAGE.new( DATA [, { optional arguments }] ) -> CONSTRUCT::IMAGE

When we call the render method, an image in the OUTPUT format gets generated.

CONSTRUCT::IMAGE.new( DATA ).render() -> OUTPUT

Any RENDERER should be able to render all the features listed in a configuration file or schema (RENDERABLE_FEATURES). How it handles these are up to the RENDERER. Any features not on this list should be ignored (with a warning). Perhaps the RENDERER should be a mixin?

FEATURES/PROBLEMS:

  • Render images in various formats (PNG, SVG, Text)

  • Accept data from different sources (GenBank file, database)

SYNOPSIS:

require "allele_image"

allele_image = AlleleImage::Image.new( "/path/to/genbank/file.gbk" )
magick_image = allele_image.render()

# the image is a Magick::Image
magick_image.write( "/path/to/image/file.png" )

REQUIREMENTS:

  • RMagick

  • bioruby

INSTALL:

  • sudo gem install allele_image

LICENSE:

(The MIT License)

Copyright © 2010 Genome Research Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.