diff --git a/README.md b/README.md index b11b241..e234274 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,13 @@ depend on your connection to the servers. ## Read VCF as tabular data in R -This example shows how to read only SNP variants with FILTER=“PASS” and -GT format in the VCF/BCF into R tables: +This example shows how to read only SNP variants with genotypes in the +VCF/BCF into R tables: ``` r library(vcfppR) vcffile <- "https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/1000G_2504_high_coverage/working/20220422_3202_phased_SNV_INDEL_SV/1kGP_high_coverage_Illumina.chr21.filtered.SNV_INDEL_SV_phased_panel.vcf.gz" -res <- vcftable(vcffile, "chr21:1-5100000", vartype = "snps", pass = TRUE) +res <- vcftable(vcffile, "chr21:1-5100000", vartype = "snps") str(res) ``` diff --git a/src/htslib-1.18/Makefile.vcfppR b/src/htslib-1.18/Makefile.vcfppR index 212feaf..29d0272 100644 --- a/src/htslib-1.18/Makefile.vcfppR +++ b/src/htslib-1.18/Makefile.vcfppR @@ -38,7 +38,7 @@ CPPFLAGS = # TODO: probably update cram code to make it compile cleanly with -Wc++-compat # For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600 #CFLAGS = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600 -CFLAGS += -fpic -fvisibility=hidden +CFLAGS += -fpic -fvisibility=hidden -Wstrict-prototypes EXTRA_CFLAGS_PIC = TARGET_CFLAGS = LDFLAGS += -fvisibility=hidden diff --git a/src/htslib-1.18/Makefile.win b/src/htslib-1.18/Makefile.win index 926e12e..e82c351 100644 --- a/src/htslib-1.18/Makefile.win +++ b/src/htslib-1.18/Makefile.win @@ -41,7 +41,7 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DCURL_STATICLIB # TODO: probably update cram code to make it compile cleanly with -Wc++-compat # For testing strict C99 support add -std=c99 -D_XOPEN_SOURCE=600 #CFLAGS = -g -Wall -O2 -pedantic -std=c99 -D_XOPEN_SOURCE=600 -CFLAGS += -fpic -fvisibility=hidden +CFLAGS += -fpic -fvisibility=hidden -Wstrict-prototypes EXTRA_CFLAGS_PIC = TARGET_CFLAGS = LDFLAGS = -fvisibility=hidden diff --git a/src/htslib-1.18/header.c b/src/htslib-1.18/header.c index 1d2fee4..6d3a02e 100644 --- a/src/htslib-1.18/header.c +++ b/src/htslib-1.18/header.c @@ -2295,7 +2295,7 @@ void sam_hdr_incr_ref(sam_hdr_t *bh) { * Returns a sam_hrecs_t struct on success (free with sam_hrecs_free()) * NULL on failure */ -sam_hrecs_t *sam_hrecs_new() { +sam_hrecs_t *sam_hrecs_new(void) { sam_hrecs_t *hrecs = calloc(1, sizeof(*hrecs)); if (!hrecs) diff --git a/src/htslib-1.18/hfile.c b/src/htslib-1.18/hfile.c index f8d42e4..7b17437 100644 --- a/src/htslib-1.18/hfile.c +++ b/src/htslib-1.18/hfile.c @@ -955,7 +955,7 @@ void hfile_shutdown(int do_close_plugin) pthread_mutex_unlock(&plugins_lock); } -static void hfile_exit() +static void hfile_exit(void) { hfile_shutdown(0); pthread_mutex_destroy(&plugins_lock); @@ -1057,7 +1057,7 @@ static int init_add_plugin(void *obj, int (*init)(struct hFILE_plugin *), * Returns 0 on success, * <0 on failure */ -static int load_hfile_plugins() +static int load_hfile_plugins(void) { static const struct hFILE_scheme_handler data = { hopen_mem, hfile_always_local, "built-in", 80 }, diff --git a/src/htslib-1.18/hfile_libcurl.c b/src/htslib-1.18/hfile_libcurl.c index 1e4a448..04d222b 100644 --- a/src/htslib-1.18/hfile_libcurl.c +++ b/src/htslib-1.18/hfile_libcurl.c @@ -277,7 +277,7 @@ static void free_auth(auth_token *tok) { free(tok); } -static void libcurl_exit() +static void libcurl_exit(void) { if (curl_share_cleanup(curl.share) == CURLSHE_OK) curl.share = NULL; diff --git a/src/htslib-1.18/hts.c b/src/htslib-1.18/hts.c index b7b528a..ef2a0b3 100644 --- a/src/htslib-1.18/hts.c +++ b/src/htslib-1.18/hts.c @@ -81,7 +81,7 @@ KHASH_INIT2(s2i,, kh_cstr_t, int64_t, 1, kh_str_hash_func, kh_str_hash_equal) HTSLIB_EXPORT int hts_verbose = HTS_LOG_WARNING; -const char *hts_version() +const char *hts_version(void) { return HTS_VERSION_TEXT; } @@ -4900,7 +4900,7 @@ int hts_resize_array_(size_t item_size, size_t num, size_t size_sz, return 0; } -void hts_lib_shutdown() +void hts_lib_shutdown(void) { hfile_shutdown(1); } @@ -4914,7 +4914,7 @@ void hts_set_log_level(enum htsLogLevel level) hts_verbose = level; } -enum htsLogLevel hts_get_log_level() +enum htsLogLevel hts_get_log_level(void) { return hts_verbose; } diff --git a/src/htslib-1.18/htscodecs/htscodecs/htscodecs.c b/src/htslib-1.18/htscodecs/htscodecs/htscodecs.c index aad2c9c..35fc6b4 100644 --- a/src/htslib-1.18/htscodecs/htscodecs/htscodecs.c +++ b/src/htslib-1.18/htscodecs/htscodecs/htscodecs.c @@ -39,6 +39,6 @@ * NB: This is obtained from the auto-generated version.h, so * we can include release number and git hash. */ -const char *htscodecs_version() { +const char *htscodecs_version(void) { return HTSCODECS_VERSION_TEXT; } diff --git a/src/htslib-1.18/htscodecs/htscodecs/htscodecs.h b/src/htslib-1.18/htscodecs/htscodecs/htscodecs.h index 2465aa2..1dcd442 100644 --- a/src/htslib-1.18/htscodecs/htscodecs/htscodecs.h +++ b/src/htslib-1.18/htscodecs/htscodecs/htscodecs.h @@ -50,6 +50,6 @@ * NB: This is obtained from the auto-generated version.h, so * we can include release number and git hash. */ -const char *htscodecs_version(); +const char *htscodecs_version(void); #endif /* HTSCODECS_H */ diff --git a/src/htslib-1.18/sam.c b/src/htslib-1.18/sam.c index fc4e677..48623e0 100644 --- a/src/htslib-1.18/sam.c +++ b/src/htslib-1.18/sam.c @@ -100,7 +100,7 @@ const int8_t bam_cigar_table[256] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -sam_hdr_t *sam_hdr_init() +sam_hdr_t *sam_hdr_init(void) { sam_hdr_t *bh = (sam_hdr_t*)calloc(1, sizeof(sam_hdr_t)); if (bh == NULL) return NULL; @@ -410,7 +410,7 @@ const char *sam_parse_region(sam_hdr_t *h, const char *s, int *tid, *** BAM alignment I/O *** *************************/ -bam1_t *bam_init1() +bam1_t *bam_init1(void) { return (bam1_t*)calloc(1, sizeof(bam1_t)); } diff --git a/src/htslib-1.18/textutils.c b/src/htslib-1.18/textutils.c index 0cc2af8..b2c29a8 100644 --- a/src/htslib-1.18/textutils.c +++ b/src/htslib-1.18/textutils.c @@ -220,7 +220,7 @@ static char token_type(hts_json_token *token) } HTSLIB_EXPORT -hts_json_token * hts_json_alloc_token() { +hts_json_token * hts_json_alloc_token(void) { return calloc(1, sizeof(hts_json_token)); } diff --git a/src/htslib-1.18/vcf.c b/src/htslib-1.18/vcf.c index 9e589f9..032d8af 100644 --- a/src/htslib-1.18/vcf.c +++ b/src/htslib-1.18/vcf.c @@ -1519,7 +1519,7 @@ int bcf_hdr_write(htsFile *hfp, bcf_hdr_t *h) *** BCF site I/O *** ********************/ -bcf1_t *bcf_init() +bcf1_t *bcf_init(void) { bcf1_t *v; v = (bcf1_t*)calloc(1, sizeof(bcf1_t));