Skip to content

Commit

Permalink
more CRAN updates, minor high-chromcode update
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchang committed May 27, 2024
1 parent eff1264 commit 0df8e2a
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 16 deletions.
11 changes: 6 additions & 5 deletions 2.0/include/plink2_bgzf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -852,20 +852,21 @@ PglErr InitBgzfCompressStreamEx(const char* out_fname, uint32_t do_append, uint3
return kPglRetThreadCreateFail;
}
#else
if (unlikely(pthread_create(&(bgzfp->threads[compressor_thread_ct]),
# ifdef __cplusplus
if (unlikely(pthread_create(&(bgzfp->threads[compressor_thread_ct]),
&g_thread_startup.smallstack_thread_attr,
BgzfCompressWriterThread, bgzfp))) {
bgzfp->unfinished_init_state = (kMaxBgzfSlotCt << 4) | compressor_thread_ct;
return kPglRetThreadCreateFail;
}
# else
if (unlikely(pthread_create(&(bgzfp->threads[compressor_thread_ct]),
&smallstack_thread_attr,
# endif
BgzfCompressWriterThread, bgzfp))) {
# ifndef __cplusplus
pthread_attr_destroy(&smallstack_thread_attr);
# endif
bgzfp->unfinished_init_state = (kMaxBgzfSlotCt << 4) | compressor_thread_ct;
return kPglRetThreadCreateFail;
}
# if !defined(__cplusplus)
pthread_attr_destroy(&smallstack_thread_attr);
# endif
#endif
Expand Down
5 changes: 3 additions & 2 deletions 2.0/pgenlibr/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: pgenlibr
Type: Package
Title: PLINK 2 Binary (.pgen) Reader
Version: 0.3.6
Date: 2024-05-26
Date: 2024-05-27
Authors@R: c(person(given = "Christopher",
family = "Chang",
role = c("aut", "cre"),
Expand Down Expand Up @@ -33,6 +33,7 @@ Authors@R: c(person(given = "Christopher",
Description: A thin wrapper over PLINK 2's core libraries which provides an R
interface for reading .pgen files. A minimal .pvar loader is also
included. Chang et al. (2015) \doi{10.1186/s13742-015-0047-8}.
Encoding: UTF-8
License: LGPL (>= 3)
Copyright: This package includes sources of the libdeflate library owned by
Eric Biggers, sources of the SIMDe library owned by Evan Nemerson, sources
Expand All @@ -41,4 +42,4 @@ Copyright: This package includes sources of the libdeflate library owned by
BugReports: https://github.com/chrchang/plink-ng/issues
Imports: Rcpp (>= 1.0.1)
LinkingTo: Rcpp
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
29 changes: 27 additions & 2 deletions 2.0/pgenlibr/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# Generated by roxygen2: do not edit by hand

export(AlleleCodeBuf)
export(BoolBuf)
export(Buf)
export(ClosePgen)
export(ClosePvar)
export(GetAlleleCode)
export(GetAlleleCt)
export(GetMaxAlleleCt)
export(GetRawSampleCt)
export(GetVariantCt)
export(GetVariantId)
export(GetVariantsById)
export(HardcallPhasePresent)
export(IntAlleleCodeBuf)
export(IntBuf)
export(NewPgen)
export(NewPvar)
export(Read)
export(ReadAlleles)
export(ReadHardcalls)
export(ReadIntList)
export(ReadList)
export(VariantScores)
import(Rcpp)
importFrom(Rcpp,evalCpp)
useDynLib(pgenlibr, .registration=TRUE)
exportPattern("^[[:alpha:]]+")
importFrom(Rcpp, evalCpp)
4 changes: 2 additions & 2 deletions 2.0/pgenlibr/R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ BoolBuf <- function(pgen) {
.Call(`_pgenlibr_BoolBuf`, pgen)
}

#' Loads the variant_numth variant, and then fills buf with {0, 1, 2, NA}
#' Loads the variant_numth variant, and then fills buf with \{0, 1, 2, NA\}
#' values indicating the number of copies of the first ALT (or user-specified)
#' allele each sample has.
#'
Expand Down Expand Up @@ -187,7 +187,7 @@ ReadAlleles <- function(pgen, acbuf, variant_num, phasepresent_buf = NULL) {
#' @param variant_subset Integer vector containing 1-based indexes of variants
#' to load.
#' @return Integer matrix, where rows correspond to samples, columns
#' correspond to variant_subset, and values are in {0, 1, 2, NA} indicating
#' correspond to variant_subset, and values are in \{0, 1, 2, NA\} indicating
#' the number of hardcall ALT allele copies. For multiallelic variants, all
#' ALT alleles are combined.
#' @export
Expand Down
4 changes: 2 additions & 2 deletions 2.0/pgenlibr/src/pgenlibr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ LogicalVector BoolBuf(List pgen) {
return LogicalVector(rp->GetSubsetSize());
}

//' Loads the variant_numth variant, and then fills buf with {0, 1, 2, NA}
//' Loads the variant_numth variant, and then fills buf with \{0, 1, 2, NA\}
//' values indicating the number of copies of the first ALT (or user-specified)
//' allele each sample has.
//'
Expand Down Expand Up @@ -1023,7 +1023,7 @@ void ReadAlleles(List pgen, SEXP acbuf, int variant_num, Nullable<LogicalVector>
//' @param variant_subset Integer vector containing 1-based indexes of variants
//' to load.
//' @return Integer matrix, where rows correspond to samples, columns
//' correspond to variant_subset, and values are in {0, 1, 2, NA} indicating
//' correspond to variant_subset, and values are in \{0, 1, 2, NA\} indicating
//' the number of hardcall ALT allele copies. For multiallelic variants, all
//' ALT alleles are combined.
//' @export
Expand Down
2 changes: 1 addition & 1 deletion 2.0/plink2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static const char ver_str[] = "PLINK v2.00a6"
#elif defined(USE_AOCL)
" AMD"
#endif
" (26 May 2024)";
" (27 May 2024)";
static const char ver_str2[] =
// include leading space if day < 10, so character length stays the same
""
Expand Down
4 changes: 2 additions & 2 deletions 2.0/plink2_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,9 @@ CONSTI32(kMaxChrTextnumSlen, 2);
CONSTI32(kMaxChrTextnum, 995);

# ifdef __LP64__
CONSTI32(kChrExcludeWords, 32);
CONSTI32(kChrExcludeWords, 16);
# else
CONSTI32(kChrExcludeWords, 64);
CONSTI32(kChrExcludeWords, 32);
# endif

CONSTI32(kMaxChrTextnumSlen, 3);
Expand Down

0 comments on commit 0df8e2a

Please sign in to comment.