Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set a path for NovaSeqX samplesheet #795

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

mgcam
Copy link
Member

@mgcam mgcam commented Dec 15, 2023

Built on top of #794

Created a parent class for two existing samplesheet
generators. Moved common methods to this class.

Through this inheritance the NovaSeqX samplesheet
generator gets a standard method for setting a path for the
samplesheet.

An option to set the path from a value in the configuration file
is dropped - it was not used for years.

@mgcam mgcam marked this pull request as draft December 15, 2023 18:39
@mgcam mgcam force-pushed the novaseqx_ssheet_path branch from 8336a6b to d352987 Compare December 18, 2023 09:35
@mgcam mgcam marked this pull request as ready for review December 18, 2023 10:07
@mgcam mgcam force-pushed the novaseqx_ssheet_path branch from d352987 to a5a1ce3 Compare December 18, 2023 10:25
@mgcam mgcam changed the title Ability to set a configurable path for NovaSeqX samplesheet Ability to set a path for NovaSeqX samplesheet Dec 18, 2023
@mgcam mgcam force-pushed the novaseqx_ssheet_path branch from e37aa34 to 86531f4 Compare December 18, 2023 15:44
Created a parent class for two existing samplesheet
generators. Moved common methods to this class.

Through this inheritance the NovaSeqX samplesheet
generator gets a standard method for setting a configurable
path for a samplesheet.
@mgcam mgcam force-pushed the novaseqx_ssheet_path branch from 86531f4 to e8e50f2 Compare December 19, 2023 09:56
Copy link
Member

@jmtcsngr jmtcsngr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes and suggestions.


=item npg_tracking::Schema

=item st::api::lims
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=item st::api::lims
=item st::api::lims


=head2 batch_id
my $date = DateTime->now()->strftime('%y%m%d'); # 230602 for 2 June 2023
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
my $date = DateTime->now()->strftime('%y%m%d'); # 230602 for 2 June 2023
my $date = DateTime->now()->strftime('%y%m%d'); # 230602 for 2 June 2023

my $dir = $self->samplesheet_path();
my $path = $self->file_name;
if ($dir) {
$dir =~ s{/\Z}{}xms; # Trim trailing slash if present.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this regex be one or more '/' at end of line?

if ($self->has_id_run()) {
if ($self->id_run()) {
if ($self->run->instrument_format()->model() !~ /NovaSeqX/smx) {
croak 'Instrument model is not NovaSeq X Series';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be something like 'Instrument model is not NovaSeq X Series in tracking' Or 'Instrument model must be NovaSeqX series but is ' . $self->run->instrument_format()->model() . ' in tracking database'?

Ah but then is also changing test. Which may be bad for just refactoring. Well, only if you think it is worth.

'lazy_build' => 1,
);
sub _build_samplesheet_path {
if($ENV{dev} and not $ENV{dev}=~/live/smix){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this is not needed since paths can be set by whoever executes.

An option to read the value from the configuration file
is not used.
@mgcam mgcam force-pushed the novaseqx_ssheet_path branch from e8e50f2 to 5aa5005 Compare December 20, 2023 13:48
@jmtcsngr jmtcsngr merged commit c496c98 into wtsi-npg:devel Dec 20, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants