Commit 5a97e4b1 authored by Aaron Petkau's avatar Aaron Petkau

Date format

parent 3bdf6af6
Pipeline #7693 failed with stages
in 3 seconds
......@@ -113,10 +113,15 @@ my $report_worksheet = $report_workbook->add_worksheet();
my $header_format = $report_workbook->add_format();
$header_format->set_bold();
my $date_format = $report_workbook->add_format(num_format => 'mmm d yyyy');
$report_worksheet->write_row(0,0,['Project Name','Sample Name','Sample Created Date','Mean Coverage','Total Bases','Reference Size','Project ID','Sample ID','File Pair ID','File Pair Created Date','File Pair'],$header_format);
$report_worksheet->set_column('A:A',30);
$report_worksheet->set_column('B:H',15);
$report_worksheet->set_column('I:I',60);
$report_worksheet->set_column('B:B',15);
$report_worksheet->set_column('C:C',20);
$report_worksheet->set_column('D:I',15);
$report_worksheet->set_column('J:J',20);
$report_worksheet->set_column('K:K',60);
try {
my $row = 1;
......@@ -144,6 +149,7 @@ try {
print STDERR "Skipping unpaired sequence file [id=$unpaired->{'identifier'}, label=$unpaired->{'label'}] in sample [id=$sample->{'identifier'}, name=$sample->{'sampleName'}], project [id=$project_id]\n";
}
foreach my $sequence_file_pair (@$pairs) {
my ($forward_link) = grep { $_->{'rel'} eq 'pair/forward' } @{$sequence_file_pair->{'links'}};
my ($reverse_link) = grep { $_->{'rel'} eq 'pair/reverse' } @{$sequence_file_pair->{'links'}};
......@@ -173,14 +179,18 @@ try {
my $total_bases = $forward_qc->{'totalBases'} + $reverse_qc->{'totalBases'};
my $coverage = sprintf "%0.0f",($total_bases/$reference_size);
my $project_date = localtime($project_info->{'createdDate'}/1000);
my $sample_date = localtime($sample->{'createdDate'}/1000);
my $sample_date = localtime($sample->{'createdDate'}/1000)->datetime;
my $file_pair_label = $sequence_file_pair->{'label'};
my $sequence_file_create_date = localtime($sequence_file_pair->{'createdDate'}/1000);
my $sequence_file_create_date = localtime($sequence_file_pair->{'createdDate'}/1000)->datetime;
$report_worksheet->write_row($row,0,[$project_info->{'name'},$sample->{'sampleName'},$sample_date,$coverage,$total_bases,$reference_size,$project_info->{'identifier'},$sample->{'identifier'},$sequence_file_pair->{'identifier'},$sequence_file_create_date,$file_pair_label]);
$report_worksheet->write_row($row,0,[$project_info->{'name'},$sample->{'sampleName'}]);
$report_worksheet->write_date_time($row,2,$sample_date, $date_format);
$report_worksheet->write_row($row,3,[$coverage,$total_bases,$reference_size,$project_info->{'identifier'},$sample->{'identifier'},$sequence_file_pair->{'identifier'}]);
$report_worksheet->write_date_time($row,9,$sequence_file_create_date, $date_format);
$report_worksheet->write_row($row,10,[$file_pair_label]);
$row++;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment