-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_homepage.pl
executable file
·89 lines (71 loc) · 2.57 KB
/
make_homepage.pl
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#! /usr/bin/perl
# Usage:
# ./make_homepage.pl F22B7 > foo.html
# [view it to see if you like it; if so:]
# mv foo.html index.html
# short text to show: url to link to (or 0)
@embed_me = (
"sean eddy's home page.", 0,
"contact info.", "contact.html",
"blog.", "http://cryptogenomicon.org",
"lab home page.", "http://eddylab.org/",
"reprints & lab publications.", "http://eddylab.org/publications.html",
"github.", "http://github.org/EddyRivasLab/",
"hmmer.", "http://hmmer.org/",
"pfam.", "http://pfam.xfam.org/",
"infernal.", "http://eddylab.org/software/infernal/",
"rfam.", "http://rfam.xfam.org/",
"mcb112 biological data analysis.", "http://mcb112.org",
"biological sequence analysis.", "http://eddylab.org/cupbook.html",
"cv.", "eddy_cv.pdf",
"google scholar.", "https://scholar.google.com/citations?user=rFf-AooAAAAJ&hl=en",
);
print <<EOF;
<html> <head>
<title>Sean's home page</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="ROBOTS" CONTENT="NOFOLLOW">
</head>
<!-- the look is ripped off from jwz. (www.jwz.org) --!>
<!-- The DNA sequence is real. --!>
<link rel="stylesheet" href="dnamatrix.css" type="text/css">
<body>
<pre>
EOF
$totlines = 300;
$nlines = 1;
while (<>) {
if (/^\s*(\d+):\s+(\S+)\s+(\d+)/) {
$left_coord = $1;
$sequence_line = $2;
$right_coord = $3;
} else { next; }
if ($nlines % 2 == 0 && $#embed_me > 0) {
# Embed links.
#
$link = shift(@embed_me);
$url = shift(@embed_me);
$textlen = length($link);
if ($url) { $embedtext = "<b><a href=\"$url\">$link</a></b>"; }
else { $embedtext = "<b><font color=\"#00ff00\">$link</font></b>"; }
$which_base = int(rand $nres-$textlen);
substr $sequence_line, $which_base, $textlen, $embedtext;
} else {
# Sow confusion.
#
$nres = length($sequence_line);
@bases = split(//, $sequence_line);
$which_base = int(rand $nres);
$bases[$which_base] = "<b>$bases[$which_base]</b>";
$which_base = int(rand $nres);
$bases[$which_base] = "<b><font color=\"#00ff00\">$bases[$which_base]</font></b>";
$sequence_line = join '', @bases;
}
printf("%5d %s %-5d\n", $left_coord, $sequence_line, $right_coord);
$nlines++;
if ($nlines >= $totlines) { last; }
}
print <<EOF;
</pre>
</body> </html>
EOF