File: make_man.pl

package info (click to toggle)
codonw 1.4.4-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,288 kB
  • sloc: ansic: 14,637; makefile: 207; sh: 194; perl: 36
file content (41 lines) | stat: -rwxr-xr-x 1,695 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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]/codonw-$tool.1") or die "Could not open output file $!";
    $tmpl =~ s/%%TOOLNAME%%/codonw-$tool/g;
    $tmpl =~ s/%%CTOOLNAME%%/CODONW-$uctool/g;
    $tmpl =~ s/%%TOOLDESC%%/@{$tools{$tool}}[0]/g;
    $tmpl =~ s/%%TOOLOPT%%/@{$tools{$tool}}[1]/g;
    print $fh "$tmpl";
    close $fh;
}