Skip to content

Commit

Permalink
add gencode_genes function
Browse files Browse the repository at this point in the history
  • Loading branch information
sfchen committed Feb 22, 2016
1 parent 863e9ff commit f70307b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Reference/Gencode/Gencode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export GencodeGene,
GencodeExon,
gencode_load,
gencode_load_file,
gencode_locate
gencode_locate,
gencode_genes

include("config.jl")
include("index.jl")
Expand Down
14 changes: 14 additions & 0 deletions src/Reference/Gencode/search.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# get gene details by gene name, return a gene list
# for most cases, it will return a array with one record
function gencode_genes(index, genename)
genes = []
for (chr, genelist) in index
for gene in genelist
if gene.name == genename
push!(genes, gene)
end
end
end
return genes
end

# find which gene and which exon chr::pos locates in
function gencode_locate(index, chr, pos)
if !haskey(index, chr)
Expand Down

0 comments on commit f70307b

Please sign in to comment.