Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA4GHTT-270: Merge changes from master (241, 247, 248) and porting 248 for 4.4 #251

Merged
merged 7 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 59 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
path: vcf_assembly_checker_linux


### Mac OS build
macos_build:
### Mac OS build intel
macos_build_intel:
runs-on: macos-12
strategy:
matrix:
Expand All @@ -84,33 +84,80 @@ jobs:
- name: Rename release files
if: ${{ matrix.config.cc == 'clang' }}
run: |
mv build/bin/vcf_validator vcf_validator_macos
mv build/bin/vcf_debugulator vcf_debugulator_macos
mv build/bin/vcf_assembly_checker vcf_assembly_checker_macos
mv build/bin/vcf_validator vcf_validator_macos_x64
mv build/bin/vcf_debugulator vcf_debugulator_macos_x64
mv build/bin/vcf_assembly_checker vcf_assembly_checker_macos_x64
- name: Upload vcf-validator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_validator_macos
path: vcf_validator_macos
name: vcf_validator_macos_x64
path: vcf_validator_macos_x64
- name: Upload vcf-debugulator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_debugulator_macos
path: vcf_debugulator_macos
name: vcf_debugulator_macos_x64
path: vcf_debugulator_macos_x64
- name: Upload vcf-assembly-checker
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_assembly_checker_macos
path: vcf_assembly_checker_macos
name: vcf_assembly_checker_macos_x64
path: vcf_assembly_checker_macos_x64

### Mac OS build arm
macos_build_arm:
runs-on: macos-14
strategy:
matrix:
config:
- {cc: "gcc", cxx: "g++"}
- {cc: "clang", cxx: "clang++"}

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
#brew update
HOMEBREW_NO_AUTO_UPDATE=1 brew install boost sqlite3 automake libtool
./install_dependencies.sh osx
- name: Compile and test
run: |
mkdir build && cd build && cmake -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_COMPILER=${{ matrix.config.cc }} ..
export LIBRARY_PATH=${LIBRARY_PATH}:/opt/homebrew/opt/icu4c/lib:/opt/homebrew/lib
make -j2
cd .. && ./build/bin/test_validation_suite
- name: Rename release files
if: ${{ matrix.config.cc == 'clang' }}
run: |
mv build/bin/vcf_validator vcf_validator_macos_arm64
mv build/bin/vcf_debugulator vcf_debugulator_macos_arm64
mv build/bin/vcf_assembly_checker vcf_assembly_checker_macos_arm64
- name: Upload vcf-validator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_validator_macos_arm64
path: vcf_validator_macos_arm64
- name: Upload vcf-debugulator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_debugulator_macos_arm64
path: vcf_debugulator_macos_arm64
- name: Upload vcf-assembly-checker
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_assembly_checker_macos_arm64
path: vcf_assembly_checker_macos_arm64


### Release job (tags only)
create_release:
if: startsWith(github.ref, 'refs/tags/')
needs: [ linux_build, macos_build ]
needs: [ linux_build, macos_build_intel, macos_build_arm ]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project (vcf-validator CXX C)

set (vcf-validator_VERSION_MAJOR 0)
set (vcf-validator_VERSION_MINOR 9)
set (vcf-validator_VERSION_PATCH 6)
set (vcf-validator_VERSION_PATCH 7)

