Skip to content

Commit 5d58cf5

Browse files
authored
Merge pull request #496 from ssjunnebo/nulisa_index_assignment_fix
Get all available samples in get_noindex_stats
2 parents e84cc4c + b20aeae commit 5d58cf5

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

VERSIONLOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# TACA Version Log
22

3+
## 20251015.1
4+
5+
Bugfix: Get all available samples in get_noindex_stats
6+
37
## 20251010.2
48

59
Move Aviti Teton FlowcellPressureCheck directories into run directory before processing the run

taca/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Main TACA module"""
22

3-
__version__ = "1.6.10"
3+
__version__ = "1.6.11"

taca/element/Element_Runs.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,32 +1178,38 @@ def get_noindex_stats(self, sub_demux):
11781178
# read sub_demux_manifest into a string
11791179
with open(sub_demux_manifest) as f:
11801180
manifest_csv = f.read()
1181-
sample_row = (
1182-
manifest_csv.split("[SAMPLES]")[1].strip().split("\n")[-1]
1181+
sample_rows = (
1182+
manifest_csv.split("[SAMPLES]")[1].strip().split("\n")[1:]
11831183
) # ugh...
1184-
sample_name = sample_row.split(",")[0]
1185-
lane = sample_row.split(",")[3]
1186-
# Extract NumPolonies from RunStats.json
11871184
runstats_json_path = os.path.join(
11881185
self.run_dir, f"Demultiplexing_{sub_demux}", "RunStats.json"
11891186
)
1190-
if os.path.exists(runstats_json_path):
1187+
if not os.path.exists(runstats_json_path):
1188+
logger.error(
1189+
f"No RunStats.json file found for sub-demultiplexing {sub_demux}. Unable to process NoIndex samples. Skipping."
1190+
)
1191+
raise FileNotFoundError
1192+
samples = []
1193+
for sample_row in sample_rows:
1194+
sample_name = sample_row.split(",")[0]
1195+
lane = sample_row.split(",")[3]
1196+
# Extract NumPolonies from RunStats.json
11911197
with open(runstats_json_path) as json_file:
11921198
demux_info = json.load(json_file)
11931199
demuxed_lanes = demux_info.get("Lanes")
11941200
for demuxed_lane in demuxed_lanes:
11951201
if demuxed_lane.get("Lane") == int(lane):
11961202
polonies = demuxed_lane.get("NumPolonies")
11971203
break
1198-
return [
1199-
{
1204+
sample_info = {
12001205
"SampleName": sample_name,
12011206
"I1": "",
12021207
"I2": "",
12031208
"Lane": lane,
12041209
"NumPoloniesAssigned": polonies,
12051210
}
1206-
]
1211+
samples.append(sample_info)
1212+
return samples
12071213

12081214
# Aggregate stats in UnassignedSequences.csv
12091215
def aggregate_stats_unassigned(

0 commit comments

Comments
 (0)