segmentmodel module

Contents

segmentmodel module#

exception mrdna.segmentmodel.CircularDnaError[source]#

Bases: Exception

exception mrdna.segmentmodel.ParticleNotConnectedError[source]#

Bases: Exception

class mrdna.segmentmodel.Location(container, address, type_, on_fwd_strand=True)[source]#

Bases: object

Site for connection within an object

__init__(container, address, type_, on_fwd_strand=True)[source]#
get_connected_location()[source]#
set_connection(connection, is_3prime_side_of_connection)[source]#
get_nt_pos()[source]#
delete()[source]#
class mrdna.segmentmodel.Connection(A, B, type_=None)[source]#

Bases: object

Abstract base class for connection between two elements

__init__(A, B, type_=None)[source]#
other(location)[source]#
delete()[source]#
class mrdna.segmentmodel.ConnectableElement(connection_locations=None, connections=None)[source]#

Bases: object

Abstract base class

__init__(connection_locations=None, connections=None)[source]#
get_locations(type_=None, exclude=())[source]#
get_location_at(address, on_fwd_strand=True, new_type=None)[source]#
get_connections_and_locations(connection_type=None, exclude=())[source]#

Returns a list with each entry of the form: connection, location_in_self, location_in_other

class mrdna.segmentmodel.SegmentParticle(type_, position, name='A', **kwargs)[source]#

Bases: PointParticle

__init__(type_, position, name='A', **kwargs)[source]#
get_intrahelical_above(all_types=True)[source]#

Returns bead directly above self

get_intrahelical_below(all_types=True)[source]#

Returns bead directly below self

make_intrahelical_neighbor(b)[source]#
conceptual_get_position(context)[source]#

context: object

Q: does this function do too much? Danger of mixing return values

Q: does context describe the system or present an argument?

get_nt_position(seg, near_address=None)[source]#

Returns the “address” of the nucleotide relative to seg in nucleotides, taking the shortest (intrahelical) contour length route to seg

get_contour_position_legacy(seg, address=None)[source]#

(Deprecated) Get contour position of a bead relative to some segment (traveling through intrahelical and maybe sscrossover connections). For circular constructs, there may be multiple equidistant paths to the bead; in that case, whichever position is nearest to the optional address argument will be selected, if it is provided

get_contour_position(seg, address=None)[source]#

Get contour position of a bead relative to some segment (traveling through intrahelical and maybe sscrossover connections). For circular constructs, there may be multiple equidistant paths to the bead; in that case, whichever position is nearest to the optional address argument will be selected, if it is provided

combine(other)[source]#
update_position(contour_position)[source]#
class mrdna.segmentmodel.Segment(name, num_nt, start_position=None, end_position=None, segment_model=None, resolution=None, **kwargs)[source]#

Bases: ConnectableElement, Group

Base class that describes a segment of DNA. When built from cadnano models, should not span helices

dsDNA_particle = <<class 'arbdmodel.ParticleType'> D>#
orientation_particle = <<class 'arbdmodel.ParticleType'> O>#
orientation_bond = <arbdmodel.interactions.HarmonicBond object>#
ssDNA_particle = <<class 'arbdmodel.ParticleType'> S>#
__init__(name, num_nt, start_position=None, end_position=None, segment_model=None, resolution=None, **kwargs)[source]#
set_splines(contours, coords)[source]#
set_orientation_splines(contours, quaternions)[source]#
get_center()[source]#
get_bounding_box(num_points=3)[source]#
get_location_at_nt(nt, on_fwd_strand=True, new_type=None)[source]#
insert_dna(at_nt: int, num_nt: int, seq=())[source]#
remove_dna(first_nt: int, last_nt: int, remove_locations: bool = False)[source]#

Removes nucleotides between first_nt and last_nt, inclusive

