Skip to content

Instantly share code, notes, and snippets.

@rjpbonnal
Created January 31, 2011 16:35
Show Gist options
  • Save rjpbonnal/804318 to your computer and use it in GitHub Desktop.
Save rjpbonnal/804318 to your computer and use it in GitHub Desktop.
Recover stats from genes list using targetscan filtered by miRNA 125b
def gene_list(genes_str)
genes_str.split("\n").select{|gene| !(gene.empty? || gene.match(/LOC/))}
end
def targetted_genes(genes_ary)
Bio::Kb::Targetscan::Prediction.where(['gene_symbol IN (?) and species = 9606', genes_ary]).select("distinct gene_symbol").count
end
def targetted_125b(genes_ary)
Bio::Kb::Targetscan::Prediction.search(genes_ary,'hsa-miR-125b').count
end
def show_time(genes_str)
genes = gene_list(genes_str)
{:targetscan_all=>targetted_genes(genes), :targetscan_125b=>targetted_125b(genes)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment