Skip to content

Commit

Permalink
Merge pull request #469 from ces/pacbio27
Browse files Browse the repository at this point in the history
Pacbio - just code reorganisation
  • Loading branch information
kjsanger authored Sep 24, 2024
2 parents 2c7e1a2 + f2f1156 commit ff64271
Show file tree
Hide file tree
Showing 532 changed files with 794 additions and 838 deletions.
1,009 changes: 504 additions & 505 deletions MANIFEST

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/npg_pacbio_analysis_monitor.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use WTSI::DNAP::Warehouse::Schema;
use WTSI::NPG::iRODS;
use WTSI::NPG::HTS::PacBio::Sequel::AnalysisMonitor;
use WTSI::NPG::HTS::PacBio::AnalysisMonitor;

our $VERSION = '';

Expand Down
4 changes: 2 additions & 2 deletions bin/npg_pacbio_run_auxiliary.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

use WTSI::DNAP::Warehouse::Schema;
use WTSI::NPG::DriRODS;
use WTSI::NPG::HTS::PacBio::Sequel::RunDeleteMonitor;
use WTSI::NPG::HTS::PacBio::Sequel::RunAuditor;
use WTSI::NPG::HTS::PacBio::RunDeleteMonitor;
use WTSI::NPG::HTS::PacBio::RunAuditor;

our $VERSION = '';

Expand Down
2 changes: 1 addition & 1 deletion bin/npg_pacbio_runmonitor.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use WTSI::DNAP::Warehouse::Schema;
use WTSI::NPG::iRODS;
use WTSI::NPG::HTS::PacBio::Sequel::RunMonitor;
use WTSI::NPG::HTS::PacBio::RunMonitor;


our $VERSION = '';
Expand Down
2 changes: 1 addition & 1 deletion bin/npg_publish_pacbio_run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use WTSI::DNAP::Warehouse::Schema;
use WTSI::NPG::iRODS;
use WTSI::NPG::HTS::PacBio::Sequel::RunPublisher;
use WTSI::NPG::HTS::PacBio::RunPublisher;

our $VERSION = '';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::AnalysisMonitor;
package WTSI::NPG::HTS::PacBio::AnalysisMonitor;

use namespace::autoclean;
use DateTime;
Expand All @@ -8,13 +8,12 @@ use MooseX::StrictConstructor;
use Readonly;
use Try::Tiny;

use WTSI::NPG::HTS::PacBio::Sequel::AnalysisPublisher;
use WTSI::NPG::HTS::PacBio::Sequel::IsoSeqPublisher;
use WTSI::NPG::HTS::PacBio::AnalysisPublisher;
use WTSI::NPG::HTS::PacBio::IsoSeqPublisher;

with qw[
WTSI::DNAP::Utilities::Loggable
WTSI::NPG::HTS::PacBio::MonitorBase
WTSI::NPG::HTS::PacBio::Sequel::MonitorBase
];

our $VERSION = '';
Expand Down Expand Up @@ -122,7 +121,7 @@ sub _publish_analysis_path {
push @init_args, dest_collection => $self->dest_collection;
}

my $publisher = WTSI::NPG::HTS::PacBio::Sequel::AnalysisPublisher->new(@init_args);
my $publisher = WTSI::NPG::HTS::PacBio::AnalysisPublisher->new(@init_args);

return $publisher->publish_files();
}
Expand All @@ -145,7 +144,7 @@ sub _publish_iso_analysis_path {

push @init_args, analysis_id => $job->{id};

my $publisher = WTSI::NPG::HTS::PacBio::Sequel::IsoSeqPublisher->new(@init_args);
my $publisher = WTSI::NPG::HTS::PacBio::IsoSeqPublisher->new(@init_args);

return $publisher->publish_files();
}
Expand All @@ -161,7 +160,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::AnalysisMonitor
WTSI::NPG::HTS::PacBio::AnalysisMonitor
=head1 DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::AnalysisPublisher;
package WTSI::NPG::HTS::PacBio::AnalysisPublisher;

use namespace::autoclean;
use English qw[-no_match_vars];
Expand All @@ -10,9 +10,9 @@ use MooseX::StrictConstructor;
use Perl6::Slurp;
use Readonly;

