Skip to content

Commit

Permalink
v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Sep 22, 2024
1 parent acbc854 commit f3e5ce5
Show file tree
Hide file tree
Showing 23 changed files with 113 additions and 36 deletions.
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# vcfppR 0.5.0
* upgrade `vcfpp.h` to v0.5.1
* add `bcfreader$updateSamples()` function
* `vcfcomp`: can take `vcftable` object as input
* `vcfcomp`: defaults changed `setid=FALSE`
* bug fix


# vcfppR 0.4.6
* add `vcfplot` function
* fix bug in `vcftable` when FORMAT has unaligned list
Expand Down
24 changes: 20 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ Want to investigate the concordance between two VCF files? `vcfcomp` is the util
```{r r2}
res <- vcfcomp(test = rawvcf, truth = phasedvcf,
stats = "r2", region = "chr21:1-5100000",
formats = c("GT","GT"))
formats = c("GT","GT"), setid = TRUE)
par(mar=c(5,5,2,2), cex.lab = 2)
vcfplot(res, col = 2,cex = 2, lwd = 3, type = "b")
```

```{r pse}
res <- vcfcomp(test = rawvcf, truth = phasedvcf,
stats = "pse",
stats = "pse", setid = TRUE,
region = "chr21:5000000-5500000",
samples = "HG00673,NA10840",
return_pse_sites = TRUE)
Expand Down Expand Up @@ -124,9 +124,25 @@ vcfplot(res, main = "Structure Variant Counts", col = 1:7)

## R API of vcfpp.h

There are two classes i.e. ***vcfreader*** and ***vcfwriter*** offering the full R-bindings of vcfpp.h. Check out the examples in the [tests](tests/testthat) folder or refer to the manual.
There are two classes i.e. ***vcfreader*** and ***vcfwriter*** offering the full
R-bindings of vcfpp.h. Check out the examples in the [tests](tests/testthat)
folder or refer to the manual, e.g. `?vcfppR::vcfreader`.

```r
?vcfppR::vcfreader
library(testthat)
test_that("can change samples name and set genotypes for single sample", {
br <- vcfreader$new(svfile, "", "HG00096")
br$variant()
br$genotypes(F)
br$setGenotypes(c(1L,1L))
outfile <- paste0(tempfile(), ".vcf.gz")
br$output(outfile)
br$updateSamples("ZZZZZ")
br$write()
br$close()
vcf <- vcftable(outfile)
expect_true(vcf$gt==2)
expect_true(vcf$samples=="ZZZZZ")
})
```

23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ to calculate the genotype correlation between the test and the truth.
``` r
res <- vcfcomp(test = rawvcf, truth = phasedvcf,
stats = "r2", region = "chr21:1-5100000",
formats = c("GT","GT"))
formats = c("GT","GT"), setid = TRUE)
par(mar=c(5,5,2,2), cex.lab = 2)
vcfplot(res, col = 2,cex = 2, lwd = 3, type = "b")
```
Expand All @@ -106,7 +106,7 @@ vcfplot(res, col = 2,cex = 2, lwd = 3, type = "b")

``` r
res <- vcfcomp(test = rawvcf, truth = phasedvcf,
stats = "pse",
stats = "pse", setid = TRUE,
region = "chr21:5000000-5500000",
samples = "HG00673,NA10840",
return_pse_sites = TRUE)
Expand Down Expand Up @@ -146,8 +146,23 @@ vcfplot(res, main = "Structure Variant Counts", col = 1:7)

There are two classes i.e. ***vcfreader*** and ***vcfwriter*** offering
the full R-bindings of vcfpp.h. Check out the examples in the
[tests](tests/testthat) folder or refer to the manual.
[tests](tests/testthat) folder or refer to the manual,
e.g. `?vcfppR::vcfreader`.

``` r
?vcfppR::vcfreader
library(testthat)
test_that("can change samples name and set genotypes for single sample", {
br <- vcfreader$new(svfile, "", "HG00096")
br$variant()
br$genotypes(F)
br$setGenotypes(c(1L,1L))
outfile <- paste0(tempfile(), ".vcf.gz")
br$output(outfile)
br$updateSamples("ZZZZZ")
br$write()
br$close()
vcf <- vcftable(outfile)
expect_true(vcf$gt==2)
expect_true(vcf$samples=="ZZZZZ")
})
```
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/PULL_REQUEST_TEMPLATE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/concordance-of-two-vcf-files.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 20 additions & 6 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 2.0.9
pkgdown_sha: ~
articles:
concordance-of-two-vcf-files: concordance-of-two-vcf-files.html
last_built: 2024-05-24T08:40Z
last_built: 2024-09-22T08:53Z

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f3e5ce5

Please sign in to comment.