[med-svn] [codonw] 01/05: make different man pages for linked tools

Sascha Steinbiss sascha-guest at moszumanska.debian.org
Sat Nov 21 23:39:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

sascha-guest pushed a commit to branch master
in repository codonw.

commit 1b9bdd621ab0b5d0fd6ee4c5f3b68ca2504b0da5
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Sat Nov 21 19:33:10 2015 +0000

    make different man pages for linked tools
---
 debian/make_man.pl  | 41 +++++++++++++++++++++++++++++++++++++++++
 debian/rules        |  2 +-
 debian/template.man | 22 ++++++++++++++++++++++
 3 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/debian/make_man.pl b/debian/make_man.pl
new file mode 100755
index 0000000..fc7da21
--- /dev/null
+++ b/debian/make_man.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -w
+
+die "Usage: $0 TEMPLATE OUTDIR\n" if @ARGV < 2;
+
+my %tools = (
+	rscu => ['calculate Relative Synonymous Codon Usage (RSCU)','rscu'],
+	cu => ['calculate codon usage','cu'],
+	aau => ['calculate Amino Acid Usage (AAU)','aau'],
+	fop => ['calculate Frequency of OPtimal codons index (FOP)','fop'],
+	raau => ['calculate Relative Amino Acid Usage (RAAU)','raau'],
+	tidy => ['clean up sequence in FASTA format','tidy'],
+	reader => ['output sequence in reader format','reader'],
+	cutab => ['tabulation of codon usage','cutab'],
+	cutot => ['tabulation of datasets codon usage','cutot'],
+	transl => ['conceptual translation of DNA to amino acid','transl'],
+	bases => ['detailed report of base composition','base','base'],
+	base3s => ['silent base G+C+A+T calculating program','sil_base'],
+	dinuc => ['dinucleotide usage of the three codon positions','dinuc'],
+	cai => ['calculate Codon Adaptation Index (CAI)','cai'],
+	gc3s => ['GC of synonymous codons 3rd positions','gc3s'],
+	gc => ['G+C content of gene (all 3 codon positions)','gc'],
+	cbi => ['calculate Codon Bias Index (CBI)','cbi'],
+	enc => ['calculate Effective Number of Codons (ENc)','enc']
+);
+
+open FILE, $ARGV[0] or die "Could not open file: $!";
+$string = join("", <FILE>);
+close FILE;
+
+foreach my $tool (keys %tools) {
+	my $tmpl = $string;
+	my $uctool = uc $tool;
+    print @{$tools{$tool}}[0] . "\n";
+    open(my $fh, '>', "$ARGV[1]/$tool.1") or die "Could not open output file $!";
+    $tmpl =~ s/%%TOOLNAME%%/$tool/g;
+    $tmpl =~ s/%%CTOOLNAME%%/$uctool/g;
+    $tmpl =~ s/%%TOOLDESC%%/@{$tools{$tool}}[0]/g;
+    $tmpl =~ s/%%TOOLOPT%%/@{$tools{$tool}}[1]/g;
+    print $fh "$tmpl";
+    close $fh;
+}
\ No newline at end of file
diff --git a/debian/rules b/debian/rules
index 9515639..e57e5e3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,7 +18,7 @@ override_dh_auto_build:
 override_dh_installman:
 	mkdir -p $(CURDIR)/debian/man
 	help2man -n 'Correspondence Analysis of Codon Usage' -N --help-option=-h  --version-string=1.4.4 ./codonw > $(CURDIR)/debian/man/codonw.1
-	for i in rscu cu aau fop raau tidy reader cutab cutot transl bases base3s dinuc cai for gc3s gc cbi enc; do ln -s $(CURDIR)/debian/man/codonw.1 $(CURDIR)/debian/man/$$i.1; done
+	$(CURDIR)/debian/make_man.pl $(CURDIR)/debian/template.man $(CURDIR)/debian/man
 	dh_installman --
 
 override_dh_auto_install:
diff --git a/debian/template.man b/debian/template.man
new file mode 100644
index 0000000..a4cda96
--- /dev/null
+++ b/debian/template.man
@@ -0,0 +1,22 @@
+.TH %%CTOOLNAME%% 1 "" CODONW "User Manuals"
+.SH NAME
+%%TOOLNAME%% \- %%TOOLDESC%%
+.SH SYNOPSIS
+.B %%TOOLNAME%%
+.I inputfile
+.I outputfile
+.I bulkoutputfile
+<options>
+.SH DESCRIPTION
+.B %%TOOLNAME%%
+is a shortcut to accessing the
+.BR codonw (1)
+executable, with the '%%TOOLDESC%%' option (-%%TOOLOPT%%) preselected, i.e.
+.TP
+codonw -%%TOOLOPT%% ...
+.PP
+The command line arguments follow the order of arguments in
+.BR codonw
+itself.
+.SH "SEE ALSO"
+.BR codonw (1)
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/codonw.git



More information about the debian-med-commit mailing list