GithubHelp home page GithubHelp logo

Comments (5)

Zulko avatar Zulko commented on July 4, 2024 1

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.

stephenturner avatar stephenturner commented on July 4, 2024 1

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.

stephenturner avatar stephenturner commented on July 4, 2024

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.

stephenturner avatar stephenturner commented on July 4, 2024

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.

veghp avatar veghp commented on July 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.