Skip to content

Instantly share code, notes, and snippets.

@helios

helios/gist:804318

Created Jan 31, 2011
Embed
What would you like to do?
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