Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Mar 23, 2024
1 parent 77ab79d commit a1100a5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ tableFormat <- function(vcffile, region, samples, format, ids, qualval, pass, IN
#' bw$addContig("chr20")
#' bw$addFORMAT("GT", "1", "String", "Genotype");
#' bw$addSample("NA12878")
#' bw$addSample("NA12879")
#' s1 <- "chr20\t2006060\trs146931526\tG\tC\t100\tPASS\t.\tGT\t1|0\t1|1"
#' s1 <- "chr20\t2006060\t.\tG\tC\t100\tPASS\t.\tGT\t1|0"
#' tryCatch((bw$writeline(s1)), error=function(e) e)
#' bw$close()
NULL
Expand Down
3 changes: 1 addition & 2 deletions man/vcfwriter.Rd

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

3 changes: 1 addition & 2 deletions src/vcf-writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ using namespace std;
//' bw$addContig("chr20")
//' bw$addFORMAT("GT", "1", "String", "Genotype");
//' bw$addSample("NA12878")
//' bw$addSample("NA12879")
//' s1 <- "chr20\t2006060\trs146931526\tG\tC\t100\tPASS\t.\tGT\t1|0\t1|1"
//' s1 <- "chr20\t2006060\t.\tG\tC\t100\tPASS\t.\tGT\t1|0"
//' tryCatch((bw$writeline(s1)), error=function(e) e)
//' bw$close()
class vcfwriter {
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-modify-vcf.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library(testthat)

test_that("modify the genotypes", {
skip_on_os(c("windows"), arch = NULL)
outvcf <- paste0(tempfile(), ".vcf.gz")
bw <- vcfwriter$new(outvcf, "VCF4.3")
bw$addContig("chr20")
Expand Down Expand Up @@ -32,6 +33,7 @@ test_that("modify the genotypes", {
})

test_that("modify item in FORMAT", {
skip_on_os(c("windows"), arch = NULL)
## creat a VCF with GP in FORMAT
outvcf <- paste0(tempfile(), ".vcf.gz")
bw <- vcfwriter$new(outvcf, "VCF4.3")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-vcf-writer.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_that("vcfwriter: writing variant works", {
bw$addContig("chr20")
bw$addFILTER("PASS", "All filters passed")
bw$addINFO("AF", "A", "Float", "Estimated allele frequency in the range (0,1)");
s1 <- "chr20\t2006060\trs146931526\tG\tC\t100\tPASS\t."
s1 <- "chr20\t2006060\t.\tG\tC\t100\tPASS\t."
bw$writeline(s1)
bw$close()
## tests
Expand Down

0 comments on commit a1100a5

Please sign in to comment.