Skip to content

Instantly share code, notes, and snippets.

@wakuteka
Created March 20, 2012 08:34
Show Gist options
  • Save wakuteka/2132902 to your computer and use it in GitHub Desktop.
Save wakuteka/2132902 to your computer and use it in GitHub Desktop.
#!/bin/ruby
require 'ensembl'
include Ensembl::Core
DBConnection.connect('homo_sapiens', 60)
my_gene = Gene.find_by_name('BRCA2')
puts my_gene.name + "\t" + my_gene.slice.to_s
my_variations = my_gene.slice.get_valiation_features
puts my_variations.length.to_s + "\t" + my_variations[0].variation_name
my_locus = Slice.fetch_by_region('chromosome','13',32889000,33000000,1)
puts my_gene.slice.within?(my_locus)
slice = Slice.fetch_by_region('chromosome','4',10000,100000)
slice.genes.each do |gene|
puts gene.name
gene.transcripts.each do |transcript|
puts transcript.stable_id + "\t" + transcript.exons.length.to_s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment