MATLAB scripts

All scripts can be downloaded from the following .zip file: Discrete_DNA_minicircles.zip.

Energy_min.m

  Inputs   bBDNA initial guesses, name: Initial_guesses/‹seq_name›_guess‹guess_nb›.txt
  Parameters   model for DNA:   models = "cgDNAmin", "cgDNA+min" or ["cgDNAmin","cgDNA+min"]
  closure assumption:   boundaries = "NCC", "PC" or ["NCC","PC"]
  sequence:  seq:        the sequence
      seq_name:      the name of the sequence
      range_guesses:   list of ‹guess_nb›
  Outputs   3D views of solutions, name: Results/3D_views/‹seq_name›_3Dsol‹guess_nb›_‹model›.fig
  2D plots of solutions, name: Results/2D_plots/‹seq_name›_2Dsol‹guess_nb›_‹model›.fig
  MATLAB variables, name: Results/Variables/‹seq_name›_sol‹guess_nb›_‹model›.mat

The scripts then runs the discrete energy minimization for all combinations of models and boundaries.
The initial guesses are read from the "Initial_guesses" folder.
The algorithm outputs the solutions in the "Results/3D_views", "Results/2D_plots", "Results/Variables" subfolders.

The codes relative to each combination of model and closure assumption can be found in the "‹boundary›‹model›" subfolder.
The function that runs the minimization is the find_min_e function and the function to compute the energy, its gradient and Hessian is discrete_dna_penalty_en_grad_hess. The definitions of both funcitons can be found in the .m files with the corresponding names.

Visualize_solution.m

  Inputs   cgDNAmin solution, name: Results/Variables/‹seq_name›_sol‹guess_nb›_‹model›.mat
  Parameters   model for DNA:   models = "cgDNAmin" or "cgDNA+min"
  closure assumption:   boundaries = "NCC" or "PC"
  sequence:  seq:        the sequence
      seq_name:      the name of the sequence
      range_guesses:   list of ‹guess_nb›
  chose figures to save:  guess_view:    3D view of the initial guess
            solution_view:  3D view of the solution
            plot_coord:    2D plots of coordinates
            plot_diff:    2D plots of the difference groundstate - circle shape
  Outputs
  (if chosen)
  3D views of initial guess, name: Results/3D_views/‹seq_name›_guess‹guess_nb›_‹model›.png
  3D views of solution, name: Results/3D_views/‹seq_name›_3Dsol‹guess_nb›_‹model›.png
  2D plots of solution, name: Results/2D_plots/‹seq_name›_2Dsol‹guess_nb›_‹model›.png

  In the case cgDNA+min: 2 different plots for cgDNA and phosphate coordinates:
Results/2D_plots/‹seq_name›_2Dsol‹guess_nb›_‹model›_cgDNA-coord.png
Results/2D_plots/‹seq_name›_2Dsol‹guess_nb›_‹model›_Pho-coord.png
  2D plots of difference, name: Results/2D_plots/‹seq_name›_2Ddiff‹guess_nb›_‹model›.png

  In the case cgDNA+min: 2 different plots for cgDNA and phosphate coordinates:
Results/2D_plots/‹seq_name›_2Ddiff‹guess_nb›_‹model›_cgDNA-coord.png
Results/2D_plots/‹seq_name›_2Ddiff‹guess_nb›_‹model›_Pho-coord.png

The script reads the stored variables of the computed solution and creates the figures. The bBDNA software can be found on the LVCMM software page: link.