Skip to content

Commit

Permalink
GVBase 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kose-y committed Jan 5, 2024
1 parent ac80e29 commit 98ae619
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PGENFiles"
uuid = "bbb59ef6-f40c-4dde-a38e-7e7eb74f31f9"
authors = ["Seyoon Ko <[email protected]> and contributors"]
version = "0.2.0"
version = "0.2.1"

[deps]
BitIntegers = "c3b6d118-76ef-56ca-8cc7-ebb389d030a1"
Expand All @@ -14,7 +14,7 @@ Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
BitIntegers = "0.2, 0.3"
CSV = "0.10"
DataFrames = "1"
GeneticVariantBase = "0.1"
GeneticVariantBase = "0.1.2"
julia = "1.6"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/PGENFiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Mmap: mmap
import Base: unsafe_load
import GeneticVariantBase: GeneticData, Variant, VariantIterator, iterator
import GeneticVariantBase: chrom, pos, rsid, alleles, alt_allele, ref_allele
import GeneticVariantBase: maf, hwepval, infoscore, load_values!
import GeneticVariantBase: maf, hwepval, infoscore, alt_dosages!
export Pgen, iterator, n_samples, n_variants, get_genotypes, get_genotypes!
export alt_allele_dosage, alt_allele_dosage!, ref_allele_dosage, ref_allele_dosage!
BitIntegers.@define_integers 24
Expand Down
5 changes: 5 additions & 0 deletions src/dosage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,8 @@ function _get_difflist_dosage!(buf::Vector{T}, p::Pgen, dl::DiffList,
end
return offset + 2 * dl.len
end

function alt_dosages!(arr::AbstractArray{T}, p::Pgen, v::PgenVariant;
genobuf=Vector{UInt8}(undef, p.header.n_samples), genoldbuf=nothing) where T <: Real
alt_allele_dosage!(arr, genobuf, p, v; genoldbuf=genoldbuf)
end
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ end
@test all(isapprox.(d_bgen, d_pgen; atol=5e-5, nans=true))
PGENFiles.alt_allele_dosage!(d_pgen, g_pgen, p, v_pgen; genoldbuf=g_pgen_ld)
@test all(isapprox.(d_bgen, d_pgen; atol=5e-5, nans=true))
GeneticVariantBase.alt_dosages!(d_pgen, p, v_pgen; genobuf=g_pgen, genoldbuf=g_pgen_ld)
@test all(isapprox.(d_bgen, d_pgen; atol=5e-5, nans=true))
v_rt = v_pgen.record_type & 0x07
if v_rt != 0x02 && v_rt != 0x03 # non-LD-compressed. See Format description.
g_pgen_ld .= g_pgen
Expand Down

2 comments on commit 98ae619

@kose-y
Copy link
Member Author

@kose-y kose-y commented on 98ae619 Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/98255

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 98ae619f1db3c41669631c364506e1c44e261cb0
git push origin v0.2.1

Please sign in to comment.