-
Notifications
You must be signed in to change notification settings - Fork 7
/
new_gff_validator.pl
executable file
·64 lines (43 loc) · 1.38 KB
/
new_gff_validator.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
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/perl
use strict;
# a standalone gff validator since the old one seems incredibly out of date
# Usage: ./new_gff_validator.pl gff_file_path
my $root_dir;
BEGIN {
$root_dir = $0;
$root_dir =~ s/[^\/]*$//;
$root_dir = "./" unless $root_dir =~ /\//;
push @INC, $root_dir;
}
use Carp qw(croak carp);
use ModENCODE::ErrorHandler qw(log_error);
use ModENCODE::Config;
use ModENCODE::Cache;
use ModENCODE::Validator::Data;
use Getopt::Long;
ModENCODE::ErrorHandler::set_logtype(ModENCODE::ErrorHandler::LOGGING_PREFIX_ON);
ModENCODE::Config::set_cfg($root_dir . 'validator.ini');
ModENCODE::Cache::init();
# so what i want to do is make some datums with applied_protocol, direction, and dataum
if ( @ARGV == 0 ) {
print "Usage: ./new_gff_validator.pl <path_to_file>\n";
exit;
}
my $experiment = new ModENCODE::Chado::Experiment() ;
my $gff_file = $ARGV[0] ;
my $validator = new ModENCODE::Validator::Data::GFF3({ 'experiment' => $experiment});
log_error "Validating $gff_file as standalone", "notice", ">";
# make a fake datum
my $datum = new ModENCODE::Chado::Data({
'chadoxml_id' => 'Data_1',
'name' => 'my gff name',
'heading' => 'my gff heading',
'value' => $gff_file,
'anonymous' => 0
});
# create ap_datum from gff file
my $ap_datum = ["", "", $datum] ; # = TODO
$validator->add_datum_pair($ap_datum) ;
$validator->validate();
ModENCODE::Cache::destroy();
1;