BMERC : needle tools : Programs : Other utilities
These are useful utility programs that are not directly related to
molecular biology.
Usage:
Arguments:
diff-fields.pl first cuts the indicated fields out of each
file (opening temporary files in /tmp to hold the results), then passes
the resulting fields to the comparator program. If the comparator is
cmp, then any output is filtered in order to rename the temp
files back to their original names. If the comparator is diff
(the default), no attempt is made to reinsert eliminated fields in the
resulting output. In either case, diff-fields.pl uses the
return code from the comparator as its return value. This makes it
possible to use "diff-fields.pl -cmp -s" as a silent test for
whether certain fields are identical.
Known bugs:
Table of contents
diff-fields.pl
diff-fields.pl compares selected fields out of two files, one
of which may be the standard input, in either cmp or
diff style. It has proved useful for debugging, but serves no
other purpose in the needle tools suite.
diff-fields.pl [-cmp] [-bitwcefnhls] -fields1 file1 [ -fields2 ] file2
The argument list consists of zero or more -cmp or comparator
options (the -bitwcefnhls thing) in any order, followed by the
other three or four options in the specified order.
Each fields specification must start with "-f" or "-c"
and include a nonempty comma-separated list of one-based field indices
(as digit strings) or ranges of field indices (e.g. "2-5").
install.pl
install.pl is similar to the Berkeley UNIX install
utility that copies software into an executable directory; it has a few
enhancements, but is not fully compatible. The enhancements make it
easier to maintain perl scripts in
a site-independent manner.
Usage:
install.pl [file-or-option . . .] directory
where file-or-option is one of
-m mode | -verbose | -show | -quiet | -inc | file
Except for directory, options are processed from left to
right; an option will be respecified if it appears more than once. When
installing a given file, the options then in effect are
used.
Arguments:
install.pl also does the following additional things for perl scripts, which are recognized by the ".pl" or ".prl" suffix:
push(@INC, 'directory');
is inserted at the end of the perl invocation header, where
directory is the destination directory into which the
script is being installed. This makes installed perl scripts get
their libraries from the same place they were invoked (and saves
a lot of site customization headaches).
#!/usr/local/bin/perl
but different systems may require different pathnames, or different
invocation schemes entirely. In particular, many systems still use perl
version 4 by default, but needle tools requires perl 5, so
simply using "/usr/local/bin/perl" may invoke the wrong
version. In that case, one must change the first line to something like
the following:
#!/usr/local/bin/perl5
Thus the needle tools installation
procedure involves "bootstrapping" by hand-editing the distributed
version of install.pl to meet the local requirements for the
perl invocation header, and then using that to install the rest of the
software. It is similar to using a retrovirus for gene therapy.
Known bugs:
install.pl foo.pl /usr/local/bin/bar.pl
This is supported by many versions of install,
especially in BSD-derived systems. -- rgr, 19-Jan-00.
Usage:
source init-needle-tools
Because it is "sourced" and not invoked as an ordinary script, there are
no arguments, and it is also necessary to know the full pathname of the
file. At BMERC, this is ~thread/bin/scripts/init-needle-tools.