ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/owl/tags/aglappe-0.9.3/createGraphDb.sh
Revision: 503
Committed: Tue Jan 8 19:51:39 2008 UTC (11 years, 10 months ago) by filippis
Original Path: trunk/createGraphDb.sh
File size: 3310 byte(s)
Log Message:
createGraphDb:
-scop_graph table added
-!!!!residue serial fields (num, i_num, j_num) are changed to unsigned

!!!!ProtStructGraph:
-interSSE variable added
-getResidueSerial abstract method added
-restrictContactsBetweenSs method added

!!!!AIGraph:
-getResidueSerial method added

RIGraph:
-!!!!getResidueSerial method added
-scop graphs are written to db correctly
-interSSE variable taken into account for CR db field

DbRIgraph:
-changes made so to be able to read from db using a scop id
-interSSE and minSeqSep are set now in get_db_graph_info()
-!!!!FIXED BUG:fullLength in read_graph_from_db is not set to the size of the serials2nodes TreeMap instead of the maximum serial in serials2nodes. It was giving wrong result for scop graphs.

testDbRIGraph added:
It reads one graph from a source db based either 
-on pdbcode, chaincode and graph properties or 
-on scop id and graph properties or 
-on a graph id 
and it writes the graph to a destination db.

Pdb:
-unused scop regions are now removed in restrictToScopDomain
-unused residues are also removed from resser2pdbresser, pdbresser2resser, resser2allrsa, resser2scrsa, resser2consurfhsspscore, resser2consurfhsspcolor, catalSiteSet
-!!!!sequence is reset to scop sequence and fullLength to the length of the scop sequence

CatalSiteSet:
- removeCatalSiteRes(int resser) method added

CatalyticSite:
-remRes(int resser) method added

Scop:
-remove(ScopRegion e) method added

genDbGraph:Comments only added to demonstrate new functionality.
-comment added to show how to use restrictContactsBetweenSs
-comment added to show how to use restrictToScopDomain
-runDssp now is always run and not only when mode != "GRAPH". This has been changed since now the contact range might depend on the ss assignment (restrictContactsBetweenSs) and we want to ensure consistent results
-runNaccess moved to the bottom so it is always run last. In this way if restrictToScopDomain is used, we don't have to run naccess twice.


Line File contents
1 #!/bin/sh
2 function usage {
3 echo
4 echo "Script to create/link/index a graph database. "
5 echo
6 echo "Usage: $1 -d <db_name> -m <mode>"
7 echo
8 echo "-d <db_name> the graph database name "
9 echo "-m <mode> create/index/unindex tables "
10 echo
11 }
12
13 #
14 #Set default value for variables
15 #
16 graphDb=""
17 mode=""
18 h="white"
19
20 while getopts d:m: opt
21 do
22 case "$opt" in
23 d) graphDb="$OPTARG";;
24 m) mode="$OPTARG";;
25 esac
26 done
27
28 if [ -z "$graphDb" ] || [ -z "$mode" ]
29 then
30 echo "Missing or more arguments"
31 usage $0
32 exit 1
33 fi
34
35 arch=`uname -m`
36 case "$arch" in
37 i686)
38 mysqldir=/project/tla/dist/mysql-i686
39 ;;
40 x86_64)
41 mysqldir=/project/tla/dist/mysql
42 ;;
43 *)
44 mysqldir=/project/tla/dist/mysql-i686
45 ;;
46 esac
47
48 mysqlbin=$mysqldir/bin/mysql
49 master=white
50 db=test
51
52 if [ "$mode" == "CREATE" ]
53 then
54 $mysqlbin -pnieve -h $h -B -N $db <<ENDSQL
55 SET sql_mode = "NO_UNSIGNED_SUBTRACTION,TRADITIONAL";
56 CREATE DATABASE IF NOT EXISTS ${graphDb}
57 DEFAULT CHARACTER SET latin1 DEFAULT COLLATE latin1_general_cs;
58 ENDSQL
59 $mysqlbin -pnieve -h $h -B -N $graphDb <<ENDSQL1
60 SET sql_mode = "NO_UNSIGNED_SUBTRACTION,TRADITIONAL";
61 CREATE TABLE chain_graph LIKE abstract.chain_graph;
62 CREATE TABLE scop_graph LIKE abstract.scop_graph;
63 CREATE TABLE single_model_graph LIKE abstract.single_model_graph;
64 CREATE TABLE single_model_node LIKE abstract.single_model_node;
65 CREATE TABLE single_model_edge LIKE abstract.single_model_edge;
66 CREATE TABLE pdb_residue_info LIKE abstract.pdb_residue_info;
67
68 ALTER TABLE chain_graph
69 MODIFY graph_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
70 MODIFY pchain_code VARCHAR(2) NOT NULL,
71 MODIFY scops INT,
72 MODIFY caths INT,
73 MODIFY entry_id INT,
74 MODIFY assembly_id INT,
75 MODIFY chain_id INT,
76 MODIFY model_id INT;
77
78 ALTER TABLE scop_graph
79 MODIFY graph_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
80 MODIFY pchain_code VARCHAR(2) NOT NULL,
81 MODIFY sunid INT UNSIGNED,
82 MODIFY sccs VARCHAR(10),
83 MODIFY domain_type ENUM('UNKNOWN', 'WHOLECHAIN', 'SINGLEFRAGMENT', 'MULTIFRAGMENT', 'MULTICHAIN'),
84 MODIFY num_chain INT,
85 MODIFY num_fragment INT,
86 MODIFY caths INT,
87 MODIFY num_chain_res INT,
88 MODIFY chain_scops INT,
89 MODIFY entry_id INT,
90 MODIFY assembly_id INT,
91 MODIFY chain_id VARCHAR(35),
92 MODIFY model_id INT;
93
94 ALTER TABLE single_model_graph
95 MODIFY graph_id INT UNSIGNED NOT NULL AUTO_INCREMENT;
96
97 ALTER TABLE single_model_node
98 MODIFY num INT NOT NULL,
99 MODIFY ssid VARCHAR(5),
100 MODIFY sheet_serial CHAR(1);
101
102 ALTER TABLE single_model_edge
103 MODIFY i_num INT NOT NULL,
104 MODIFY i_ssid VARCHAR(5),
105 MODIFY i_sheet_serial CHAR(1),
106 MODIFY j_num INT NOT NULL,
107 MODIFY j_ssid VARCHAR(5),
108 MODIFY j_sheet_serial CHAR(1);
109 ENDSQL1
110 fi
111
112 if [ "$mode" == "INDEX" ]
113 then
114 $mysqlbin -pnieve -h $h -B -N $graphDb <<ENDSQL
115 SET sql_mode = "NO_UNSIGNED_SUBTRACTION,TRADITIONAL";
116 CREATE INDEX NODE_GRAPH_IDX ON single_model_node (graph_id);
117 CREATE INDEX EDGE_GRAPH_IDX ON single_model_edge (graph_id);
118 CREATE INDEX CHAIN_IDX ON pdb_residue_info (pdb_code, chain_code, pdb_chain_code);
119 ENDSQL
120 fi
121
122 if [ "$mode" == "UNINDEX" ]
123 then
124 $mysqlbin -pnieve -h $h -B -N $graphDb <<ENDSQL
125 SET sql_mode = "NO_UNSIGNED_SUBTRACTION,TRADITIONAL";
126 DROP INDEX NODE_GRAPH_IDX ON single_model_node;
127 DROP INDEX EDGE_GRAPH_IDX ON single_model_edge;
128 ENDSQL
129 fi

Properties

Name Value
svn:executable *