Skip to content

Commit

Permalink
Merge pull request #370 from chuan-wang/master
Browse files Browse the repository at this point in the history
Fix issue with empty Aviti runmanifest results in Lane nr 0
  • Loading branch information
chuan-wang authored Oct 5, 2024
2 parents 16377ba + 095d1f6 commit d8c9e75
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
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.1

Fix issue with empty Aviti runmanifest results in Lane nr 0

## 20241002.1

Fix bug with index checker EPP with preset index sets
Expand Down
45 changes: 22 additions & 23 deletions scripts/aviti_run_parameter_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,33 +157,32 @@ def calculate_mean(input_list, key):


def set_run_stats(process, run_dir):
global lane_stats
run_stats = parse_run_stats(run_dir)
for art in process.all_outputs():
if "Lane" in art.name:
lane_nbr = int(art.name.split(" ")[1])
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
art.udf[f"%PF {read_key}"] = lane_stats["PercentPF"]
art.udf[f"Yield PF (Gb) {read_key}"] = lane_stats["TotalYield"] / 1000000000
art.udf[f"% Aligned {read_key}"] = read["PhiXAlignmentRate"]
art.udf[f"% Bases >=Q30 {read_key}"] = calculate_mean(
read["Cycles"], "PercentQ30"
)
art.udf[f"% Bases >=Q40 {read_key}"] = calculate_mean(
read["Cycles"], "PercentQ40"
)
art.udf[f"Avg Q Score {read_key}"] = calculate_mean(
read["Cycles"], "AverageQScore"
)
art.udf[f"% Error Rate {read_key}"] = calculate_mean(
read["Cycles"], "PercentPhixErrorRate"
)
art.put()
lane_stats = run_stats["LaneStats"][lane_nbr - 1]
for read in lane_stats["Reads"]:
read_key = read["Read"]
art.udf[f"Reads PF (M) {read_key}"] = lane_stats["PFCount"] / 1000000
art.udf[f"%PF {read_key}"] = lane_stats["PercentPF"]
art.udf[f"Yield PF (Gb) {read_key}"] = (
lane_stats["TotalYield"] / 1000000000
)
art.udf[f"% Aligned {read_key}"] = read["PhiXAlignmentRate"]
art.udf[f"% Bases >=Q30 {read_key}"] = calculate_mean(
read["Cycles"], "PercentQ30"
)
art.udf[f"% Bases >=Q40 {read_key}"] = calculate_mean(
read["Cycles"], "PercentQ40"
)
art.udf[f"Avg Q Score {read_key}"] = calculate_mean(
read["Cycles"], "AverageQScore"
)
art.udf[f"% Error Rate {read_key}"] = calculate_mean(
read["Cycles"], "PercentPhixErrorRate"
)
art.put()
process.put()


Expand Down

0 comments on commit d8c9e75

Please sign in to comment.