Skip to content

Commit

Permalink
Merge pull request #249 from HadrienG/nextSeq-miSeq-error-models
Browse files Browse the repository at this point in the history
New MiSeq and NextSeq error models
  • Loading branch information
HadrienG authored Feb 13, 2024
2 parents e8ff9ca + cac4365 commit cd714b1
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions iss/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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)
Expand Down
Binary file added iss/profiles/miSeq_0.npz
Binary file not shown.
Binary file added iss/profiles/miSeq_20.npz
Binary file not shown.
Binary file added iss/profiles/miSeq_24.npz
Binary file not shown.
Binary file added iss/profiles/miSeq_28.npz
Binary file not shown.
Binary file added iss/profiles/miSeq_32.npz
Binary file not shown.
Binary file added iss/profiles/miSeq_36.npz
Binary file not shown.
Binary file added iss/profiles/nextSeq.npz
Binary file not shown.

0 comments on commit cd714b1

Please sign in to comment.