ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/pdbHighlight/ras_script
Revision: 1.3
Committed: Tue Apr 10 09:16:48 2007 UTC (9 years, 5 months ago) by dmb
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +3 -5 lines
Log Message:
Slug fix.

Don't forget to visit http://www.bioinformatics.org/pdbHighlight/

Line File contents
1 #!/usr/bin/perl -w
2
3 # Released under the terms of the BiO Licence.
4 # http://biolicense.org/
5
6 use strict;
7
8 my $RASMOL = '~/bin/rasmol';
9 my $SCOP_HIGHLIGHT = '~/bin/scopHighlight_using_flat_file.plx';
10 my $CAT = '/bin/zcat';
11 my $TMP_DIR = '/tmp';
12
13 my $PDB_DIR = '/project/StruPPi/BiO/DBd/PDB/data/structures/all/pdb';
14 my $PDB_PREFIX = 'pdb';
15 my $PDB_SUFFIX = '.ent.Z';
16
17 my $PDB = $ARGV[0] || exit( &usage );
18
19 $PDB = lc( $PDB );
20
21 my $PDB_FILE
22 = $PDB_DIR. '/'. $PDB_PREFIX. $PDB. $PDB_SUFFIX;
23
24 die "$PDB_FILE:$!\n"
25 unless -s $PDB_FILE;
26
27 my $TEMP_FILE
28 = $TMP_DIR. '/'. $PDB. '.ras.tmp';
29
30 &run( "touch $TEMP_FILE" );
31
32 die "$TEMP_FILE:$!\n"
33 unless -w $TEMP_FILE;
34
35 # Ready? Lets go...
36
37 &run( "$SCOP_HIGHLIGHT -pdb $PDB > $TEMP_FILE" );
38
39 &run( "$CAT $PDB_FILE >> $TEMP_FILE" );
40
41 exec( "$RASMOL -script $TEMP_FILE" )
42 and die "$RASMOL failed:$?\n";
43
44 &run( "rm $TEMP_FILE" );
45
46 # All done.
47
48 print "OK\n";
49
50 sub run {
51 my $cmd = shift;
52 print "$cmd\n";
53 system("$cmd")
54 and die "\nFAILED ($?) :\n$cmd\n\n";
55 }