Skip to content

Commit

Permalink
Merge pull request #367 from kedhammar/aviti-umis
Browse files Browse the repository at this point in the history
For AVITI manifests, if idx2 cycles > 12 and idx2 can't be parsed, treat it as UMI
  • Loading branch information
chuan-wang authored Oct 1, 2024
2 parents b3ee9b3 + 05d37d4 commit a632166
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 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

## 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"])
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

0 comments on commit a632166

Please sign in to comment.