From 0d1eec3ed3e9ba65a118e6b86a6a8c80779de153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20O=27Mara?= Date: Mon, 9 Jan 2023 12:48:54 +1100 Subject: [PATCH] Subtype from XAMRecord --- CHANGELOG.md | 2 ++ src/XAM.jl | 3 ++- src/bam/bam.jl | 2 +- src/bam/record.jl | 2 +- src/sam/record.jl | 2 +- src/sam/sam.jl | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd21a88..938f911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Subtype from XAMReader and XAMWriter from common abstract types. +- Subtype from XAMRecord. +- Unified flag queries. ## [0.3.1] diff --git a/src/XAM.jl b/src/XAM.jl index b3f5e4c..2ae8ac8 100644 --- a/src/XAM.jl +++ b/src/XAM.jl @@ -5,7 +5,8 @@ using BioGenerics export SAM, BAM - + +abstract type XAMRecord end abstract type XAMReader <: BioGenerics.IO.AbstractReader end abstract type XAMWriter <: BioGenerics.IO.AbstractWriter end diff --git a/src/bam/bam.jl b/src/bam/bam.jl index 41aea12..03ef9fd 100644 --- a/src/bam/bam.jl +++ b/src/bam/bam.jl @@ -6,7 +6,7 @@ module BAM using BioGenerics using GenomicFeatures using XAM.SAM -import ..XAM: flag, XAMReader, XAMWriter +import ..XAM: flag, XAMRecord, XAMReader, XAMWriter import BGZFStreams import BioAlignments diff --git a/src/bam/record.jl b/src/bam/record.jl index bd092e8..db33f88 100644 --- a/src/bam/record.jl +++ b/src/bam/record.jl @@ -6,7 +6,7 @@ Create an unfilled BAM record. """ -mutable struct Record +mutable struct Record <: XAMRecord # fixed-length fields (see BMA specs for the details) block_size::Int32 refid::Int32 diff --git a/src/sam/record.jl b/src/sam/record.jl index ef8bb6d..befa967 100644 --- a/src/sam/record.jl +++ b/src/sam/record.jl @@ -1,7 +1,7 @@ # SAM Record # ========== -mutable struct Record +mutable struct Record <: XAMRecord # Data and filled range. data::Vector{UInt8} filled::UnitRange{Int} # Note: Specifies the data in use. diff --git a/src/sam/sam.jl b/src/sam/sam.jl index 0e25d39..70cf2de 100644 --- a/src/sam/sam.jl +++ b/src/sam/sam.jl @@ -11,7 +11,7 @@ import BioGenerics.Exceptions: missingerror import BioGenerics.Automa: State import BioSequences import TranscodingStreams: TranscodingStreams, TranscodingStream -import ..XAM: flag, XAMReader, XAMWriter +import ..XAM: flag, XAMRecord, XAMReader, XAMWriter using Printf: @sprintf