Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions bin/goldrush
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ polished_infix=$(polisher)-polished
# ntlink or minimap2
polisher_mapper=minimap2

# Shared memory location for GoldPolish
shared_mem=/dev/shm
# Shared memory location for GoldPolish. Left empty on systems without /dev/shm
# (e.g. macOS); polishing then runs in the working directory, as GoldPolish
# itself would.
Comment on lines +16 to +18

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Shared memory location for GoldPolish. Left empty on systems without /dev/shm
# (e.g. macOS); polishing then runs in the working directory, as GoldPolish
# itself would.
# Shared memory location for GoldPolish.

I might suggest leaving the comment as-is, since the default is already documented in the help page, and it can also be explicitly set by a user.

shared_mem=$(if $(wildcard /dev/shm),/dev/shm,)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
shared_mem=$(if $(wildcard /dev/shm),/dev/shm,)
shared_mem=$(if $(wildcard /dev/shm),/dev/shm,$(CURDIR))

If we handle the /dev/shm check and fallback to the current directory here, we could simplify the goldpolish command below by removing the additional logic.


# ntlink mapping parameter (used if polisher_mapper=ntlink)
polish_k=32
Expand Down Expand Up @@ -120,6 +122,9 @@ time=
else
ifneq ($(shell command -v gtime),)
time=command gtime -v -o $@.time
else ifeq ($(shell uname -s),Darwin)
# macOS time has no -v; -l reports the same run time and peak memory
time=command /usr/bin/time -l -o $@.time
else
time=command time -v -o $@.time
endif
Comment on lines +125 to 130

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else ifeq ($(shell uname -s),Darwin)
# macOS time has no -v; -l reports the same run time and peak memory
time=command /usr/bin/time -l -o $@.time
else
time=command time -v -o $@.time
endif
else ifeq ($(shell /usr/bin/time -v true >/dev/null 2>&1 && echo yes),yes)
time=command /usr/bin/time -v -o $@.time
else
time=command /usr/bin/time -l -o $@.time
endif

A suggestion for how it could be updated without making any explicit OS assumptions

Expand Down Expand Up @@ -191,7 +196,7 @@ help:
@echo " rounds number of rounds of ntLink [$(rounds)]"
@echo ""
@echo " GoldPolish options:"
@echo " shared_mem Shared memory path where polishing occurs [/dev/shm] "
@echo " shared_mem Shared memory path where polishing occurs [/dev/shm, or the working directory if /dev/shm does not exist] "
@echo ""
@echo "Notes:"
@echo " - GoldRush-Path generates silver paths before generating the golden path"
Expand Down Expand Up @@ -264,7 +269,7 @@ endif
echo "Done GoldRush-Path + $(polisher_logs)! $(polisher_logs) polished golden path can be found in: $@"

%.goldpolish-polished.fa: %.fa $(long_reads)
$(time) $(set_ulimit) goldpolish $(goldpolish_opts) -t$(t) -m$(shared_mem) $< $(long_reads) $@
$(time) $(set_ulimit) goldpolish $(goldpolish_opts) -t$(t) -m$(or $(shared_mem),$(CURDIR)) $< $(long_reads) $@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we change the default setting of shared_mem as suggested above, we could revert this change

echo "Done GoldRush-Path + $(polisher_logs)! $(polisher_logs) polished golden path can be found in: $@"

# Run racon
Expand Down