-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadvanced.py
77 lines (62 loc) · 2.29 KB
/
advanced.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import dt4dds
# set up config
dt4dds.default_logging()
dt4dds.config.show_progressbars = True
# define primer sequences for PCR
primers_0 = ["ACACGACGCTCTTCCGATCT", "AGACGTGTGCTCTTCCGATCT"]
primers_2 = ["AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT", "CAAGCAGAAGACGGCATACGAGATCGTGATGTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT"]
# assign efficiency properties for amplification, here a normal distribution with std of 0.0051
dt4dds.properties.set_property_settings(
dt4dds.settings.defaults.SequenceProperties(
efficiency_distribution='normal',
efficiency_params={'loc': 1.0, 'scale': 0.0051},
)
)
#
# Electrochemical synthesis with specified coverage bias
#
# read the sequences from the provided example file
seq_list = dt4dds.tools.txt_to_seqlist("design_sequences.txt")
n_seqs = len(seq_list)
# set up the synthesis by using defaults for electrochemical synthesis
synthesis_settings = dt4dds.settings.defaults.ArraySynthesis_Twist()
# settings can be customized further when passing to the process instance
array_synthesis = dt4dds.processes.ArraySynthesis(synthesis_settings(
oligo_distribution_type='lognormal',
oligo_distribution_params={'mean': 0, 'sigma': 0.30},
))
array_synthesis.process(seq_list)
# sample with mean coverage of 200
pool = array_synthesis.sample_by_counts(200*n_seqs)
pool = dt4dds.generators.attach_primers_to_pool(pool, *primers_0)
pool.volume = 1
#
# Aging for one half-live
#
aging_settings = dt4dds.settings.defaults.Aging()
aging = dt4dds.processes.Aging(aging_settings(), n_halflives=1)
pool = aging.process(pool)
pool.volume = 1
#
# PCR with High Fidelity polymerase for 30 cycles at mean efficiency of 95%
#
pcr_settings = dt4dds.settings.defaults.PCR_HiFi()
pcr = dt4dds.processes.PCR(pcr_settings(
primers=primers_2,
template_volume=1,
volume=20,
efficiency_mean=0.95,
n_cycles=30,
))
pool = pcr.process(pool)
#
# Sequencing-by-synthesis with paired reads and sequencing coverage of 25
#
synthesis_settings = dt4dds.settings.defaults.iSeq100()
sbs_sequencing = dt4dds.processes.SBSSequencing(synthesis_settings(
output_directory=".",
n_reads=int(25*n_seqs),
read_length=150,
read_mode='paired-end',
))
sbs_sequencing.process(pool)