Skip to content

Commit

Permalink
Added readgtf and readembl
Browse files Browse the repository at this point in the history
  • Loading branch information
kdyrhage committed Nov 21, 2024
1 parent d09ec34 commit 55d1e3b
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,23 @@ end
"""
readgbk(input)
Parse GenBank-formatted file, returning a `Vector{GenBank.Record}`. File names ending in ".gz" are assumed to be gzipped and are decompressed.
Parse GenBank-formatted file, returning a `Vector{Record}`. File names ending in ".gz" are assumed to be gzipped and are decompressed.
"""
function readgbk(input)
collect(open(GenBank.Reader, input))
end


"""
readembl(input)
Parse EMBL-formatted file, returning a `Vector{Record}`. File names ending in ".gz" are assumed to be gzipped and are decompressed.
"""
function readembl(input)
collect(open(EMBL.Reader, input))
end


"""
readgff(input)
Expand All @@ -77,10 +87,21 @@ function readgff(input)
collect(open(GFF.Reader, input))
end


"""
readgff(input)
Parse GTF/GFF2-formatted file, returning a `Vector{Record}`. File names ending in ".gz" are assumed to be gzipped and are decompressed.
"""
function readgtf(input)
collect(open(GTF.Reader, input))
end


"""
relative_position(gene::AbstractGene, point::Symbol = :start)
Returns the relative position of `gene` on `parent(gene)`, on the interval (0,1]. The keyword `point` determines which of the `:start`, `:middle`, or `:stop` should be counted.
Return the relative position of `gene` on `parent(gene)`, on the interval (0,1]. The keyword `point` determines which of the `:start`, `:middle`, or `:stop` should be counted.
"""
relative_position(gene::AbstractGene, point = :start) = relative_position(parent(gene).sequence, locus(gene), point; iscomplement = iscomplement(gene))
function relative_position(chrseq, loc::AbstractLocus, point = :start; iscomplement = false)
Expand Down

0 comments on commit 55d1e3b

Please sign in to comment.