use WTSI::NPG::HTS::PacBio::Sequel::AnalysisReport;
use WTSI::NPG::HTS::PacBio::Sequel::MetaXMLParser;
use WTSI::NPG::HTS::PacBio::Sequel::Product;
use WTSI::NPG::HTS::PacBio::AnalysisReport;
use WTSI::NPG::HTS::PacBio::MetaXMLParser;
use WTSI::NPG::HTS::PacBio::Product;

with qw[
WTSI::NPG::HTS::PacBio::PublisherBase
Expand Down Expand Up @@ -46,7 +46,7 @@ Readonly::Scalar my $HUNDRED => 100;
Readonly::Scalar my $MIN_BARCODED => 0.8;
Readonly::Scalar my $BARCODE_FIELD => 'Percent Barcoded Reads';
Readonly::Scalar my $REPORT_TITLE =>
$WTSI::NPG::HTS::PacBio::Sequel::AnalysisReport::REPORTS;
$WTSI::NPG::HTS::PacBio::AnalysisReport::REPORTS;
Readonly::Scalar my $LIMA_SUMMARY => 'lima.summary.txt';


Expand Down Expand Up @@ -138,7 +138,7 @@ sub publish_sequence_files {

my ($num_files, $num_processed, $num_errors) = (0, 0, 0);

my $product = WTSI::NPG::HTS::PacBio::Sequel::Product->new();
my $product = WTSI::NPG::HTS::PacBio::Product->new();

foreach my $file ( @{$files} ){
my @tag_records;
Expand Down Expand Up @@ -318,7 +318,7 @@ sub _build_merged_report {
runfolder_path => $self->runfolder_path,
meta_data => $self->_metadata);

my $report = WTSI::NPG::HTS::PacBio::Sequel::AnalysisReport->new(@init_args);
my $report = WTSI::NPG::HTS::PacBio::AnalysisReport->new(@init_args);
return $report->generate_analysis_report;
}

Expand Down Expand Up @@ -422,7 +422,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::AnalysisPublisher
WTSI::NPG::HTS::PacBio::AnalysisPublisher
=head1 DESCRIPTION
Expand Down
4 changes: 2 additions & 2 deletions lib/WTSI/NPG/HTS/PacBio/AnalysisPublisherBase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use File::Spec::Functions qw[catdir];
use Moose::Role;
use MooseX::StrictConstructor;
use WTSI::NPG::HTS::PacBio::Metadata;
use WTSI::NPG::HTS::PacBio::Sequel::MetaXMLParser;
use WTSI::NPG::HTS::PacBio::MetaXMLParser;

our $VERSION = '';

Expand Down Expand Up @@ -55,7 +55,7 @@ sub _build_metadata{
$self->logcroak('Metadata files is not defined for '. $self->analysis_path);
}

return WTSI::NPG::HTS::PacBio::Sequel::MetaXMLParser->new->parse_file
return WTSI::NPG::HTS::PacBio::MetaXMLParser->new->parse_file
($self->_metadata_file, $METADATA_PREFIX);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::AnalysisReport;
package WTSI::NPG::HTS::PacBio::AnalysisReport;

use namespace::autoclean;
use File::Basename;
Expand All @@ -11,7 +11,7 @@ use Perl6::Slurp;
use Readonly;
use XML::LibXML;

use WTSI::NPG::HTS::PacBio::Sequel::Reportdata;
use WTSI::NPG::HTS::PacBio::Reportdata;

with qw[
WTSI::DNAP::Utilities::Loggable
Expand Down Expand Up @@ -147,7 +147,7 @@ sub _save_results {
%files = map { $_ => $self->_get_result($_) } $self->_get_result_keys;
}

my $data = WTSI::NPG::HTS::PacBio::Sequel::Reportdata->new
my $data = WTSI::NPG::HTS::PacBio::Reportdata->new
(meta_data => $self->meta_data,
$REPORTS => \%files );

Expand All @@ -169,7 +169,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::AnalysisReport
WTSI::NPG::HTS::PacBio::AnalysisReport
=head1 DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::ImageArchive;
package WTSI::NPG::HTS::PacBio::ImageArchive;

use namespace::autoclean;
use File::Basename;
Expand Down Expand Up @@ -168,7 +168,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::ImageArchive
WTSI::NPG::HTS::PacBio::ImageArchive
=head1 DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::IsoSeqPublisher;
package WTSI::NPG::HTS::PacBio::IsoSeqPublisher;

use namespace::autoclean;
use DateTime;
Expand All @@ -15,8 +15,8 @@ use Readonly;
use Try::Tiny;
use XML::LibXML;

use WTSI::NPG::HTS::PacBio::Sequel::MetaXMLParser;
use WTSI::NPG::HTS::PacBio::Sequel::Product;
use WTSI::NPG::HTS::PacBio::MetaXMLParser;
use WTSI::NPG::HTS::PacBio::Product;
use WTSI::DNAP::Utilities::Runnable;

with qw[
Expand Down Expand Up @@ -197,7 +197,7 @@ sub publish_sequence_files {

my ($num_files, $num_processed, $num_errors) = (0, 0, 0);

my $product = WTSI::NPG::HTS::PacBio::Sequel::Product->new();
my $product = WTSI::NPG::HTS::PacBio::Product->new();

foreach my $file ( @{$files} ){

Expand Down Expand Up @@ -368,7 +368,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::IsoSeqPublisher
WTSI::NPG::HTS::PacBio::IsoSeqPublisher
=head1 DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::MetaXMLParser;
package WTSI::NPG::HTS::PacBio::MetaXMLParser;

use namespace::autoclean;
use Moose;
Expand Down Expand Up @@ -145,7 +145,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::MetaXMLParser
WTSI::NPG::HTS::PacBio::MetaXMLParser
=head1 DESCRIPTION
Expand Down
30 changes: 30 additions & 0 deletions lib/WTSI/NPG/HTS/PacBio/MonitorBase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,36 @@ has 'mlwh_schema' =>
required => 1,
documentation => 'A ML warehouse handle to obtain secondary metadata');

has 'api_client' =>
(isa => 'WTSI::NPG::HTS::PacBio::Sequel::APIClient',
is => 'ro',
lazy_build => 1,
builder => q[_build_api_client],
documentation => 'A PacBio Sequel API client used to fetch runs');

sub _build_api_client {
my $self = shift;
my @init_args = $self->api_uri ? ('api_uri' => $self->api_uri) : ();
if($self->interval) { push @init_args, ('default_interval' => $self->interval) };
if($self->older_than) { push @init_args, ('default_end' => $self->older_than) };
return WTSI::NPG::HTS::PacBio::Sequel::APIClient->new(@init_args);
}

has 'api_uri' =>
(isa => 'Str',
is => 'ro',
documentation => 'PacBio root API URL');

has 'interval' =>
(isa => 'Str',
is => 'ro',
documentation => 'Interval of time in days');

has 'older_than' =>
(isa => 'Str',
is => 'ro',
documentation => 'Time in days to remove from end date');


no Moose::Role;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::Product;
package WTSI::NPG::HTS::PacBio::Product;

use Moose;
use English qw[-no_match_vars];
Expand Down Expand Up @@ -76,7 +76,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::Product
WTSI::NPG::HTS::PacBio::Product
=head1 DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::Reportdata;
package WTSI::NPG::HTS::PacBio::Reportdata;

use namespace::autoclean;
use DateTime;
Expand Down Expand Up @@ -60,7 +60,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::Reportdata
WTSI::NPG::HTS::PacBio::Reportdata
=head1 DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::RunAuditor;
package WTSI::NPG::HTS::PacBio::RunAuditor;

use namespace::autoclean;
use English qw[-no_match_vars];
Expand All @@ -17,8 +17,7 @@ Readonly::Scalar my $MODE_GROUP_WRITABLE => 0020;
with qw[
WTSI::DNAP::Utilities::Loggable
WTSI::NPG::HTS::PacBio::MonitorBase
WTSI::NPG::HTS::PacBio::Sequel::MonitorBase
WTSI::NPG::HTS::PacBio::Sequel::RunPublisherBase
WTSI::NPG::HTS::PacBio::RunPublisherBase
];

our $VERSION = '';
Expand Down Expand Up @@ -184,7 +183,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::RunAuditor
WTSI::NPG::HTS::PacBio::RunAuditor
=head1 DESCRIPTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package WTSI::NPG::HTS::PacBio::Sequel::RunDelete;
package WTSI::NPG::HTS::PacBio::RunDelete;

use namespace::autoclean;
use Moose;
Expand Down Expand Up @@ -61,7 +61,7 @@ __END__
=head1 NAME
WTSI::NPG::HTS::PacBio::Sequel::RunDelete
WTSI::NPG::HTS::PacBio::RunDelete
=head1 DESCRIPTION
Expand Down
Loading

0 comments on commit ff64271

Please sign in to comment.