Comments (5)
Yeah DNACauldron was made to catch quirks such as palyndromic overhangs and be very vocal and stubborn about them.
Just thinking out loud, but I can't be certain that max_constructs=1
will return the valid construct every time (although it could be possible - might depend on how networkx lists cycles in a graph).
I think your best shot (most explicit and robust) would be to simply inspect the constructs returned:
def pick_the_one_valid_record(records, expected_parts_list):
for record in records:
parts_list = [f.qualifiers["source"] for f in record.features if "source" in f.qualifiers]
if parts_list == expected_parts_list:
return record
records = # ... compute the records based on your assembly
valid_record = pick_the_one_valid_record(records, expected_parts_list)
There might also be a way to do this through the DnaCauldron API (using mix.compute_circular_assemblies
with fragments_set_filter=
) but not sure you want to go there (and it won't work with assembly plans)/
from dnacauldron.
In my case, I'm performing many simple GG assemblies with a known number of parts and a vector backbone. I've designed overhangs such that the only valid record is the one that includes all the parts. That code above solves my issue. Thanks again!
from dnacauldron.
Many thanks for the quick response! This gets the records I want. Excuse the naive question here, but now that I've filtered down to valid records, how can I filter down the simulation object I use to write the report? Following the workflow in the docs:
simulation=assembly.simulate(sequence_repository=repository)
# valid record picking here
# something else here
# show stats
simulation.compute_summary_dataframe()
# Write output
report_writer = dc.AssemblyReportWriter(
include_fragment_plots='on_error',
include_assembly_plots=True,
include_mix_graphs=True,
include_part_plots=False,
include_pdf_report=True
)
simulation.write_report(
target="output-group1",
report_writer=report_writer,
)
from dnacauldron.
Nevermind. I think I answered my own question. Simply replacing the construct_records with a single element list of valid records does the trick.
simulation.construct_records=[valid_record]
from dnacauldron.
Thanks for posting the code. What do you have in mind for valid record picking? One option I can think of is filtering by expected length (maybe using the sizes of the valid fragments, i.e. the ones with 2 overhangs and no enzyme sites), the other option is checking for the presence of exactly one "From X" etc feature annotation from each part.
from dnacauldron.
Related Issues (15)
- problem with snapgene_reader HOT 3
- Linear assemblies? HOT 3
- annotations crossing overhangs lost HOT 7
- Choosing enzyme in AssemblyPlan.from_spreadsheet()
- Check parts assembling into enzyme sites
- pdf_reports required but not installed by pip HOT 1
- The tutorial uses parts as keyword argument for SequenceRepository but now its collections as dict of dict HOT 1
- Annotating features with qualifiers HOT 1
- Purpose of OligoPairAnnealing class (oligo_annealing method in assembly plan) HOT 2
- Assembling fragments digested by different enzymes HOT 5
- Test fails with Biopython v1.79 HOT 1
- example with ladders HOT 1
- TypeError: StickyEndSeq.reverse_complement() got an unexpected keyword argument 'inplace' HOT 1
- Unwanted case-sensitivity when indexing fragment against source record HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnacauldron.