diff --git a/Project.toml b/Project.toml index 473a4e3..cb283f3 100644 --- a/Project.toml +++ b/Project.toml @@ -20,8 +20,8 @@ BGZFStreams = "0.3" BioAlignments = "2" BioGenerics = "0.1" BioSequences = "2.0.4" -GenomicFeatures = "2" -Indexes = "0.1" +GenomicFeatures = "3" +Indexes = "0.3" TranscodingStreams = "0.6, 0.7, 0.8, 0.9" julia = "1" diff --git a/docs/src/man/hts-files.md b/docs/src/man/hts-files.md index 77f96d8..4330676 100644 --- a/docs/src/man/hts-files.md +++ b/docs/src/man/hts-files.md @@ -220,7 +220,7 @@ close(reader) ## Getting records overlapping genomic features -The `eachoverlap` method also accepts the `Interval` type defined in [GenomicFeatures.jl](https://github.com/BioJulia/GenomicFeatures.jl). +The `eachoverlap` method also accepts the `GenomicInterval` type defined in [GenomicFeatures.jl](https://github.com/BioJulia/GenomicFeatures.jl). This allows you to do things like first read in the genomic features from a GFF3 file, and then for each feature, iterate over all the BAM records that overlap with that feature. diff --git a/src/bam/overlap.jl b/src/bam/overlap.jl index 24e3166..5d5bbf9 100644 --- a/src/bam/overlap.jl +++ b/src/bam/overlap.jl @@ -15,12 +15,12 @@ function Base.eltype(::Type{OverlapIterator{T}}) where T return Record end -function GenomicFeatures.eachoverlap(reader::Reader, interval::Interval) +function GenomicFeatures.eachoverlap(reader::Reader, interval::GenomicInterval) return GenomicFeatures.eachoverlap(reader, GenomicFeatures.seqname(interval), GenomicFeatures.leftposition(interval):GenomicFeatures.rightposition(interval)) end function GenomicFeatures.eachoverlap(reader::Reader, interval) - return GenomicFeatures.eachoverlap(reader, convert(Interval, interval)) + return GenomicFeatures.eachoverlap(reader, convert(GenomicInterval, interval)) end function GenomicFeatures.eachoverlap(reader::Reader, refname::AbstractString, interval::UnitRange) diff --git a/test/test_bam.jl b/test/test_bam.jl index beb6d03..e8cbb6c 100644 --- a/test/test_bam.jl +++ b/test/test_bam.jl @@ -246,7 +246,7 @@ reader = open(BAM.Reader, filepath, index=filepath * ".bai") @test isa(eachoverlap(reader, "chr1", 1:100), BAM.OverlapIterator) - @test isa(eachoverlap(reader, GenomicFeatures.Interval("chr1", 1, 100)), BAM.OverlapIterator) + @test isa(eachoverlap(reader, GenomicFeatures.GenomicInterval("chr1", 1, 100)), BAM.OverlapIterator) # expected values are counted using samtools for (refname, interval, expected) in [