delete()[source]#
translate(translation_vector, position_filter=None, contour_filter=None)[source]#
rotate(rotation_matrix, about=None, position_filter=None, contour_filter=None)[source]#
clear_all()[source]#
contour_to_nt_pos(contour_pos, round_nt=False)[source]#
nt_pos_to_contour(nt_pos)[source]#
contour_to_position(s)[source]#
contour_to_tangent(s)[source]#
contour_to_orientation(s)[source]#
get_contour_sorted_connections_and_locations(type_)[source]#
randomize_unset_sequence()[source]#
assign_unset_sequence(fill_sequence='T')[source]#
add_location(nt, type_, on_fwd_strand=True)[source]#
add_nick(nt, on_fwd_strand=True)[source]#
add_5prime(nt, on_fwd_strand=True)[source]#
add_3prime(nt, on_fwd_strand=True)[source]#
get_3prime_locations()[source]#
get_5prime_locations()[source]#
get_blunt_DNA_ends()[source]#
iterate_connections_and_locations(reverse=False)[source]#
get_strand_segment(nt_pos, is_fwd, move_at_least=0.5)[source]#

Walks through locations, checking for crossovers

get_nearest_bead(contour_position)[source]#
get_all_consecutive_beads(number)[source]#
class mrdna.segmentmodel.DoubleStrandedSegment(name, num_bp, start_position=array([0, 0, 0]), end_position=None, segment_model=None, local_twist=False, num_turns=None, start_orientation=None, twist_persistence_length=90, persistence_length=50, **kwargs)[source]#

Bases: Segment

Class that describes a segment of ssDNA. When built from cadnano models, should not span helices

__init__(name, num_bp, start_position=array([0, 0, 0]), end_position=None, segment_model=None, local_twist=False, num_turns=None, start_orientation=None, twist_persistence_length=90, persistence_length=50, **kwargs)[source]#
connect_start5(end3, type_='intrahelical', force_connection=False)[source]#
connect_start3(end5, type_='intrahelical', force_connection=False)[source]#
connect_end3(end5, type_='intrahelical', force_connection=False)[source]#
connect_end5(end3, type_='intrahelical', force_connection=False)[source]#
add_crossover(nt, other, other_nt, strands_fwd=(True, False), nt_on_5prime=True, type_='crossover')[source]#

Add a crossover between two helices

class mrdna.segmentmodel.SingleStrandedSegment(name, num_nt, start_position=None, end_position=None, segment_model=None, **kwargs)[source]#

Bases: Segment

Class that describes a segment of ssDNA. When built from cadnano models, should not span helices

__init__(name, num_nt, start_position=None, end_position=None, segment_model=None, **kwargs)[source]#
connect_end3(end5, force_connection=False)[source]#
connect_start5(end3, force_connection=False)[source]#
add_crossover(nt, other, other_nt, strands_fwd=(True, False), nt_on_5prime=True, type_='sscrossover')[source]#

Add a crossover between two helices

class mrdna.segmentmodel.StrandInSegment(segment, start, end, is_fwd)[source]#

Bases: Group

Represents a piece of an ssDNA strand within a segment

__init__(segment, start, end, is_fwd)[source]#

start/end should be provided expressed in nt coordinates, is_fwd tuples

get_sequence()[source]#

return 5-to-3

get_contour_points()[source]#
get_nucleotide(idx)[source]#

idx expressed as nt coordinate within segment

class mrdna.segmentmodel.Strand(segname=None, is_circular=False)[source]#

Bases: Group

Represents an entire ssDNA strand from 5’ to 3’ as it routes through segments

__init__(segname=None, is_circular=False)[source]#
add_dna(segment, start, end, is_fwd)[source]#

start/end are given as nt

set_sequence(sequence)[source]#
generate_atomic_model(scale, first_atomic_index)[source]#
generate_oxdna_model()[source]#
get_sequence()[source]#
get_nt_positions_orientations(bp_offset=(5, 0, 0))[source]#
class mrdna.segmentmodel.SegmentModel(segments=[], local_twist=True, escapable_twist=True, max_basepairs_per_bead=7, max_nucleotides_per_bead=4, origin=None, dimensions=(5000, 5000, 5000), temperature=291, timestep=5e-05, cutoff=50, decomp_period=10000, pairlistDistance=None, integrator='Brown', debye_length=None, hj_equilibrium_angle=0)[source]#

