Skip to content

Commit

Permalink
Merge pull request #788 from wtsi-npg/devel
Browse files Browse the repository at this point in the history
pull from devel to master to create release 98.1.0
  • Loading branch information
jmtcsngr authored Dec 1, 2023
2 parents 5fc74b2 + 081e95c commit e81e6e7
Show file tree
Hide file tree
Showing 9 changed files with 468 additions and 271 deletions.
10 changes: 10 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
LIST OF CHANGES

release 98.1.0
- Added a new method, latest_revision_for_modification, to
npg_tracking::Schema::Result::Instrument to retrieve the latest modification
revision for the instrument.
- Added 'dragen_software_version' script argument
for bin/npg_samplesheet_generator_NovaSeqXSeries. If not set and
id_run is defined, defaults to the record for the latest 'Dragen'
modification for the NovaSeqX instrument on which the flowcell will be
sequenced.

release 98.0.0
- Removed the use of 'xml' lims driver from all tests.
- Deleted 'xml' lims driver class and all classes which supported this
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ t/data/schema.txt
t/data/090414_IL24_2726.tar.bz2
t/data/dbic_fixtures/000-Designation.yml
t/data/dbic_fixtures/000-EntityType.yml
t/data/dbic_fixtures/000-InstrumentModDict.yml
t/data/dbic_fixtures/000-InstrumentStatusDict.yml
t/data/dbic_fixtures/000-Manufacturer.yml
t/data/dbic_fixtures/000-RunLaneStatusDict.yml
Expand All @@ -432,6 +433,7 @@ t/data/dbic_fixtures/100-InstrumentFormat.yml
t/data/dbic_fixtures/100-User2usergroup.yml
t/data/dbic_fixtures/200-Event.yml
t/data/dbic_fixtures/200-Instrument.yml
t/data/dbic_fixtures/300-InstrumentMod.yml
t/data/dbic_fixtures/300-Run.yml
t/data/dbic_fixtures/300-RunLane.yml
t/data/dbic_fixtures/400-RunLaneStatus.yml
Expand Down
42 changes: 34 additions & 8 deletions lib/npg/samplesheet/novaseq_xseries.pm
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ Readonly::Hash my %REFERENCE_MAPING => (
'Homo_sapiens' => 'hg38-alt_masked.cnv.graph.hla.rna-8-1667497097-2'
);

# The version of the DRAGEN software currently on-board of the instrument.
Readonly::Scalar my $SOFTWARE_VERSION => '4.1.7';

# DRAGEN can process a limited number of distinct configurations.
# For on-board analysis it's 4.
Readonly::Scalar my $DRAGEN_MAX_NUMBER_OF_CONFIGS => 4;
Expand Down Expand Up @@ -90,6 +87,36 @@ L<https://support-docs.illumina.com/IN/NovaSeqX/Content/IN/NovaSeqX/ImportResour
=cut

=head2
DRAGEN software version that is installed on the instrument where the run
is performed.
=cut

has 'dragen_software_version' => (
'isa' => 'Str',
'is' => 'ro',
'lazy_build' => 1,
'required' => 0,
'documentation' => 'DRAGEN software version',
);
sub _build_dragen_software_version {
my $self = shift;

if (!$self->has_id_run) {
croak 'DRAGEN software version cannot be retrieved. ' .
'Either supply it as an argument or supply existing id_run';
}
my $software_version =
$self->run->instrument->latest_revision_for_modification('Dragen');
if (!$software_version) {
croak 'Failed to get DRAGEN software version from instrument records';
}
return $software_version;
};


=head2 id_run
NPG run ID, an optional attribute. If supplied, the record for this run
Expand All @@ -116,7 +143,7 @@ has 'batch_id' => (
'lazy_build' => 1,
'required' => 0,
'documentation' => 'LIMS batch identifier, optional. If not set, will be ' .
'retrieved from the trackign database record for the run',
'retrieved from the tracking database record for the run',
);
sub _build_batch_id {
my $self = shift;
Expand Down Expand Up @@ -492,10 +519,9 @@ sub add_bclconvert_section {
my $self = shift;

my ($index1_length, $index2_length) = @{$self->_index_reads_length()};

my @lines = ();
push @lines, ['[BCLConvert_Settings]'];
push @lines, [q[SoftwareVersion], $SOFTWARE_VERSION];
push @lines, [q[SoftwareVersion], $self->dragen_software_version];

# Not clear what CLI analysis option thie corresponds to.
# Looks likely to be a list of lanes to run a tag collision check.
Expand Down Expand Up @@ -775,7 +801,7 @@ sub add_germline_section {
if (@to_align) {

$self->_add_line('[DragenGermline_Settings]');
$self->_add_line(q[SoftwareVersion], $SOFTWARE_VERSION);
$self->_add_line(q[SoftwareVersion], $self->dragen_software_version);
$self->_add_line(qw(MapAlignOutFormat cram));
# Accepted values are true or false. Not clear whether this can be
# set per sample.
Expand Down Expand Up @@ -820,7 +846,7 @@ sub add_rna_section {

if (@to_align) {
$self->_add_line('[DragenRNA_Settings]');
$self->_add_line(q(SoftwareVersion), $SOFTWARE_VERSION);
$self->_add_line(q(SoftwareVersion), $self->dragen_software_version);
$self->_add_line(qw(MapAlignOutFormat cram));
$self->_add_line(q(KeepFastq), $self->keep_fastq ? 'TRUE' : 'FALSE');
$self->_add_line(qw(RnaPipelineMode FullPipeline));
Expand Down
36 changes: 36 additions & 0 deletions lib/npg_tracking/Schema/Result/Instrument.pm
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,42 @@ sub _runs_with_status {
);
}

=head2 latest_revision_for_modification
Returns the most recent revision for a modification described by the
argument string. If either no or no current modification is
available for the given description, an undefined value is returned.
print $in->current_modification_revision('NXCS'); # v1.1.0
print $in->current_modification_revision('Dragen'); # v4.1.7
my $revision = $in->current_modification_revision('NVCS');
defined $revision ? print $revision : print 'Not available'; # Not available
=cut

sub latest_revision_for_modification() {
my ($self, $mod_description) = @_;

my @rows = $self->instrument_mods->search(
{
'iscurrent' => 1,
'date_removed' => undef,
'instrument_mod_dict.description' => $mod_description
},
{
'join' => 'instrument_mod_dict',
'prefetch' => 'instrument_mod_dict',
'order_by' => {'-desc' => 'date_added'}
}
)->all();

if (@rows) {
return $rows[0]->instrument_mod_dict->revision();
}

return;
}

=head1 DESCRIPTION
DBIx model for an instrument.
Contains duplicates of functions in npg::model::instrument.
Expand Down
Loading

0 comments on commit e81e6e7

Please sign in to comment.