-
Notifications
You must be signed in to change notification settings - Fork 0
/
chado2tab.pl
executable file
·43 lines (38 loc) · 1.32 KB
/
chado2tab.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
#!/usr/bin/perl
use strict;
use ModENCODE::Parser::Chado;
use Data::Dumper;
use DBI;
use ModENCODE::Chado::AppliedProtocol;
use ModENCODE::Chado::Protocol;
use ModENCODE::Chado::Data;
use ModENCODE::Chado::DB;
use ModENCODE::Chado::DBXref;
use ModENCODE::Chado::CV;
use ModENCODE::Chado::CVTerm;
use ModENCODE::Chado::Attribute;
my $dbh; # = DBI->connect("dbi:Pg:dbname=mepipe;host=localhost", "db_public", "pw") or die "Couldn't connect to DB";
my $experiment_id = $ARGV[0];
my $reader = new ModENCODE::Parser::Chado({
'dbname' => 'mepipe' ,
'host' => 'localhost',
'username' => 'db_public',
'password' => 'pw',
});
if (!$experiment_id) {
print "Available experiments are:\n";
my @exp_strings = map { $_->{'experiment_id'} . "\t\"" . $_->{'uniquename'} . "\"" } @{$reader->get_available_experiments()};
print " ID\tName\n";
print " " . join("\n ", @exp_strings);
print "\n";
} else {
$reader->load_experiment($experiment_id);
#my $protocol_slots = $reader->get_normalized_protocol_slots();
#foreach my $applied_protocols (@$protocol_slots) {
#print join("\n", map { $_->to_string() } @$applied_protocols) . "\n";
#}
#print Dumper($reader->get_denormalized_protocol_slots());
#print Dumper($reader->get_tsv_columns());
print $reader->get_tsv();
#print $reader->get_experiment()->to_string();
}