Skip to content

Commit 0cd13ce

Browse files
000specificclaude
andcommitted
trees_gene_groups/gene_groups-COPYME STEP_3: fix newick-existence false-skip
gene_groups-COPYME's STEP_3 orchestrator was using ls "${NEWICK_DIR}"/*.fasttree "${NEWICK_DIR}"/*.treefile \ "${NEWICK_DIR}"/*.veryfasttree "${NEWICK_DIR}"/*.phylobayes.nwk to test "did STEP_2 produce ANY tree file for this gene group?" — but `ls` returns exit-2 whenever ANY of the four patterns misses, so a gene group that legitimately produced only one tree type (e.g. fasttree-only runs from STEP_2 profile=standard) was silently skipped as "no STEP_2 newicks". Manifested today as: STEP_3 RUN_1 in gene_groups-hugo_hgnc reported "Setup: 0 new, 2060 skipped (no STEP_2 newicks)" even though gene_group- synaptotagmins/ contained a valid .fasttree file at the resolved STEP2_RUN_DIR path. The check is now: shopt -s nullglob NEWICK_FILES=( "${NEWICK_DIR}"/*.fasttree ... ) shopt -u nullglob (( ${#NEWICK_FILES[@]} == 0 )) && skip nullglob makes absent patterns expand to nothing; the array union answers "did anything match across the four extensions". Matches the working version already in gene_groups_hgnc-COPYME/STEP_3-*/RUN-workflow.sh. Verified end-to-end by re-running STEP_3 RUN_1 (3 trees) + RUN_2 (1 tree, 2682 tips) in gene_groups-hugo_hgnc — all 4 trees rendered to PDF + SVG. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 00dc9c7 commit 0cd13ce

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

  • gigantic_project-COPYME/subprojects/trees_gene_groups/gene_groups-COPYME/STEP_3-tree_visualization/workflow-COPYME-tree_visualization

gigantic_project-COPYME/subprojects/trees_gene_groups/gene_groups-COPYME/STEP_3-tree_visualization/workflow-COPYME-tree_visualization/RUN-workflow.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,27 @@ while IFS=$'\t' read -r gene_group_id gene_group_name sanitized_name rgs_filenam
233233
fi
234234
fi
235235

236-
# STEP_2 must have produced at least one newick for this gene group
236+
# STEP_2 must have produced at least one newick for this gene group.
237+
# Uses shopt -s nullglob + array union so that an ABSENT extension produces
238+
# no glob entry (rather than the literal pattern string), and `((${#arr[@]}))`
239+
# tests the union for "did anything match". Prior `ls ... &>/dev/null` form
240+
# returned exit-2 whenever ANY of the 4 patterns missed — false-skipping
241+
# gene groups that legitimately produced just one tree type (e.g.,
242+
# fasttree-only runs from STEP_2's profile=standard).
237243
NEWICK_DIR="${STEP2_RUN_DIR}/gene_group-${sanitized_name}"
238-
if [ ! -d "${NEWICK_DIR}" ] || ! ls "${NEWICK_DIR}"/*.fasttree "${NEWICK_DIR}"/*.treefile "${NEWICK_DIR}"/*.veryfasttree "${NEWICK_DIR}"/*.phylobayes.nwk &>/dev/null; then
244+
if [ ! -d "${NEWICK_DIR}" ]; then
245+
no_trees_count=$((no_trees_count + 1))
246+
continue
247+
fi
248+
shopt -s nullglob
249+
NEWICK_FILES=(
250+
"${NEWICK_DIR}"/*.fasttree
251+
"${NEWICK_DIR}"/*.treefile
252+
"${NEWICK_DIR}"/*.veryfasttree
253+
"${NEWICK_DIR}"/*.phylobayes.nwk
254+
)
255+
shopt -u nullglob
256+
if (( ${#NEWICK_FILES[@]} == 0 )); then
239257
no_trees_count=$((no_trees_count + 1))
240258
continue
241259
fi

0 commit comments

Comments
 (0)