Skip to content

Commit 0de706c

Browse files
committed
Add --force-single-end and --force-paired-reads
1 parent 8e71bc4 commit 0de706c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rnaseq_pipeline/sources/sra.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ class DownloadSraExperiment(DynamicTaskWithOutputMixin, DynamicWrapperTask):
131131
"""
132132
srr = luigi.OptionalParameter(default=None, description='Specific SRA run accession to use (defaults to latest)')
133133

134+
force_single_end = luigi.BoolParameter(positional=False, significant=False, default=False, description='Force the library layout to be single-end')
135+
force_paired_reads = luigi.BoolParameter(positional=False, significant=False, default=False, description='Force the library layout to be paired')
136+
134137
@property
135138
def sample_id(self):
136139
return self.srx
@@ -148,7 +151,12 @@ def run(self):
148151
else:
149152
run = df.sort_values('Run', ascending=False).iloc[0]
150153

151-
is_paired = run.LibraryLayout == 'PAIRED'
154+
if self.force_paired_reads:
155+
is_paired = True
156+
elif self.force_single_end:
157+
is_paired = False
158+
else:
159+
run.LibraryLayout == 'PAIRED'
152160

153161
metadata = dict(self.metadata)
154162
# do not override the sample_id when invoked from DownloadGeoSample or DownloadGemmaExperiment

0 commit comments

Comments
 (0)