[Bio] / FortyEight / rp_quality_check.pl Repository:
ViewVC logotype

Diff of /FortyEight/rp_quality_check.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Thu Nov 30 04:59:59 2006 UTC revision 1.5, Tue Feb 27 21:00:27 2007 UTC
# Line 22  Line 22 
22  use FIG_Config;  use FIG_Config;
23  use strict;  use strict;
24  use File::Basename;  use File::Basename;
25    use Job48;
26    
27  @ARGV == 1 or die "Usage: $0 job-dir\n";  @ARGV == 1 or die "Usage: $0 job-dir\n";
28    
# Line 33  Line 34 
34  chomp $genome;  chomp $genome;
35  $genome =~ /^\d+\.\d+/ or die "$0: Cannnot find genome ID for jobdir $jobdir\n";  $genome =~ /^\d+\.\d+/ or die "$0: Cannnot find genome ID for jobdir $jobdir\n";
36    
37    my $jobid = basename($jobdir);
38    
39    my $job = new Job48($jobid);
40    
41  my $meta_file = "$jobdir/meta.xml";  my $meta_file = "$jobdir/meta.xml";
42  my $meta = new GenomeMeta($genome, $meta_file);  my $meta = new GenomeMeta($genome, $meta_file);
43    
# Line 48  Line 53 
53    
54  $rc == 0 or &fatal("system $cmd failed with rc=$rc");  $rc == 0 or &fatal("system $cmd failed with rc=$rc");
55    
56    #
57    # Based on the results of the quality check, set up for user intervention.
58    #
59    
60    my @corrections;
61    
62    if ($meta->get_metadata('qc.RNA_overlaps') and
63        $meta->get_metadata('qc.RNA_overlaps')->[1])
64    {
65        push(@corrections, 'remove_rna_overlaps');
66    }
67    # remove_embedded_pegs
68    if ($meta->get_metadata('qc.Embedded') and
69        $meta->get_metadata('qc.Embedded')->[1])
70    {
71        push(@corrections, 'remove_embedded_pegs)
72    }
73    
74    #
75    # If corrections are necessary, set up the status on the correction phase.
76    #
77    
78    if (@corrections)
79    {
80        $meta->set_metadata("status.correction", 'requires_intervention');
81        $meta->set_metadata("correction.possible", [@corrections]);
82    
83        #
84        # Construct & send email.
85        #
86    
87        my $subject = "48-hour server job needs attention";
88    
89        my $gname = $job->genome_name;
90        my $entry = $FIG_Config::fortyeight_home;
91        $entry = "http://www.nmpdr.org/anno-server/" if $entry eq '';
92        my $msg = <<END;
93    The annotation job that you submitted for $gname needs user input before it can proceed further.
94    You may query its status at $entry as job number $job_id
95    END
96        $job->send_email_to_owner("qc.email_notification_sent", $subject, $msg);
97    }
98    else
99    {
100        $meta->set_metadata("status.correction", "complete");
101    }
102    
103  $meta->set_metadata("status.qc", "complete");  $meta->set_metadata("status.qc", "complete");
104  $meta->set_metadata("qc.running", "no");  $meta->set_metadata("qc.running", "no");
105    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3