Skip to content

Commit

Permalink
Program transform name
Browse files Browse the repository at this point in the history
* Proper installation with prefix/suffix to program names

* mummerplot fixes. Work with (almost) any terminal types. Not limited
to ps and png anymore. Use interactive terminal by default.
  • Loading branch information
gmarcais committed Nov 26, 2024
1 parent a16122b commit 61d2b1f
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 148 deletions.
54 changes: 46 additions & 8 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,52 @@ EXTRA_DIST += $(patsubst %,scripts/%.sh,$(shell_scripts))
CLEANFILES += $(libs_scripts) $(all_scripts)

# Rules to generate the scripts, in .libs and in build directory.
mummername = $(shell echo mummer | sed '$(transform)')
nucmername = $(shell echo nucmer | sed '$(transform)')
mgapsname = $(shell echo mgaps | sed '$(transform)')
prenucname = $(shell echo prenuc | sed '$(transform)')
postnucname = $(shell echo postnuc | sed '$(transform)')
preproname = $(shell echo prepro | sed '$(transform)')
postproname = $(shell echo postpro | sed '$(transform)')
showcoordsname = $(shell echo show-coords | sed '$(transform)')
showdiffname = $(shell echo show-diff | sed '$(transform)')
showsnpsname = $(shell echo show-snps | sed '$(transform)')
deltafiltername = $(shell echo delta-filter | sed '$(transform)')
repeatmatchname = $(shell echo repeat-match | sed '$(transform)')


script_inst_subst = sed -e 's,[@]PERL[@],$(PERL),g' \
-e 's,[@]BIN_DIR[@],$(bindir),g' \
-e 's,[@]LIB_DIR[@],$(script_libdir),g' \
-e 's,[@]LIBEXEC_DIR[@],$(pkglibexecdir),g'
-e 's,[@]BIN_DIR[@],$(bindir),g' \
-e 's,[@]LIB_DIR[@],$(script_libdir),g' \
-e 's,[@]LIBEXEC_DIR[@],$(pkglibexecdir),g' \
-e 's,[@]MUMMER[@],$(mummername),g' \
-e 's,[@]MGAPS[@],$(mgapsname),g' \
-e 's,[@]PRENUC[@],$(prenucname),g' \
-e 's,[@]POSTNUC[@],$(postnucname),g' \
-e 's,[@]PREPRO[@],$(preproname),g' \
-e 's,[@]POSTPRO[@],$(postproname),g' \
-e 's,[@]SHOWCOORDS[@],$(showcoordsname),g' \
-e 's,[@]SHOWDIFF[@],$(showdiffname),g' \
-e 's,[@]SHOWSNPS[@],$(showsnpsname),g' \
-e 's,[@]NUCMER[@],$(nucmername),g' \
-e 's,[@]DELTAFILTER[@],$(deltafiltername),g' \
-e 's,[@]REPEATMATCH[@],$(repeatmatchname),g'
script_local_subst = sed -e 's,[@]PERL[@],$(PERL),g' \
-e 's,[@]BIN_DIR[@],$(abs_builddir),g' \
-e 's,[@]LIB_DIR[@],$(abs_srcdir)/scripts,g' \
-e 's,[@]LIBEXEC_DIR[@],$(abs_builddir),g'
-e 's,[@]BIN_DIR[@],$(abs_builddir),g' \
-e 's,[@]LIB_DIR[@],$(abs_srcdir)/scripts,g' \
-e 's,[@]LIBEXEC_DIR[@],$(abs_builddir),g' \
-e 's,[@]MUMMER[@],mummer,g' \
-e 's,[@]MGAPS[@],mgaps,g' \
-e 's,[@]PRENUC[@],prenuc,g' \
-e 's,[@]POSTNUC[@],postnuc,g' \
-e 's,[@]PREPRO[@],prepro,g' \
-e 's,[@]POSTPRO[@],postpro,g' \
-e 's,[@]SHOWCOORDS[@],show-coords,g' \
-e 's,[@]SHOWDIFF[@],show-diff,g' \
-e 's,[@]SHOWSNPS[@],show-snps,g' \
-e 's,[@]NUCMER[@],nucmer,g' \
-e 's,[@]DELTAFILTER[@],delta-filter,g' \
-e 's,[@]REPEATMATCH[@],repeat-match,g'

.libs/%: scripts/%.pl
@mkdir -p $(dir $@) && $(script_inst_subst) < $< > $@
Expand All @@ -176,8 +214,8 @@ script_local_subst = sed -e 's,[@]PERL[@],$(PERL),g' \
$(AM_V_GEN)$(script_local_subst) < $< > $@ && chmod a+x $@

# Supporting modules
script_lib_SCRIPTS = scripts/Foundation.pm scripts/tandem-repeat.awk
EXTRA_DIST += $(script_lib_SCRIPTS)
script_lib_DATA = scripts/Foundation.pm scripts/tandem-repeat.awk
EXTRA_DIST += $(script_lib_DATA)

#######
# umd #
Expand Down
20 changes: 10 additions & 10 deletions scripts/dnadiff.pl
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@

my @DEPEND_INFO =
(
"$BIN_DIR/delta-filter",
"$BIN_DIR/show-diff",
"$BIN_DIR/show-snps",
"$BIN_DIR/show-coords",
"$BIN_DIR/nucmer",
"$BIN_DIR/@DELTAFILTER@",
"$BIN_DIR/@SHOWDIFF@",
"$BIN_DIR/@SHOWSNPS@",
"$BIN_DIR/@SHOWCOORDS@",
"$BIN_DIR/@NUCMER@",
"$SCRIPT_DIR/Foundation.pm"
);

my $DELTA_FILTER = "$BIN_DIR/delta-filter";
my $SHOW_DIFF = "$BIN_DIR/show-diff";
my $SHOW_SNPS = "$BIN_DIR/show-snps";
my $SHOW_COORDS = "$BIN_DIR/show-coords";
my $NUCMER = "$BIN_DIR/nucmer";
my $DELTA_FILTER = "$BIN_DIR/@DELTAFILTER@";
my $SHOW_DIFF = "$BIN_DIR/@SHOWDIFF@";
my $SHOW_SNPS = "$BIN_DIR/@SHOWSNPS@";
my $SHOW_COORDS = "$BIN_DIR/@SHOWCOORDS@";
my $NUCMER = "$BIN_DIR/@NUCMER@";

my $SNPBuff = 20; # required buffer around "good" snps
my $OPT_Prefix = "out"; # prefix for all output files
Expand Down
3 changes: 2 additions & 1 deletion scripts/exact-tandems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ matchlen=$2

bindir="@BIN_DIR@"
libdir="@LIB_DIR@"
repeatmatch="${bindir}/@REPEATMATCH@"

if [ -z "$filename" -o -z "$matchlen" ]; then
echo "USAGE: $0 <file> <min-match-len>"
Expand All @@ -17,7 +18,7 @@ fi
#echo "Finding matches and tandem repeats"
# Trick: pipe exit status of first command to exit at end of the pipeline
exec 4>&1; { \
{ $bindir/repeat-match -t -n $matchlen $filename; echo $? >&3; } | \
{ "$repeatmatch" -t -n $matchlen $filename; echo $? >&3; } | \
tail -n +3 | sort -k1n -k2n | awk -f $libdir/tandem-repeat.awk >&4; \
} 3>&1 | exit `cat`

Loading

0 comments on commit 61d2b1f

Please sign in to comment.