Skip to content

Commit

Permalink
workout solution for ONT
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Jan 16, 2025
1 parent 829aa85 commit 132cf59
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions scripts/readscount.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def sum_reads(sample, summary):

assert demux_art.udf["Include reads"] == "YES"

# From the demux artifact, find the parent analyte from the actual sequencing step
# Track down the sequencing process upstream of the demux artifact
demux_art_parents = [
parent
for parent in get_parent_inputs(demux_art)
Expand All @@ -178,23 +178,25 @@ def sum_reads(sample, summary):
assert len(demux_art_parents) == 1
demux_art_parent = demux_art_parents[0]

# Check whether we are dealing with dual reads
dual_reads = False
try:
if demux_art_parent.parent_process.type.name in SEQUENCING.values():
seq_process = demux_art_parent.parent_process
else:
raise NotImplementedError(
f"Parent process of demux artifact {demux_art.id} is not a sequencing process"
) # TODO check whether this ever happens
seq_process = lims.get_processes(
type=list(SEQUENCING.values()),
inputartifactlimsid=demux_art_parent.id,
)[0]
except TypeError:
logging.error(
f"Did not manage to get sequencing process for artifact '{demux_art_parent.name}' ({demux_art_parent.id})"
)

# Check whether we are dealing with dual reads
if (
"Read 2 Cycles" in seq_process.udf
and seq_process.udf["Read 2 Cycles"] is not None
):
dual_reads = True
else:
if (
"Read 2 Cycles" in seq_process.udf
and seq_process.udf["Read 2 Cycles"] is not None
):
dual_reads = True
dual_reads = False

# Gather flowcell information
if "ONT flow cell ID" in demux_art_parent.udf:
Expand Down

0 comments on commit 132cf59

Please sign in to comment.