Skip to content
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
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ build-job:
- docker buildx build --cache-from type=local,src=${HOME}/docker-cache/base --cache-from type=local,src=${HOME}/docker-cache/build --cache-from type=local,src=${HOME}/docker-cache/run --cache-to type=inline --platform="${PLATFORMS}" --build-arg THREADS=${THREADS} --target run -t ${CI_REPO}:${DOCKER_TAG} -f Dockerfile --push .
variables:
GIT_SUBMODULE_STRATEGY: recursive
# Work around <https://gitlab.com/gitlab-org/gitlab-runner/-/work_items/39384>
# See <https://gitlab.com/gitlab-org/gitlab-runner/-/work_items/38908>
GIT_STRATEGY: clone

# The arm container build takes like 90 minutes, so we don't want to run it
# before the main test phase where the other long tests live.
Expand Down Expand Up @@ -243,6 +246,9 @@ production-build-job:
# manage to hit a 6 hour timeout on our extremely slow emulators.
variables:
GIT_SUBMODULE_STRATEGY: recursive
# Work around <https://gitlab.com/gitlab-org/gitlab-runner/-/work_items/39384>
# See <https://gitlab.com/gitlab-org/gitlab-runner/-/work_items/38908>
GIT_STRATEGY: clone

# We also run the toil-vg/pytest-based tests
# Note that WE ONLY RUN TESTS LISTED IN vgci/test-list.txt
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "vcflib"]
path = deps/vcflib
url = https://github.com/vcflib/vcflib.git
url = https://github.com/vgteam/vcflib.git
[submodule "gssw"]
path = deps/gssw
url = https://github.com/vgteam/gssw.git
Expand Down
2 changes: 1 addition & 1 deletion deps/vcflib
Submodule vcflib updated 2 files
+1 −1 .gitmodules
+1 −1 contrib/fastahack
5 changes: 5 additions & 0 deletions src/constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,11 @@ namespace vg {
exit(1);
}
for (auto& kv : *(reference->index)) {
if (reference_for.count(kv.first)) {
#pragma omp critical (cerr)
cerr << "error:[vg::Constructor] Contig " << kv.first << " appears multiple times" << endl;
exit(1);
}
// For every sequence name and index entry, point to this reference
reference_for[kv.first] = reference;
#ifdef debug
Expand Down
15 changes: 14 additions & 1 deletion test/t/02_vg_construct.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PATH=../bin:$PATH # for vg

export LC_ALL="C" # force a consistent sort order

plan tests 30
plan tests 33

is $(vg construct -m 1000 -r small/x.fa -v small/x.vcf.gz | vg stats -z - | grep nodes | cut -f 2) 210 "construction produces the right number of nodes"

Expand Down Expand Up @@ -120,3 +120,16 @@ is $? 0 "Reference with ambiguity codes has them coerced to Ns"
is "$(vg view -j tiny.vg | jq -r '.node[].sequence' | tr -d 'ACGT\n' | wc -c)" "10" "Expected number of Ns are created"
rm -f tiny.vg

vg construct -r small/x.fa -r small/x.fa > /dev/null
is $? 1 "Names may not be duplicated across files"
sed "s/y/x/" small/xy.fa > xx.fa
samtools faidx xx.fa
# Samtools drops duplicate entries so we need to manually make an index with duplicates.
cat xx.fa.fai xx.fa.fai >xx.fa.fai2
mv xx.fa.fai2 xx.fa.fai
vg construct -r xx.fa > /dev/null
is $? 1 "Names may not be duplicated within an index"
rm -f xx.fa.fai
vg construct -r xx.fa > /dev/null
is $? 1 "Names may not be duplicated within an unindexed file"
rm -f xx.fa xx.fa.fai
Loading