From ae0669768dd1fb4b2348fe03cf665eeff3ee7da8 Mon Sep 17 00:00:00 2001 From: Zilong-Li Date: Tue, 2 Jul 2024 15:06:48 +0200 Subject: [PATCH] add VERBOSE --- .github/workflows/mac.yml | 10 +++++----- Doxyfile | 2 +- vcfpp.h | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 6a7be8a..93f7b9a 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -2,7 +2,7 @@ name: MacOS on: push: - branches: [ main, dev ] + branches: [ main, doc ] pull_request: branches: [ main ] @@ -23,8 +23,8 @@ jobs: - name: test run: | cd test - export LIBRARY_PATH="${LIBRARY_PATH}:$(brew --prefix)/lib" - export C_INCLUDE_PATH="${C_INCLUDE_PATH}:$(brew --prefix)/include" - export CPPFLAGS="-I"$(brew --prefix)/include - make + export LIBRARY_PATH=${LIBRARY_PATH}:$(brew --prefix)/lib + export C_INCLUDE_PATH=${C_INCLUDE_PATH}:$(brew --prefix)/include + export CPPFLAGS=-I"$(brew --prefix)/include" + make HTSINC=$(brew --prefix)/include HTSLIB=$(brew --prefix)/lib make test diff --git a/Doxyfile b/Doxyfile index 855554c..def52bd 100644 --- a/Doxyfile +++ b/Doxyfile @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = /home/zilong/Projects/mysite/content/proj +OUTPUT_DIRECTORY = /home/zilong/Projects/mysite/public/proj # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and diff --git a/vcfpp.h b/vcfpp.h index 89f86ed..9627cd4 100644 --- a/vcfpp.h +++ b/vcfpp.h @@ -2,7 +2,7 @@ * @file https://github.com/Zilong-Li/vcfpp/vcfpp.h * @author Zilong Li * @email zilong.dk@gmail.com - * @version v0.3.9 + * @version v0.4.0 * @breif a single C++ file for manipulating VCF * Copyright (C) 2022-2023.The use of this code is governed by the LICENSE file. ******************************************************************************/ @@ -497,7 +497,9 @@ class BcfRecord ret = bcf_get_genotypes(header->hdr, line.get(), >s, &ndst); if(ret <= 0) { +# if defined(VERBOSE) std::cerr << "GT not present for current site. did you initilize the variant object?\n"; +# endif return false; } // if nploidy is not set manually. find the max nploidy using the first variant (eg. 2) resize v as @@ -568,7 +570,9 @@ class BcfRecord ret = bcf_get_genotypes(header->hdr, line.get(), >s, &ndst); if(ret <= 0) { +# if defined(VERBOSE) std::cerr << "GT not present for current site. did you initilize the variant object?\n"; +# endif return false; } v.resize(ret); @@ -767,8 +771,10 @@ class BcfRecord } else { +# if defined(VERBOSE) std::cerr << "there are multiple values for " + tag + " in INFO for current site. please use vector instead\n"; +# endif return false; } } @@ -825,7 +831,9 @@ class BcfRecord } if(ret < 0) { +# if defined(VERBOSE) std::cerr << "couldn't set " + tag + " for this variant.\nplease add the tag in headerfirst.\n"; +# endif return false; } return true; @@ -861,7 +869,9 @@ class BcfRecord if(ret < 0) { +# if defined(VERBOSE) std::cerr << "couldn't set " + tag + " for this variant.\nplease add the tag in headerfirst.\n"; +# endif return false; } return true; @@ -927,7 +937,9 @@ class BcfRecord if(bcf_update_genotypes(header->hdr, line.get(), gt, v.size()) < 0) { free(gt); +# if defined(VERBOSE) std::cerr << "couldn't set genotypes correctly.\n"; +# endif return false; } free(gt); @@ -994,7 +1006,9 @@ class BcfRecord if(ret < 0) { +# if defined(VERBOSE) std::cerr << "couldn't set format " + tag + " corectly.\n"; +# endif return false; } return true; @@ -1026,7 +1040,9 @@ class BcfRecord } if(ret < 0) { +# if defined(VERBOSE) std::cerr << "couldn't set format " + tag + " corectly.\n"; +# endif return false; } return true;