From 00443f9d469456cc71e36f2b4178ad3c1fb1d54e Mon Sep 17 00:00:00 2001 From: Chris Maffeo <cmaffeo2@illinois.edu> Date: Thu, 6 Sep 2018 13:25:39 -0500 Subject: [PATCH] Gave vHelix reader large default dimensions; removed some print statements --- mrdna/readers/__init__.py | 2 ++ mrdna/readers/polygon_mesh.py | 2 -- mrdna/segmentmodel.py | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mrdna/readers/__init__.py b/mrdna/readers/__init__.py index 8a6110c..e430d87 100644 --- a/mrdna/readers/__init__.py +++ b/mrdna/readers/__init__.py @@ -20,6 +20,8 @@ def read_cadnano(json_file, **model_parameters): def read_vhelix(maya_file, **model_parameters): data = parse_maya_file(maya_file) segments, dsSegmentDict = convert_maya_to_segments( data ) + if 'dimensions' not in model_parameters: + model_parameters['dimensions']=(5000,5000,5000) model = SegmentModel( segments,**model_parameters ) model.set_sequence(m13seq*10) return model diff --git a/mrdna/readers/polygon_mesh.py b/mrdna/readers/polygon_mesh.py index 2ab0a00..4e2027c 100644 --- a/mrdna/readers/polygon_mesh.py +++ b/mrdna/readers/polygon_mesh.py @@ -314,10 +314,8 @@ def convert_maya_to_segments(helices): nt = 0 def add_primes(b,nt,fwd): if b.end3 is None: - if not fwd: print("3prime at {}[{},{}]".format(hn,nt,fwd)) segments[hn].add_3prime(nt,fwd) if b.end5 is None: - if not fwd: print("5prime at {}[{},{}]".format(hn,nt,fwd)) segments[hn].add_5prime(nt,fwd) for b in ordered_fwd_bases: diff --git a/mrdna/segmentmodel.py b/mrdna/segmentmodel.py index 7c7b47d..b2b4ef8 100644 --- a/mrdna/segmentmodel.py +++ b/mrdna/segmentmodel.py @@ -905,6 +905,7 @@ class DoubleStrandedSegment(Segment): ## Real work def _connect_ends(self, end1, end2, type_, force_connection): + debug = False ## TODO remove self? ## validate the input for end in (end1, end2): @@ -914,10 +915,10 @@ class DoubleStrandedSegment(Segment): ## Remove other connections involving these points if end1.connection is not None: - print("WARNING: reconnecting {}".format(end1)) + if debug: print("WARNING: reconnecting {}".format(end1)) end1.connection.delete() if end2.connection is not None: - print("WARNING: reconnecting {}".format(end2)) + if debug: print("WARNING: reconnecting {}".format(end2)) end2.connection.delete() ## Create and add connection @@ -1133,12 +1134,14 @@ class Strand(Group): self.children = self.strand_segments = [] self.segname = segname self.is_circular = is_circular + self.debug = False ## TODO disambiguate names of functions def add_dna(self, segment, start, end, is_fwd): """ start/end are given as nt """ if np.abs(start-end) <= 0.9: - print( "WARNING: segment constructed with a very small number of nts ({})".format(np.abs(start-end)) ) + if self.debug: + print( "WARNING: segment constructed with a very small number of nts ({})".format(np.abs(start-end)) ) # import pdb # pdb.set_trace() for s in self.strand_segments: -- GitLab