Skip to content

Commit

Permalink
pipeline: add NKMERS= to vcfcov
Browse files Browse the repository at this point in the history
Fixes #45. Thanks to @peterdfields.

- ctx_vcfcov.c: ignore -n,--nkmers if --low-mem is passed
- update htslib
- add some comments to tests
  • Loading branch information
noporpoise committed Oct 30, 2016
1 parent a4b8bb4 commit ee3c752
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
10 changes: 5 additions & 5 deletions scripts/make-pipeline.pl
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,16 @@ sub print_usage
STAMPY_BASE='.(defined($stampy_base) ? $stampy_base : '').'
# Set up memory, threads and number of kmers in the graph
CTX_ARGS=
ifdef MEM
CTX_ARGS:=$(CTX_ARGS) -m $(MEM)
CTX_ARGS_MEM=-m $(MEM)
endif
ifdef NKMERS
CTX_ARGS:=$(CTX_ARGS) -n $(NKMERS)
CTX_ARGS_NKMERS=-n $(NKMERS)
endif
ifdef NTHREADS
CTX_ARGS:=$(CTX_ARGS) -t $(NTHREADS)
CTX_ARGS_THREADS=-t $(NTHREADS)
endif
CTX_ARGS=$(CTX_ARGS_MEM) $(CTX_ARGS_NKMERS) $(CTX_ARGS_THREADS)
#
# Parse USE_LINKS and JOINT_CALLING Makefile options
Expand Down Expand Up @@ -939,7 +939,7 @@ sub merge_vcf_list
for my $assem (qw(links plain)) {
my $callroot = "$call.$pop.$assem.$kmerstr";
print "$proj/k$k/vcfcov/$callroot.%.vcf.gz: $proj/vcfs/$callroot.vcf.gz $proj/k$k/graphs/%.raw.ctx | dirs\n";
print "\t( $mccortex vcfcov -m \$(MEM) \$(VCFCOV_ARGS) --ref $ref_path --out-fmt vcfgz \$^ | \$(BCFTOOLS) view --samples \"\$*\" -o \$@ -O z ) >& \$@.log\n\n";
print "\t( $mccortex vcfcov \$(CTX_ARGS_MEM) \$(CTX_ARGS_NKMERS) \$(VCFCOV_ARGS) --ref $ref_path --out-fmt vcfgz \$^ | \$(BCFTOOLS) view --samples \"\$*\" -o \$@ -O z ) >& \$@.log\n\n";
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/mccortex
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
set -euo pipefail

function usage {
echo "usage mccortex <K> ..." >&2
echo " wrapper to find the correct mccortex binary given kmer size (K)" >&2
echo "usage: mccortex <K> [<cmd> ...]" >&2
echo " Wrapper to find the correct mccortex binary given kmer size (K)" >&2
exit -1
}

Expand Down
7 changes: 7 additions & 0 deletions src/commands/ctx_vcfcov.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ int ctx_vcfcov(int argc, char **argv)
if(use_lowmem && use_himem)
cmd_print_usage("Cannot use --low-mem and --high-mem together!");

// Override number of kmers to use if --low-mem passed, since we calculate
// number of kmers required anyway
if(use_lowmem && memargs.num_kmers_set) {
memargs.num_kmers_set = 0;
memargs.num_kmers_set = false;
}

if(!max_allele_len) max_allele_len = DEFAULT_MAX_ALLELE_LEN;
if(!max_gt_vars) max_gt_vars = DEFAULT_MAX_GT_VARS;

Expand Down
5 changes: 5 additions & 0 deletions tests/pipeline/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
SHELL=/bin/bash -euo pipefail

#
# Simulate reads from two given samples, with sequencing error of 1%, 50X, 100bp
# Call variants and check that we get exactly the expected variants
#

CTXDIR=../..
MCCORTEX=$(CTXDIR)/bin/mccortex31
DNACAT=$(CTXDIR)/libs/seq_file/bin/dnacat
Expand Down

0 comments on commit ee3c752

Please sign in to comment.