Skip to content

Commit 2debb42

Browse files
added new miSeq and Nextseq error models
1 parent 716a700 commit 2debb42

File tree

9 files changed

+15
-6
lines changed

9 files changed

+15
-6
lines changed

Diff for: iss/generator.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import random
88
import sys
9+
from typing import Dict
910

1011
import numpy as np
1112
from Bio import SeqIO
@@ -363,6 +364,18 @@ def load_error_model(mode, seed, model, fragment_length, fragment_length_sd):
363364

364365
logger.info("Using %s ErrorModel" % mode)
365366

367+
precomputed_error_models: Dict[str, str] = {
368+
"hiseq": os.path.join(os.path.dirname(__file__), "profiles/HiSeq"),
369+
"novaseq": os.path.join(os.path.dirname(__file__), "profiles/NovaSeq"),
370+
"miseq": os.path.join(os.path.dirname(__file__), "profiles/miSeq_0.npz"),
371+
"miseq-20": os.path.join(os.path.dirname(__file__), "profiles/miSeq_20.npz"),
372+
"miseq-24": os.path.join(os.path.dirname(__file__), "profiles/miSeq_24.npz"),
373+
"miseq-28": os.path.join(os.path.dirname(__file__), "profiles/miSeq_28.npz"),
374+
"miseq-32": os.path.join(os.path.dirname(__file__), "profiles/miSeq_32.npz"),
375+
"miseq-36": os.path.join(os.path.dirname(__file__), "profiles/miSeq_36.npz"),
376+
"nextseq": os.path.join(os.path.dirname(__file__), "profiles/nextSeq.npz"),
377+
}
378+
366379
if fragment_length is not None and fragment_length_sd is not None:
367380
logger.info(
368381
f"Using custom fragment length {fragment_length} and default fragment length sd {fragment_length_sd}"
@@ -379,12 +392,8 @@ def load_error_model(mode, seed, model, fragment_length, fragment_length_sd):
379392
if model is None:
380393
logger.error("--model is required in --mode kde")
381394
sys.exit(1)
382-
elif model.lower() == "hiseq":
383-
npz = os.path.join(os.path.dirname(__file__), "profiles/HiSeq")
384-
elif model.lower() == "novaseq":
385-
npz = os.path.join(os.path.dirname(__file__), "profiles/NovaSeq")
386-
elif model.lower() == "miseq":
387-
npz = os.path.join(os.path.dirname(__file__), "profiles/MiSeq")
395+
elif model in precomputed_error_models:
396+
npz = precomputed_error_models[model]
388397
else:
389398
npz = model
390399
err_mod = kde.KDErrorModel(npz, fragment_length, fragment_length_sd)

Diff for: iss/profiles/MiSeq

-912 KB
Binary file not shown.

Diff for: iss/profiles/miSeq_0.npz

606 KB
Binary file not shown.

Diff for: iss/profiles/miSeq_20.npz

511 KB
Binary file not shown.

Diff for: iss/profiles/miSeq_24.npz

508 KB
Binary file not shown.

Diff for: iss/profiles/miSeq_28.npz

499 KB
Binary file not shown.

Diff for: iss/profiles/miSeq_32.npz

336 KB
Binary file not shown.

Diff for: iss/profiles/miSeq_36.npz

310 KB
Binary file not shown.

Diff for: iss/profiles/nextSeq.npz

386 KB
Binary file not shown.

0 commit comments

Comments
 (0)