From 16f249dfcfd7674756d64a5a97ed541697ee422c Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Tue, 13 Aug 2024 12:19:59 -0700 Subject: [PATCH] Avoid overriding metadata in DownloadGeoSample and DownloadSraExperiment --- rnaseq_pipeline/sources/geo.py | 4 +++- rnaseq_pipeline/sources/sra.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rnaseq_pipeline/sources/geo.py b/rnaseq_pipeline/sources/geo.py index a122168..6b9d52f 100644 --- a/rnaseq_pipeline/sources/geo.py +++ b/rnaseq_pipeline/sources/geo.py @@ -104,7 +104,9 @@ def run(self): platform, srx_url = samples_info[self.gsm] srx = parse_qs(urlparse(srx_url).query)['term'][0] metadata = dict(self.metadata) - metadata['sample_id'] = self.sample_id + # do not override the sample_id when invoked from DownloadGemmaExperiment + if 'sample_id' not in metadata: + metadata['sample_id'] = self.sample_id yield DownloadSraExperiment(srx, metadata=metadata) class DownloadGeoSeriesMetadata(TaskWithMetadataMixin, RerunnableTaskMixin, luigi.Task): diff --git a/rnaseq_pipeline/sources/sra.py b/rnaseq_pipeline/sources/sra.py index 74ba20a..314ade1 100644 --- a/rnaseq_pipeline/sources/sra.py +++ b/rnaseq_pipeline/sources/sra.py @@ -151,7 +151,9 @@ def run(self): is_paired = run.LibraryLayout == 'PAIRED' metadata = dict(self.metadata) - metadata['sample_id'] = self.sample_id + # do not override the sample_id when invoked from DownloadGeoSample or DownloadGemmaExperiment + if 'sample_id' not in metadata: + metadata['sample_id'] = self.sample_id yield DumpSraRun(run.Run, self.srx, paired_reads=is_paired, metadata=metadata) class DownloadSraProjectRunInfo(TaskWithMetadataMixin, RerunnableTaskMixin, luigi.Task):