2 # See the NOTICE file distributed with this work for additional information
3 # regarding copyright ownership.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
27 my ($host, $port, $dbname, $user,$pass);
28 my ($dnahost, $dnaport, $dnadbname, $dnauser, $dnapass);
29 my ($ccds_host, $ccds_dbname, $ccds_user, $ccds_port, $ccds_pass);
34 GetOptions(
'dbhost:s' => \$host,
36 'dbname:s' => \$dbname,
39 'dnahost:s' => \$dnahost,
40 'dnadbname:s' => \$dnadbname,
41 'dnauser:s' => \$dnauser,
42 'dnapass:s' => \$dnapass,
43 'dnaport:s' => \$dnaport,
44 'ccdshost:s' => \$ccds_host,
45 'ccdsdbname:s' => \$ccds_dbname,
46 'ccdsuser:s' => \$ccds_user,
47 'ccdsport:s' => \$ccds_port,
48 'ccdspass:s' => \$ccds_pass,
49 'transcript:s' => \$transcript,
60 -species =>
'default',
64 if(!$dnauser || !$dnahost) {
65 throw (
"You must provide user, host and dbname details to connect to DNA DB!");
70 -dbname => $dnadbname,
72 -species =>
'dna_'.$dba->species()
80 if (!$ccds_user || !$ccds_host) {
81 throw (
"You must provide user, host and dbname details to connect to CCDS DB!");
88 -dbname => $ccds_dbname,
89 -species =>
'ccds_'.$dba->species() );
97 printf
'Using "%s" as our Gene stable ID'.
"\n", $gene;
98 $gene_object = $dba->get_GeneAdaptor()->fetch_by_stable_id($gene);
101 printf
'Using "%s" as a Transcript to find a Gene'.
"\n", $transcript;
102 my $t = $dba->get_TranscriptAdaptor()->fetch_by_stable_id($transcript);
103 $gene_object = $t->get_Gene();
104 printf
'Using "%s" as our Gene'.
"\n", $gene_object->stable_id();
108 print
"Original: ".$gene_object->canonical_transcript->
stable_id.
"\n";
112 Example usage: perl emit_canonical_encodings.pl -dbhost host -dbuser user
113 -dbpass *** -dbname dbname -dbport 3306 -transcript ENST00019112
115 Example usage: perl emit_canonical_encodings.pl -dbhost host -dbuser user
116 -dbpass *** -dbname dbname -dbport 3306 -gene ENSG00019111
120 -dbname Database name
122 -dbhost Database host
124 -dbport Database port
126 -dbuser Database user
128 -dbpass Database password
130 Optional DB connection arguments:
132 -dnadbname DNA Database name
134 -dnadbhost DNA Database host
136 -dnadbuser DNA Database user
138 -dnadbport DNA Database port
140 -dnadbpass DNA Database pass
142 -ccdsdbname CCDS database name
144 -ccdshost CCDS database host
146 -ccdsuser CCDS database user
148 -ccdspass CCDS database pass
150 -ccdsport CCDS database port
154 -transcript The transcript stable ID to use to find the gene in question
156 -gene The gene stable ID to emit encoded transcripts for
158 A warning about not using CCDS is perfectly acceptible when not running on
159 Human, Mouse and Zebrafish.