Example #1
0
 def _init_design(self) -> Structure:
     """ convert into nanodesign structure"""
     converter = Converter()
     converter.modify = True
     converter.read_cadnano_file(self.json, None, self.seq)
     converter.dna_structure.compute_aux_data()
     return converter.dna_structure
Example #2
0
    def _create_hps_modifications(self) -> Tuple[List, List]:
        """ create a list of all modified cadnano bases positions."""
        # TODO: implement without reusing converter
        converter = Converter()
        converter.modify = False
        converter.read_cadnano_file(self.json, None, self.seq)
        converter.dna_structure.compute_aux_data()
        dna_structure_del_ins = converter.dna_structure

        hps_deletions = list()
        hps_insertions = list()
        for strand in dna_structure_del_ins.strands:
            for base in strand.tour:
                if base.num_insertions != 0:
                    hps_insertions.append(_hps(base))
                elif base.num_deletions != 0:
                    hps_deletions.append(_hps(base))
        return hps_deletions, hps_insertions