-
Notifications
You must be signed in to change notification settings - Fork 0
/
chado2AE.pl
56 lines (40 loc) · 1.25 KB
/
chado2AE.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
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl
use strict;
#replace with your own validator dir
use lib '/home/zheng/validator';
use ModENCODE::Parser::Chado;
use AE::Reporter;
#my $experiment_id = $ARGV[0];
#my $report_dir = $ARGV[1];
my $experiment_id = '6';
my $report_dir = '/home/zheng/data';
#my $dbname = 'modencode_chado';
#my $host = 'heartbroken.lbl.gov';
#my $username = 'db_public';
#my $passwd = 'pw';
my $dbname = 'modencode';
my $host = 'localhost';
my $username = 'zheng';
my $passwd = 'pw';
my $reader = new ModENCODE::Parser::Chado({
'dbname' => $dbname,
'host' => $host,
'username' => $username,
'password' => $passwd,
});
if (!$experiment_id) {
#print out all experiment id
} else {
#check whether experiment id is valid
}
$reader->load_experiment($experiment_id);
my $experiment = $reader->get_experiment();
my $reporter = new AE::Reporter();
#make sure $report_dir ends with '/'
$report_dir .= '/' unless $report_dir =~ /\/$/;
my $idf = $report_dir . "experiment_". $experiment_id . '_idf.txt';
my $rel_sdrf = "experiment_". $experiment_id . '_sdrf.txt';
my $sdrf = $report_dir . "experiment_". $experiment_id . '_sdrf.txt';
#$reporter->write_idf($experiment, $idf, $rel_sdrf);
#$reporter->write_sdrf($experiment, $sdrf);
$reporter->write_sdrf($reader, $sdrf);