Skip to content

Commit 856e9b4

Browse files
committed
add subsample_reads
1 parent 07e2cdc commit 856e9b4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/qp_klp/Assays.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def execute_pipeline(self):
166166
self.convert_raw_to_fastq()
167167
self.integrate_results()
168168
self.generate_sequence_counts()
169+
self.subsample_reads()
169170

170171
self.update_status("QC-ing reads", 2, 9)
171172
if "NuQCJob" not in self.skip_steps:

src/qp_klp/Protocol.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from os import makedirs, rename, walk
1010
from metapool import load_sample_sheet
1111
from metapool.sample_sheet import PROTOCOL_NAME_ILLUMINA, PROTOCOL_NAME_TELLSEQ
12+
import pandas as pd
13+
from glob import glob
1214

1315

1416
PROTOCOL_NAME_NONE = "None"
@@ -22,6 +24,15 @@ class Protocol():
2224
initialization.
2325
"""
2426
protocol_type = PROTOCOL_NAME_NONE
27+
MAX_READS = 1
28+
29+
def subsample_reads(self):
30+
df = pd.read_csv(self.reports_path)
31+
df = df[df.raw_reads_r1r2 > self.MAX_READS]
32+
if df.shape[0]:
33+
for sn in df.Sample_ID:
34+
files = glob(f'{self.pipeline.output_path}/*/{sn}*.fastq.gz')
35+
print(sn, files)
2536

2637

2738
class Illumina(Protocol):

0 commit comments

Comments
 (0)