Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For AVITI manifests, if idx2 cycles > 12 and idx2 can't be parsed, treat it as UMI #367

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

## 20240930.1

For AVITI manifest generation, assume idx2 > 12 cycles and no idx2 parsed means idx2 is UMI and add Ns to manifest.

## 20240925.1

Add 10X steps to comments-to-running-notes config.
Expand Down
24 changes: 22 additions & 2 deletions scripts/generate_aviti_run_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ def get_manifests(process: Process, manifest_root_name: str) -> list[tuple[str,
row["Index1"], row["Index2"] = idx
else:
row["Index1"] = idx
row["Index2"] = ""
# Assume long idx2 from recipe + no idx2 from label means idx2 is UMI
if int(process.udf.get("Index read 2", 0)) > 12:
row["Index2"] = "N" * int(process.udf["Index read 2"])
kedhammar marked this conversation as resolved.
Show resolved Hide resolved
else:
row["Index2"] = ""
row["Lane"] = lane
row["Project"] = project
row["Recipe"] = seq_setup
Expand Down Expand Up @@ -231,7 +235,7 @@ def get_manifests(process: Process, manifest_root_name: str) -> list[tuple[str,
check_distances(rows_to_check)

manifests = []
for manifest_type in ["untrimmed", "trimmed", "partitioned"]:
for manifest_type in ["untrimmed", "trimmed", "empty", "partitioned"]:
manifests += make_manifests_by_type(
df_samples_and_controls, process, manifest_root_name, manifest_type
)
Expand Down Expand Up @@ -307,6 +311,22 @@ def make_manifests_by_type(
)
manifests.append((file_name, manifest_contents))

elif manifest_type == "empty":
file_name = f"{manifest_root_name}_empty.csv"

runValues_section = "\n".join(
[
"[RUNVALUES]",
"KeyName, Value",
f'lims_step_name, "{process.type.name}"',
f'lims_step_id, "{process.id}"',
f'manifest_file, "{file_name}"',
]
)

manifest_contents = "\n\n".join([runValues_section, settings_section])
manifests.append((file_name, manifest_contents))

elif manifest_type == "partitioned":
# Drop PhiX controls, to be re-added by length
df = df[df["Project"] != "Control"]
Expand Down
Loading