1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-14 22:33:14 +00:00

Update SAM.sequence to return BioSequences.LongDNA{4}

BioSequences v3 changed LongDNASeq to LongDNA{N}. We can't assume that
there aren't ambiguous nucleotides in a SAM file, so use the larger
LongDNA variant. The method signatures are also simplified, so simplify
their calls, accordingly.
This commit is contained in:
Thomas A. Christensen II 2022-07-07 09:18:26 -05:00
parent e560681afa
commit 1660a24a0f
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -387,7 +387,7 @@ function hastemplength(record::Record)
end
"""
sequence(record::Record)::BioSequences.LongDNASeq
sequence(record::Record)::BioSequences.LongDNA{4}
Get the segment sequence of `record`.
"""
@ -398,7 +398,7 @@ function sequence(record::Record)
return nothing
end
seqlen = length(record.seq)
ret = BioSequences.LongDNASeq(seqlen)
ret = BioSequences.LongDNA{4}(undef, seqlen)
copyto!(ret, 1, record.data, first(record.seq), seqlen)
return ret
end