diff --git a/composer.json b/composer.json index cb14a86..00a1e51 100644 --- a/composer.json +++ b/composer.json @@ -74,7 +74,9 @@ "policy": { "advisories": { "ignore": [ - "laravel/framework" + "laravel/framework", + "league/flysystem", + "zbateson/mail-mime-parser" ] } }, diff --git a/src/IlluminaSampleSheet/V2/BclConvertSoftwareVersion.php b/src/IlluminaSampleSheet/V2/BclConvertSoftwareVersion.php deleted file mode 100644 index ed48dba..0000000 --- a/src/IlluminaSampleSheet/V2/BclConvertSoftwareVersion.php +++ /dev/null @@ -1,21 +0,0 @@ -value = $value; - } - - public static function V4_1_23(): self - { - return new self(self::V4_1_23); - } -} diff --git a/src/IlluminaSampleSheet/V2/Sections/BclConvertSettingsSection.php b/src/IlluminaSampleSheet/V2/Sections/BclConvertSettingsSection.php index c22345e..5e2d67c 100644 --- a/src/IlluminaSampleSheet/V2/Sections/BclConvertSettingsSection.php +++ b/src/IlluminaSampleSheet/V2/Sections/BclConvertSettingsSection.php @@ -3,17 +3,17 @@ namespace MLL\Utils\IlluminaSampleSheet\V2\Sections; use Illuminate\Support\Collection; -use MLL\Utils\IlluminaSampleSheet\V2\BclConvertSoftwareVersion; use MLL\Utils\IlluminaSampleSheet\V2\Enums\FastQCompressionFormat; final class BclConvertSettingsSection extends SimpleKeyValueSection { use RequiresAnalysisLocationToBeSet; - public function __construct() + public function __construct(string $softwareVersion) { $fields = new Collection([ 'FastqCompressionFormat' => FastQCompressionFormat::GZIP, + 'SoftwareVersion' => $softwareVersion, ]); parent::__construct($fields); @@ -22,20 +22,9 @@ public function __construct() public function performAnalysisOn(AnalysisLocation $analysisLocation): void { $this->analysisLocation = $analysisLocation; - $analysisLocation->value === AnalysisLocation::LOCAL_MACHINE - ? $this->performAnalysisOnLocalMachine() - : $this->performAnalysisOnCloud(); - } - - private function performAnalysisOnCloud(): void - { - $this->keyValues['SoftwareVersion'] = BclConvertSoftwareVersion::V4_1_23; - } - - private function performAnalysisOnLocalMachine(): void - { - $this->keyValues['SoftwareVersion'] = BclConvertSoftwareVersion::V4_4_6; - $this->keyValues['GenerateFastqcMetrics'] = 'true'; + if ($analysisLocation->value === AnalysisLocation::LOCAL_MACHINE) { + $this->keyValues['GenerateFastqcMetrics'] = 'true'; + } } public function sectionName(): string diff --git a/src/IlluminaSampleSheet/V2/Sections/CloudSettingsSection.php b/src/IlluminaSampleSheet/V2/Sections/CloudSettingsSection.php index 69e7017..252174a 100644 --- a/src/IlluminaSampleSheet/V2/Sections/CloudSettingsSection.php +++ b/src/IlluminaSampleSheet/V2/Sections/CloudSettingsSection.php @@ -9,14 +9,13 @@ final class CloudSettingsSection extends SimpleKeyValueSection /** @var string */ public const GENERATED_VERSION = '2.6.0.202308300002'; public const CLOUD_WORKFLOW = 'ica_workflow_1'; - public const BCL_CONVERT_PIPELINE = 'urn:ilmn:ica:pipeline:d5c7e407-d439-48c8-bce5-b7aec225f6a7#BclConvert_v4_1_23_patch1'; - public function __construct() + public function __construct(string $bclConvertPipeline) { parent::__construct(new Collection([ 'GeneratedVersion' => self::GENERATED_VERSION, 'Cloud_Workflow' => self::CLOUD_WORKFLOW, - 'BCLConvert_Pipeline' => self::BCL_CONVERT_PIPELINE, + 'BCLConvert_Pipeline' => $bclConvertPipeline, ])); } diff --git a/tests/IlluminaSampleSheet/V2/BclConvertSettingsSectionTest.php b/tests/IlluminaSampleSheet/V2/BclConvertSettingsSectionTest.php index d8468fb..66e1f66 100644 --- a/tests/IlluminaSampleSheet/V2/BclConvertSettingsSectionTest.php +++ b/tests/IlluminaSampleSheet/V2/BclConvertSettingsSectionTest.php @@ -10,11 +10,11 @@ final class BclConvertSettingsSectionTest extends TestCase { public function testToStringOnCloud(): void { - $bclConvertSettingsSection = new BclConvertSettingsSection(); + $bclConvertSettingsSection = new BclConvertSettingsSection('4.4.10'); $bclConvertSettingsSection->performAnalysisOn(AnalysisLocation::CLOUD()); $expected = <<<'CSV' FastqCompressionFormat,gzip -SoftwareVersion,4.1.23 +SoftwareVersion,4.4.10 CSV; self::assertSame($expected, $bclConvertSettingsSection->convertSectionToString()); @@ -22,7 +22,7 @@ public function testToStringOnCloud(): void public function testToStringLocal(): void { - $bclConvertSettingsSection = new BclConvertSettingsSection(); + $bclConvertSettingsSection = new BclConvertSettingsSection('4.4.6'); $bclConvertSettingsSection->performAnalysisOn(AnalysisLocation::LOCAL_MACHINE()); $expected = <<<'CSV' diff --git a/tests/IlluminaSampleSheet/V2/IlluminaSampleSheetVersion2Test.php b/tests/IlluminaSampleSheet/V2/IlluminaSampleSheetVersion2Test.php index fc6c9f2..1bf058c 100644 --- a/tests/IlluminaSampleSheet/V2/IlluminaSampleSheetVersion2Test.php +++ b/tests/IlluminaSampleSheet/V2/IlluminaSampleSheetVersion2Test.php @@ -91,7 +91,7 @@ public function testNovaSeqXCloudSampleSheetToStringReturnsExpectedResult(): voi null ); - $bclConvertSettingsSection = new BclConvertSettingsSection(); + $bclConvertSettingsSection = new BclConvertSettingsSection('4.4.10'); $bclConvertDataSection = new BclConvertDataSection($bclSampleList); @@ -102,7 +102,7 @@ public function testNovaSeqXCloudSampleSheetToStringReturnsExpectedResult(): voi $readsSection, $bclConvertSettingsSection, $bclConvertDataSection, - new CloudSettingsSection(), + new CloudSettingsSection('urn:ilmn:ica:pipeline:4bdae602-abe4-4230-b0c6-f886af563b26#BclConvert_v4_4_10'), new CloudDataSection(new Collection([ new CloudDataItem($bclSample0->sampleID, 'test', 'foo'), new CloudDataItem($bclSample1->sampleID, 'test', 'foo'), @@ -126,7 +126,7 @@ public function testNovaSeqXCloudSampleSheetToStringReturnsExpectedResult(): voi [BCLConvert_Settings] FastqCompressionFormat,gzip - SoftwareVersion,4.1.23 + SoftwareVersion,4.4.10 [BCLConvert_Data] Lane,Sample_ID,Index,Index2,OverrideCycles,AdapterRead1,AdapterRead2,BarcodeMismatchesIndex1,BarcodeMismatchesIndex2 @@ -140,7 +140,7 @@ public function testNovaSeqXCloudSampleSheetToStringReturnsExpectedResult(): voi [Cloud_Settings] GeneratedVersion,2.6.0.202308300002 Cloud_Workflow,ica_workflow_1 - BCLConvert_Pipeline,urn:ilmn:ica:pipeline:d5c7e407-d439-48c8-bce5-b7aec225f6a7#BclConvert_v4_1_23_patch1 + BCLConvert_Pipeline,urn:ilmn:ica:pipeline:4bdae602-abe4-4230-b0c6-f886af563b26#BclConvert_v4_4_10 [Cloud_Data] Sample_ID,ProjectName,LibraryName