Bases: ArbdModel

__init__(segments=[], local_twist=True, escapable_twist=True, max_basepairs_per_bead=7, max_nucleotides_per_bead=4, origin=None, dimensions=(5000, 5000, 5000), temperature=291, timestep=5e-05, cutoff=50, decomp_period=10000, pairlistDistance=None, integrator='Brown', debye_length=None, hj_equilibrium_angle=0)[source]#
set_debye_length(value)[source]#
get_connections(type_=None, exclude=())[source]#

Find all connections in model, without double-counting

get_bond_potential(kSpring, d, correct_geometry=False)[source]#
get_angle_potential(kSpring, d)[source]#
get_dihedral_potential(kSpring, d, max_potential=None)[source]#
extend(other, copy=False, include_strands=True)[source]#
update(segment, copy=False)[source]#
clear_atomic()[source]#
clear_beads()[source]#
translate(translation_vector, position_filter=None)[source]#
rotate(rotation_matrix, about=None, position_filter=None)[source]#
get_center(include_ssdna=False)[source]#
update_splines(bead_coordinates)[source]#

Set new function for each segments functions contour_to_position and contour_to_orientation

update_reader_list_coordinates()[source]#
get_segments_matching(pattern)[source]#

Returns a list of all segments that match the regular expression ‘pattern’

get_crossovers_at_ends()[source]#

Return a list of all “regular” crossovers where both sides of the crossover exist at the start or end of a segment

convert_crossover_to_intrahelical(crossover)[source]#
get_blunt_DNA_ends()[source]#
convert_crossovers_at_ends_beyond_cutoff_to_intrahelical(cutoff)[source]#
convert_crossovers(new_connection_type=None, position_filter=None, terminal_only=False)[source]#
convert_crossovers_to_intrahelical(position_filter=None, terminal_only=False)[source]#
convert_close_crossovers_to_intrahelical(cutoff)[source]#
generate_bead_model(max_basepairs_per_bead=7, max_nucleotides_per_bead=4, local_twist=False, escapable_twist=True, sequence_dependent=False, one_bead_per_monomer=None, version=None)[source]#
walk_through_helices(direction=1, processed_segments=None)[source]#

First and last segment should be same for circular helices

get_consecutive_crossovers()[source]#
set_sequence(sequence, force=True, fill_sequence='random')[source]#
write_atomic_bp_restraints(output_name, spring_constant=1.0)[source]#
write_atomic_ENM(output_name, lattice_type=None, interhelical_bonds=True)[source]#
get_bounding_box(num_points=3)[source]#
get_bounding_box_center(num_points=3)[source]#
dimensions_from_structure(padding_factor=1.5, isotropic=False)[source]#
add_grid_potential(grid_file, scale=1, per_nucleotide=True, filter_fn=None)[source]#
generate_atomic_model(scale=1)[source]#
write_namd_configuration(output_name, minimization_steps=4800, num_steps=1000000.0, output_directory='output', update_dimensions=True, extrabonds=True)[source]#
atomic_simulate(output_name, output_directory='output', dry_run=False, namd2=None, log_file=None, num_procs=None, gpu=None, minimization_steps=4800, num_steps=1000000.0, write_pqr=False, copy_ff_from=PosixPath('/usr/local/Caskroom/miniconda/base/envs/pybd/lib/python3.9/site-packages/arbdmodel-0.0.0-py3.9.egg/arbdmodel/resources/charmm36.nbfix'))[source]#
generate_oxdna_model(scale=1)[source]#
simulate_oxdna(output_name, directory='.', output_directory='output', topology=None, configuration=None, oxDNA=None, gpu=0, **oxdna_args)[source]#
vmd_tube_tcl(file_name='drawTubes.tcl')[source]#
vmd_cylinder_tcl(file_name='drawCylinders.tcl')[source]#