Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Synthesis_Modules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dnarXiv
Synthesis_Modules
Commits
4ba034e1
Commit
4ba034e1
authored
2 years ago
by
BOULLE Olivier
Browse files
Options
Downloads
Patches
Plain Diff
fix buf removing some assemblies
parent
382e55bc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eBlock_assembly_simulation.py
+8
-2
8 additions, 2 deletions
eBlock_assembly_simulation.py
with
8 additions
and
2 deletions
eBlock_assembly_simulation.py
+
8
−
2
View file @
4ba034e1
...
...
@@ -80,6 +80,10 @@ def assemble_blocks_simulation(eBlocks_list: list, nbr_mol: int) -> dict:
for
block
in
eBlocks_list
[
1
:]:
last_overhang
=
current_assembly
[
-
overhang_size
:]
if
block
[:
overhang_size
]
!=
last_overhang
:
print
(
"
error assembly simulation, overhangs not compatibles
"
,
last_overhang
,
block
[
-
overhang_size
:])
exit
(
1
)
overhang_link_proba
=
float
(
overhang_assembly_stats_dict
[
last_overhang
])
if
random
.
random
()
<=
overhang_link_proba
:
# chance to succeed overhang linking
...
...
@@ -91,6 +95,7 @@ def assemble_blocks_simulation(eBlocks_list: list, nbr_mol: int) -> dict:
# add the assembly to the dict
assembly_dict
[
"
molecule_
"
+
str
(
mol_index
)]
=
current_assembly
mol_index
+=
1
return
assembly_dict
...
...
@@ -146,7 +151,8 @@ def eBlocks_assembly(input_path: str, output_path: str, nbr_mol: int) -> None:
# simulate bsaI digestion
blocks_list
=
digest_bsaI
(
blocks_list
)
# simulation assembly by overhangs, fatal error if overhangs are not compatibles for successive blocks
assembly_dict
=
assemble_blocks
(
blocks_list
)
#assembly_dict = assemble_blocks(blocks_list)
assembly_dict
=
assemble_blocks_simulation
(
blocks_list
,
nbr_mol
)
# save the assemblies into file
dfr
.
save_dict_to_fasta
(
assembly_dict
,
output_path
)
...
...
@@ -156,7 +162,7 @@ def container_assembly(input_dir_path, output_dir_path, nbr_mol):
for
filename
in
os
.
listdir
(
input_dir_path
):
file_path
=
os
.
path
.
join
(
input_dir_path
,
filename
)
if
os
.
path
.
isdir
(
file_path
):
input_file
=
file_path
+
"
/5_blocks_buffer.fasta
"
output_file
=
os
.
path
.
join
(
output_dir_path
,
filename
+
"
.fasta
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment