diff --git a/iss/generator.py b/iss/generator.py index 7c7bc3f..90a53ca 100644 --- a/iss/generator.py +++ b/iss/generator.py @@ -374,6 +374,18 @@ def load_error_model(mode, seed, model, fragment_length, fragment_length_sd, sto logger.info("Using %s ErrorModel" % mode) + precomputed_error_models = { + "hiseq": os.path.join(os.path.dirname(__file__), "profiles/HiSeq"), + "novaseq": os.path.join(os.path.dirname(__file__), "profiles/NovaSeq"), + "miseq": os.path.join(os.path.dirname(__file__), "profiles/miSeq_0.npz"), + "miseq-20": os.path.join(os.path.dirname(__file__), "profiles/miSeq_20.npz"), + "miseq-24": os.path.join(os.path.dirname(__file__), "profiles/miSeq_24.npz"), + "miseq-28": os.path.join(os.path.dirname(__file__), "profiles/miSeq_28.npz"), + "miseq-32": os.path.join(os.path.dirname(__file__), "profiles/miSeq_32.npz"), + "miseq-36": os.path.join(os.path.dirname(__file__), "profiles/miSeq_36.npz"), + "nextseq": os.path.join(os.path.dirname(__file__), "profiles/nextSeq.npz"), + } + if fragment_length is not None and fragment_length_sd is not None: logger.info( f"Using custom fragment length {fragment_length} and default fragment length sd {fragment_length_sd}" @@ -390,12 +402,8 @@ def load_error_model(mode, seed, model, fragment_length, fragment_length_sd, sto if model is None: logger.error("--model is required in --mode kde") sys.exit(1) - elif model.lower() == "hiseq": - npz = os.path.join(os.path.dirname(__file__), "profiles/HiSeq") - elif model.lower() == "novaseq": - npz = os.path.join(os.path.dirname(__file__), "profiles/NovaSeq") - elif model.lower() == "miseq": - npz = os.path.join(os.path.dirname(__file__), "profiles/MiSeq") + elif model in precomputed_error_models: + npz = precomputed_error_models[model] else: npz = model err_mod = kde.KDErrorModel(npz, fragment_length, fragment_length_sd, store_mutations) diff --git a/iss/profiles/miSeq_0.npz b/iss/profiles/miSeq_0.npz new file mode 100644 index 0000000..e8ac899 Binary files /dev/null and b/iss/profiles/miSeq_0.npz differ diff --git a/iss/profiles/miSeq_20.npz b/iss/profiles/miSeq_20.npz new file mode 100644 index 0000000..7e10cb2 Binary files /dev/null and b/iss/profiles/miSeq_20.npz differ diff --git a/iss/profiles/miSeq_24.npz b/iss/profiles/miSeq_24.npz new file mode 100644 index 0000000..1aacdb5 Binary files /dev/null and b/iss/profiles/miSeq_24.npz differ diff --git a/iss/profiles/miSeq_28.npz b/iss/profiles/miSeq_28.npz new file mode 100644 index 0000000..0075e98 Binary files /dev/null and b/iss/profiles/miSeq_28.npz differ diff --git a/iss/profiles/miSeq_32.npz b/iss/profiles/miSeq_32.npz new file mode 100644 index 0000000..1a073f6 Binary files /dev/null and b/iss/profiles/miSeq_32.npz differ diff --git a/iss/profiles/miSeq_36.npz b/iss/profiles/miSeq_36.npz new file mode 100644 index 0000000..e1639dd Binary files /dev/null and b/iss/profiles/miSeq_36.npz differ diff --git a/iss/profiles/nextSeq.npz b/iss/profiles/nextSeq.npz new file mode 100644 index 0000000..e4478a6 Binary files /dev/null and b/iss/profiles/nextSeq.npz differ