#!/usr/bin/perl use CGI qw(:standard); use CGI::Pretty; # variables $path = "/mnt/project/nmpdb/public_html/nmpdb/"; $path_cgi = "http://rostlab.org/services/nmpdb/nmp_db/entry_norm?nmp_id="; $pubmed_base = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Abstract&list_uids="; $swissprot_seq_base = "http://us.expasy.org/cgi-bin/niceprot.pl?"; $swissprot_oc_base = "http://us.expasy.org/cgi-bin/get-entries?OC="; $pdb_base = "http://www.rcsb.org/pdb/cgi/explore.cgi?pdbId="; # New CGI Object $query = new CGI; foreach my $name ($query->param()) { $submit{$name} = $query->param($name); } # $file = ($submit{'nmp_id'} =~ /HOM/ ? "nmp_db_hom_rel_1_0.txt" : "nmp_db_rel_1_2.txt"); $file = ($submit{'nmp_id'} =~ /HOM/ ? "nmp_db_hom_rel_2_0.txt" : "nmp_db_rel_2_6.txt"); open(F, "<$path" . $file) or die "could not open $file\n"; loop1: while () { if ((/^ID $submit{'nmp_id'}/i) || ($_ !~ /^\/\// && @show)) { push(@show, $_); } elsif (/^\/\// && @show) { push(@show, $_); last loop1; } } close(F); map(($_ =~ /^P[12]/ ? $_ =~ s/(\d{2,})/"" . $1 . "<\/a>"/eg : ""), @show); map(($_ =~ /^SP/ ? $_ =~ s/(\w{3,})/"" . $1 . "<\/a>"/eg : ""), @show); map(($_ =~ /^PD/ ? $_ =~ s/(\w{4})(_\w)?/"" . $1 . $2 . "<\/a>"/eg : ""), @show); map(($_ =~ /^HL/ ? $_ =~ s/(\w{3,})/"" . $1 . "<\/a>"/eg : ""), @show); map(($_ =~ /^OS/ ? $_ =~ s/\(([^\)]+)\)/"(" . $1 . "<\/a>)"/eg : ""), @show); map(($_ =~ /^NA/ ? $_ =~ s/ (.+)/" " . $1 . "<\/font>"/eg : ""), @show); map(($_ =~ /^GN/ ? $_ =~ s/ (.+)/" " . $1 . "<\/font>"/eg : ""), @show); # print HTML header print <<"(END HTML)"; Content-type: text/html NMP-db - Entry: $submit{'nmp_id'}
(END HTML)


foreach my $line (@show) {
	print $line;
}

print "
";