From 7d2b67d5d119383897cd612c5ca77a99d3e0c3a2 Mon Sep 17 00:00:00 2001 From: Glenn Hickey Date: Sat, 4 Jan 2025 19:56:36 -0500 Subject: [PATCH 1/3] update gfaffix to v0.2.0 --- build-tools/downloadPangenomeTools | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-tools/downloadPangenomeTools b/build-tools/downloadPangenomeTools index 6a77a55b3..7e3fbe1cf 100755 --- a/build-tools/downloadPangenomeTools +++ b/build-tools/downloadPangenomeTools @@ -309,12 +309,12 @@ fi # gfaffix cd ${pangenomeBuildDir} -wget -q https://github.com/marschall-lab/GFAffix/releases/download/0.1.5b/GFAffix-0.1.5b_linux_x86_64.tar.gz -tar xzf GFAffix-0.1.5b_linux_x86_64.tar.gz -chmod +x GFAffix-0.1.5b_linux_x86_64/gfaffix -if [[ $STATIC_CHECK -ne 1 || $(ldd GFAffix-0.1.5b_linux_x86_64/gfaffix | grep so | wc -l) -eq 0 ]] +wget -q https://github.com/marschall-lab/GFAffix/releases/download/0.2.0/GFAffix-0.2.0_linux_x86_64.tar.gz +tar xzf GFAffix-0.2.0_linux_x86_64.tar.gz +chmod +x GFAffix-0.2.0_linux_x86_64/gfaffix +if [[ $STATIC_CHECK -ne 1 || $(ldd GFAffix-0.2.0_linux_x86_64/gfaffix | grep so | wc -l) -eq 0 ]] then - mv GFAffix-0.1.5b_linux_x86_64/gfaffix ${binDir} + mv GFAffix-0.2.0_linux_x86_64/gfaffix ${binDir} else exit 1 fi From fa7be262f670425e01d891e786e196f42e394471 Mon Sep 17 00:00:00 2001 From: Glenn Hickey Date: Sat, 4 Jan 2025 20:04:52 -0500 Subject: [PATCH 2/3] set gfaffix cores --- src/cactus/refmap/cactus_graphmap_join.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cactus/refmap/cactus_graphmap_join.py b/src/cactus/refmap/cactus_graphmap_join.py index 47db8fcb4..0e1868abc 100644 --- a/src/cactus/refmap/cactus_graphmap_join.py +++ b/src/cactus/refmap/cactus_graphmap_join.py @@ -687,7 +687,7 @@ def clip_vg(job, options, config, vg_path, vg_id, phase): gfa_out_path = normalized_path + '.gfa' # GFAffix's --dont_collapse option doesn't work on W-lines, so we strip them for now with -W cactus_call(parameters=['vg', 'convert', '-W', '-f', vg_path], outfile=gfa_in_path, job_memory=job.memory) - fix_cmd = ['gfaffix', gfa_in_path, '--output_refined', gfa_out_path, '--check_transformation'] + fix_cmd = ['gfaffix', gfa_in_path, '--output_refined', gfa_out_path, '--check_transformation', '--threads', str(job.cores)] if options.reference: fix_cmd += ['--dont_collapse', options.reference[0] + '#[.]*'] cactus_call(parameters=fix_cmd, job_memory=job.memory) From 55efa9de05adc13d3b3daaeb38ce630cbe6e4e91 Mon Sep 17 00:00:00 2001 From: Dany Doerr Date: Mon, 6 Jan 2025 16:33:48 +0100 Subject: [PATCH 3/3] no longer use -W option when converting graphs for GFAffix since it supports reference-W-lines since version 0.2.0; the version also fixes the header issue, which is also now removed from the code --- src/cactus/refmap/cactus_graphmap_join.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cactus/refmap/cactus_graphmap_join.py b/src/cactus/refmap/cactus_graphmap_join.py index 47db8fcb4..703a21020 100644 --- a/src/cactus/refmap/cactus_graphmap_join.py +++ b/src/cactus/refmap/cactus_graphmap_join.py @@ -685,20 +685,17 @@ def clip_vg(job, options, config, vg_path, vg_id, phase): normalized_path = vg_path + '.gfaffixed' gfa_in_path = vg_path + '.gfa' gfa_out_path = normalized_path + '.gfa' - # GFAffix's --dont_collapse option doesn't work on W-lines, so we strip them for now with -W - cactus_call(parameters=['vg', 'convert', '-W', '-f', vg_path], outfile=gfa_in_path, job_memory=job.memory) + # GFAffix supports W-lines as reference paths since v0.2.0 + cactus_call(parameters=['vg', 'convert', '-f', vg_path], outfile=gfa_in_path, job_memory=job.memory) fix_cmd = ['gfaffix', gfa_in_path, '--output_refined', gfa_out_path, '--check_transformation'] if options.reference: fix_cmd += ['--dont_collapse', options.reference[0] + '#[.]*'] cactus_call(parameters=fix_cmd, job_memory=job.memory) - # GFAffix strips the header, until this is fixed we need to add it back (for the RS tag) - gfa_header = cactus_call(parameters=['head', '-1', gfa_in_path], check_output=True).strip() - cactus_call(parameters=['sed', '-i', gfa_out_path, '-e', '1s/.*/{}/'.format(gfa_header)]) # Come back from gfa to vg conv_cmd = [['vg', 'convert', '-g', '-p', gfa_out_path]] # GFAFfix doesn't unchop, so we do that in vg after conv_cmd.append(['vg', 'mod', '-u', '-']) - cactus_call(parameters=conv_cmd, outfile=normalized_path) + cactus_call(parameters=conv_cmd, outfile=normalized_path) vg_path = normalized_path # run clip-vg no matter what, but we don't actually remove anything in full