Skip to content

Commit

Permalink
Merge pull request #371 from chuan-wang/master
Browse files Browse the repository at this point in the history
Improve aviti run parameter parser
  • Loading branch information
chuan-wang authored Oct 5, 2024
2 parents d8c9e75 + fbf906d commit 0ef0e9c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions VERSIONLOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Scilifelab_epps Version Log

## 20241006.2

Improve aviti run parameter parser

## 20241006.1

Fix issue with empty Aviti runmanifest results in Lane nr 0
Expand Down
14 changes: 13 additions & 1 deletion scripts/aviti_run_parameter_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,19 @@ def set_run_stats(process, run_dir):
for art in process.all_outputs():
if "Lane" in art.name:
lane_nbr = int(art.name.split(" ")[1])
lane_stats = run_stats["LaneStats"][lane_nbr - 1]
lanes = [d["Lane"] for d in run_stats["LaneStats"]]
# When there is no runmanifest provided, the Lane number will be displayed as 0
# In this case we have to parse the lanes in order
if lane_nbr not in lanes:
if lane_nbr <= len(run_stats["LaneStats"]):
lane_stats = run_stats["LaneStats"][lane_nbr - 1]
else:
sys.stderr.write("Inconsistent lane number detected!")
sys.exit(2)
else:
lane_stats = next(
d for d in run_stats["LaneStats"] if d["Lane"] == lane_nbr
)
for read in lane_stats["Reads"]:
read_key = read["Read"]
art.udf[f"Reads PF (M) {read_key}"] = lane_stats["PFCount"] / 1000000
Expand Down

0 comments on commit 0ef0e9c

Please sign in to comment.