Skip to content

Commit

Permalink
add user-vs-inhouse library boolean and logic for rev-comping index2 …
Browse files Browse the repository at this point in the history
…of certain samples
  • Loading branch information
kedhammar committed Nov 4, 2024
1 parent a8a6e21 commit 2bc45ad
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/generate_aviti_run_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ def get_manifests(process: Process, manifest_root_name: str) -> list[tuple[str,
if sample.project:
project = sample.project.name.replace(".", "__").replace(",", "")
seq_setup = sample.project.udf.get("Sequencing setup", "0-0")
user_library = (
True
if sample.project.udf["Library construction method"]
== "Finished library (by user)"
else False
)
else:
project = "Control"
seq_setup = "0-0"
Expand All @@ -200,6 +206,16 @@ def get_manifests(process: Process, manifest_root_name: str) -> list[tuple[str,
row["SampleName"] = sample.name
if isinstance(idx, tuple):
row["Index1"], row["Index2"] = idx
# Special cases to reverse-complement index2
if user_library or (
not user_library
and (
TENX_DUAL_PAT.findall(lims_label)
or SMARTSEQ_PAT.findall(lims_label)
)
):
logging.info(f"Reverse-complementing index2 of {sample.name}.")
row["Index2"] = revcomp(row["Index2"])
else:
row["Index1"] = idx
# Assume long idx2 from recipe + no idx2 from label means idx2 is UMI
Expand Down

0 comments on commit 2bc45ad

Please sign in to comment.