configure_file (
"${PROJECT_SOURCE_DIR}/inc/cmake_config.hpp.in"
Expand Down
6 changes: 5 additions & 1 deletion inc/assembly_report/assembly_report.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ namespace ebi

void add_synonym(std::string synonym)
{
synonyms.push_back(synonym);
// Only add the synonym if there isn't one already
if (std::find(synonyms.begin(), synonyms.end(), synonym) == synonyms.end())
{
synonyms.push_back(synonym);
}
}

private:
Expand Down
1 change: 1 addition & 0 deletions inc/util/string_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace ebi
/**
* Splits `s` using `delims` as separator and fills the container `ret` with the parts.
* An empty string results in an empty container `ret`.
* Expects a string without leading separators and when one is present, it would be part of 1st string.
* @param s input string to split
* @param delims any character here acts as a separator
* @param ret return by reference the container filled with the string split.
Expand Down
2 changes: 1 addition & 1 deletion inc/vcf/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ namespace ebi
using BodySectionError::BodySectionError;
ChromosomeBodyError() : ChromosomeBodyError{0} {}
ChromosomeBodyError(size_t line) : ChromosomeBodyError{line,
"Chromosome is not a string without colons or whitespaces, optionally wrapped with angle brackets (<>)"} { }
"Chromosome is not a string without whitespaces, optionally wrapped with angle brackets (<>)"} { }
virtual ~ChromosomeBodyError() override { }
virtual void apply_visitor(ErrorVisitor &visitor) override { visitor.visit(*this); }
};
Expand Down
24 changes: 15 additions & 9 deletions inc/vcf/file_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,15 @@ namespace ebi
{ SVTYPE, { STRING, "1" } },
{ VALIDATED, { FLAG, "0" } },
{ THOUSAND_G, { FLAG, "0" } },
{ SVCLAIM, { STRING, "A" } }
{ SVCLAIM, { STRING, "A" } },
{ RN, { INTEGER, "A" } },
{ RUS, { STRING, UNKNOWN_CARDINALITY } },
{ RUL, { INTEGER, UNKNOWN_CARDINALITY } },
{ RUC, { FLOAT, UNKNOWN_CARDINALITY } },
{ RB, { INTEGER, UNKNOWN_CARDINALITY } },
{ CIRUC, { FLOAT, UNKNOWN_CARDINALITY } },
{ CIRB, { INTEGER, UNKNOWN_CARDINALITY } },
{ RUB, { INTEGER, UNKNOWN_CARDINALITY } }
};

const std::map<std::string, std::pair<std::string, std::string>> format_v41_v42 = {
Expand Down Expand Up @@ -422,19 +430,12 @@ namespace ebi
void set_types();

/**
* Checks that chromosome does not contain colons or white-spaces
* Checks that chromosome does not contain white-spaces
*
* @throw ChromosomeBodyError
*/
void check_chromosome() const;

/**
* Checks that chromosome does not contain any colons
*
* @throw ChromosomeBodyError
*/
void check_chromosome_no_colons() const;

/**
* Checks that chromosome does not contain any white-spaces
*
Expand Down Expand Up @@ -724,6 +725,11 @@ namespace ebi
* @throw InfoBodyError
*/
void check_info_have_mandatory() const;

/**
* gets total RN count
*/
int getRNvalue() const;
};

std::ostream &operator<<(std::ostream &os, const Record &record);
Expand Down
2 changes: 2 additions & 0 deletions inc/vcf/optional_policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ namespace ebi
void check_body_entry_info_svlen(ParsingState & state, Record const & record) const;
void check_body_entry_info_svclaim(ParsingState & state, Record const & record) const;
void check_body_entry_info_confidence_interval(ParsingState & state, Record const & record) const;
void check_body_entry_info_rb_ruc(ParsingState & state, Record const & record) const;
void check_body_entry_info_rul_rus(ParsingState & state, Record const & record) const;
void check_contig_meta(ParsingState & state, Record const & record) const;
void check_alternate_allele_meta(ParsingState & state, Record const & record) const;
void check_filter_meta(ParsingState & state, Record const & record) const;
Expand Down
8 changes: 8 additions & 0 deletions inc/vcf/string_constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ namespace ebi
const std::string VALIDATED = "VALIDATED";
const std::string THOUSAND_G = "1000G";
const std::string SVCLAIM = "SVCLAIM";
const std::string RN = "RN";
const std::string RUS = "RUS";
const std::string RUL = "RUL";
const std::string RUC = "RUC";
const std::string RB = "RB";
const std::string CIRUC = "CIRUC";
const std::string CIRB = "CIRB";
const std::string RUB = "RUB";

// FORMAT predefined tags
const std::string AHAP = "AHAP";
Expand Down
Loading