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

Unify G and T parameters in the make file #12

Merged
merged 12 commits into from
May 24, 2022
20 changes: 11 additions & 9 deletions bin/goldrush
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ x=10
h=3
j=48
s=1011011110110111101101
T=3000000000
r=0.9
M=5
p1=w$(w)_x$(x)
Expand All @@ -41,7 +40,6 @@ t=8
# Default Tigmint parameters
span=2
dist=1000
G=3e9
cut=250

# Default ntLink parameters
Expand Down Expand Up @@ -88,7 +86,7 @@ time=command memusg -t -o $@.time
endif
endif

.PHONY: help run clean wp2-tigmint-ntlink wp2-racon workpackage2 racon wp2-ntLink ntLink-with-wp2 wp2-tigmint tigmint wp2-tigmint-ntlink1 ntLink-with-tigmint wp2-tigmint-ntLink2 ntLink2 wp2-tigmint-ntLink3 ntLink3 wp2-tigmint-ntLink4 ntLink4 wp2-tigmint-ntLink5 ntLink5 wp2-tigmint-ntJoin ntJoin
.PHONY: help run clean wp2-tigmint-ntlink wp2-racon workpackage2 racon wp2-ntLink ntLink-with-wp2 wp2-tigmint tigmint wp2-tigmint-ntlink1 ntLink-with-tigmint wp2-tigmint-ntLink2 ntLink2 wp2-tigmint-ntLink3 ntLink3 wp2-tigmint-ntLink4 ntLink4 wp2-tigmint-ntLink5 ntLink5 wp2-tigmint-ntJoin ntJoin check-G
.DELETE_ON_ERROR:
.SECONDARY:

Expand All @@ -114,6 +112,7 @@ help:
@echo ""
@echo " General options (required):"
@echo " reads read name [reads]. File must have .fq.gz or .fa.gz extension"
@echo " G haploid genome size (bp) for calculating span parameter and target for generating silver paths(e.g. '3e9' for human genome). used in GoldRush-Path and Timignt. Required [3e9]"
jwcodee marked this conversation as resolved.
Show resolved Hide resolved
@echo ""
@echo " General options (optional):"
@echo " t number of threads for scaffolding and correction tools [8]"
Expand All @@ -131,16 +130,14 @@ help:
@echo " x threshold for number of hits in miBF for a given frame to be considered assigned [10]"
@echo " h the number of seed patterns to use [3]"
@echo " j number of threads to use [48]"
@echo " s spaced seed design [1011011110110111101101]"
@echo " T total genome size [3000000000]"
@echo " s spaced seed design [1011011110110111101101]"
@echo " M maximum number of silver paths to generate [5]"
@echo " r ratio of full genome in golden path [0.9]"
@echo " p1 prefix to use for the silver paths [w$(w)_x$(x)]"
@echo ""
@echo " Tigmint options:"
@echo " span min number of spanning molecules to be considered correctly assembled [2]"
@echo " dist maximum distance between alignments to be considered the same molecule [1000]"
@echo " G haploid genome size (bp) for calculating span parameter (e.g. '3e9' for human genome). Required when span=auto [3e9]"
@echo ""
@echo " ntLink options:"
@echo " k_ntLink k-mer size for minimizers [64]"
Expand Down Expand Up @@ -173,9 +170,14 @@ wp2-tigmint-ntJoin: ntJoin
ntlink_targets = $(shell for i in `seq 2 $(rounds)`; do printf "$(p2)_golden_path_1.racon-polished.span$(span).dist$(dist).tigmint.fa.k$(k_ntLink).w$(w_ntLink)"; for j in `seq 1 $$i`; do printf ".ntLink"; done; printf ".fa "; done)
wp2-tigmint-ntLink: ntLink1 $(ntlink_targets) ntLink_softlink

check-G:
ifndef G
$(error G is undefined. Try goldrush help for more information)
jwcodee marked this conversation as resolved.
Show resolved Hide resolved
endif


# Run workpackage2
workpackage2: $(p2)_golden_path_1.fq
workpackage2: $(p2)_golden_path_1.fq check-G
jwcodee marked this conversation as resolved.
Show resolved Hide resolved

$(p2)_golden_path_1.fq: $(p1)_golden_path_all.fq
$(time) goldrush-path -k $(k) -w $(w) -t $(tile) -u $(u) -a $(a) -l $(l) -o $(o) -p $(p2) -i $(p1)_golden_path_all.fq -h $(h) -j $(j) -P $(P) -x$(x) -s $(s) -m 0
Expand All @@ -185,7 +187,7 @@ $(p1)_golden_path_all.fq: $(p1)_golden_path_$(M).fq
cat $(p1)_golden_path_*.fq > $(p1)_golden_path_all.fq

$(p1)_golden_path_$(M).fq: $(long_reads)
$(time) goldrush-path -k $(k) -w $(w) -t $(tile) -u $(u) -a $(a) -l $(l) -o $(o) -p $(p1) -i $(long_reads) -h $(h) -j $(j) -x$(x) -P $(P) -s $(s) -T $(T) -r $(r) --new_temp_mode -M $(M) -m $(m)
$(time) goldrush-path -k $(k) -w $(w) -t $(tile) -u $(u) -a $(a) -l $(l) -o $(o) -p $(p1) -i $(long_reads) -h $(h) -j $(j) -x$(x) -P $(P) -s $(s) -T $(G) -r $(r) --new_temp_mode -M $(M) -m $(m)


# Run racon
Expand All @@ -210,7 +212,7 @@ ntLink-with-wp2: $(p2)_golden_path_1.racon-polished.fa.k$(k_ntLink).w$(w_ntLink)


# Run tigmint after wp2
tigmint: $(p2)_golden_path_1.racon-polished.span$(span).dist$(dist).tigmint.fa
tigmint: $(p2)_golden_path_1.racon-polished.span$(span).dist$(dist).tigmint.fa check-G

$(p2)_golden_path_1.racon-polished.span$(span).dist$(dist).tigmint.fa: $(p2)_golden_path_1.racon-polished.cut$(cut).tigmint.fa
ln -sf $< $@
Expand Down
8 changes: 4 additions & 4 deletions goldrush_path/opt.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "opt.hpp"

#include <cmath>
#include <iostream>

namespace opt {

size_t assigned_max = 5;
size_t unassigned_min = 5;
size_t tile_length = 1000;
size_t genome_size = 0;
size_t target_size = 0;
uint64_t genome_size = 0;
uint64_t target_size = 0;
size_t kmer_size = 0;
size_t weight = 0;
size_t min_length = 5000;
Expand Down Expand Up @@ -132,7 +132,7 @@ process_options(int argc, char** argv)
opt::tile_length = strtoul(optarg, &end, 10);
break;
case 'T':
opt::target_size = strtoul(optarg, &end, 10);
opt::target_size = (uint64_t)strtod(optarg, &end);
break;
case 'u': {
opt::unassigned_min = strtoul(optarg, &end, 10);
Expand Down
4 changes: 2 additions & 2 deletions goldrush_path/opt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ extern size_t assigned_max;
extern size_t unassigned_min;
extern size_t tile_length;
extern size_t block_size;
extern size_t genome_size;
extern size_t target_size;
extern uint64_t genome_size;
extern uint64_t target_size;
extern size_t kmer_size;
extern uint32_t phred_min;
extern uint32_t phred_delta;
Expand Down