Skip to content

Commit 40f87a3

Browse files
authored
Change single character keys in snakemake parameter configs to multi-character (#27)
* Unpin python in azure-pipelines.yml * Change single character keys in snakemake config to multi-character * Fix -l parameter for snakemake * Temporarily build ntEdit from source * Activate conda env in ntEdit source build * ntEdit source build for macOS CI added * Adjust PATH for mac ntEdit source build
1 parent 0368627 commit 40f87a3

3 files changed

Lines changed: 37 additions & 15 deletions

File tree

azure-pipelines.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@ jobs:
1818
displayName: Create Anaconda environment
1919
- script: |
2020
source activate ntroot_CI
21-
conda install --yes --name ntroot_CI -c conda-forge -c bioconda python=3.9 mamba
21+
conda install --yes --name ntroot_CI -c conda-forge -c bioconda python mamba
2222
mamba install --yes -c conda-forge -c bioconda meson ninja snakemake perl 'ntedit>=2.0.1' samtools bedtools
23+
mamba install --yes -c conda-forge -c bioconda libcxx llvm meson ninja btllib zlib boost cmake compilers
2324
displayName: Install Conda packages
25+
26+
- script: |
27+
source activate ntroot_CI
28+
git clone https://github.com/bcgsc/ntEdit.git
29+
cd ntEdit
30+
meson setup build --prefix=$(pwd)/ntedit_build
31+
cd build && ninja install
32+
displayName: Build ntEdit (until 2.0.3 updated in conda)
2433
2534
- script: |
2635
source activate ntroot_CI
36+
export PATH=$(pwd)/ntEdit/ntedit_build/bin:$PATH
2737
export PATH=$(pwd):$PATH
2838
which ntroot
39+
which ntedit
2940
cd demo
3041
./run_ntroot_demo.sh
3142
displayName: Run ntRoot test
@@ -47,14 +58,25 @@ jobs:
4758
displayName: Create Anaconda environment
4859
- script: |
4960
source activate ntroot_CI
50-
conda install --yes --name ntroot_CI -c conda-forge -c bioconda python=3.9 mamba
61+
conda install --yes --name ntroot_CI -c conda-forge -c bioconda python mamba
5162
mamba install --yes -c conda-forge -c bioconda snakemake perl 'ntedit>=2.0.1' samtools bedtools
63+
mamba install --yes -c conda-forge -c bioconda libcxx llvm meson ninja btllib zlib boost cmake compilers
5264
displayName: Install Conda packages
65+
66+
- script: |
67+
source activate ntroot_CI
68+
git clone https://github.com/bcgsc/ntEdit.git
69+
cd ntEdit
70+
meson setup build --prefix=$(pwd)/ntedit_build
71+
cd build && ninja install
72+
displayName: Build ntEdit (until 2.0.3 updated in conda)
5373
5474
- script: |
5575
source activate ntroot_CI
76+
export PATH=$(pwd)/ntEdit/ntedit_build/bin:$PATH
5677
export PATH=$(pwd):$PATH
5778
which ntroot
79+
which ntedit
5880
cd demo
5981
./run_ntroot_demo.sh
6082
displayName: Run ntRoot test

ntroot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def main():
111111
smk_rule = "ntroot_input_vcf"
112112

113113
command = f"snakemake -s {base_dir}/ntroot_run_pipeline.smk {smk_rule} --nolock -p --cores {args.t} " \
114-
f"--config reference={args.reference} t={args.t} " \
114+
f"--config reference={args.reference} threads={args.t} " \
115115
f"tile_size={args.tile} "
116116

117117
if args.genome:
@@ -135,21 +135,21 @@ def main():
135135
f"\t-z {args.z}",
136136
f"\t-j {args.j}",
137137
f"\t-Y {args.Y}"])
138-
command += f" k={args.k} z={args.z} j={args.j} Y={args.Y}"
138+
command += f" kmer={args.k} z_param={args.z} j_param={args.j} Y_param={args.Y}"
139139

140140
if args.lai:
141141
intro_string.append("\t--lai")
142142

143143
if args.verbose:
144144
intro_string.append("\t-v")
145-
command += " v=1"
145+
command += " verbose=1"
146146
else:
147-
command += " v=0"
147+
command += " verbose=0"
148148

149149
if not os.path.isfile(args.l):
150150
raise FileNotFoundError(f"VCF file {args.l} not found")
151151
intro_string.append(f"\t-l {args.l}")
152-
command += f" l={args.l}"
152+
command += f" l_vcf={args.l}"
153153

154154
print("\n".join(intro_string), flush=True)
155155

ntroot_run_pipeline.smk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ onsuccess:
1111
reference=config["reference"]
1212
draft_base = os.path.basename(os.path.realpath(reference))
1313
reads_prefix=config["reads"] if "reads" in config else ""
14-
k=config["k"] if "k" in config else None
14+
k=config["kmer"] if "kmer" in config else None
1515

1616
genomes = config["genomes"] if "genomes" in config else ""
1717
genome_prefix = ".".join([os.path.basename(os.path.realpath(genome)).removesuffix(".fa").removesuffix(".fasta").removesuffix(".fna") for genome in genomes])
1818

1919
# Common parameters
20-
t = config["t"] if "t" in config else 4
21-
b = config["b"] + "_" if "b" in config and config["b"] != "" else ""
20+
t = config["threads"] if "threads" in config else 4
21+
b = config["b_prefix"] + "_" if "b_prefix" in config and config["b_prefix"] != "" else ""
2222

2323

2424
# ntEdit parameters
25-
z = config["z"] if "z" in config else 100
26-
v = config["v"] if "v" in config else 0
27-
j = config["j"] if "j" in config else 3
28-
Y = config["Y"] if "Y" in config else 0.55
29-
l = config["l"] if "l" in config else ""
25+
z = config["z_param"] if "z_param" in config else 100
26+
v = config["verbose"] if "verbose" in config else 0
27+
j = config["j_param"] if "j_param" in config else 3
28+
Y = config["Y_param"] if "Y_param" in config else 0.55
29+
l = config["l_vcf"] if "l_vcf" in config else ""
3030

3131
# Ancestry inference parameters
3232
tile_size = config["tile_size"] if "tile_size" in config else 5000000

0 commit comments

Comments
 (0)