Exemplo n.º 1
0
	def _getActiveAtomsString(self, atoms):
		active = "      IACTAT(1)=%s"
		#active_atoms ="".join([listOfRangesToString(listToRanges(frag)) for frag in atoms])
		active_atoms = listOfRangesToString(listToRanges(self._active_atoms),
						maxlength=40,
						line_format="%5s",
						item_format="%s,",
						tuple_format="%s,%s,",
						terminator_format=None)
		return active % active_atoms
Exemplo n.º 2
0
 def _getActiveAtomsString(self, atoms):
     active = "      IACTAT(1)=%s"
     #active_atoms ="".join([listOfRangesToString(listToRanges(frag)) for frag in atoms])
     active_atoms = listOfRangesToString(listToRanges(self._active_atoms),
                                         maxlength=40,
                                         line_format="%5s",
                                         item_format="%s,",
                                         tuple_format="%s,%s,",
                                         terminator_format=None)
     return active % active_atoms
Exemplo n.º 3
0
 def test_listToRanges(self):
     list1 = range(1,10)
     self.assertEqual(util.listToRanges(list1),[(1,9)])
     list2 = [1,2] + range(5,10)
     self.assertEqual(util.listToRanges(list2),[1,2,(5,9)])
     list3 = [1,2,3] + range(5,10)
     self.assertEqual(util.listToRanges(list3),[(1,3),(5,9)])
     list4 = [1,2,4] + range(7,10)
     self.assertEqual(util.listToRanges(list4),[1,2,4,(7,9)])
     list5 = [2,3] + range(5,9) + [12,13] + range(15,20) + [31]
     self.assertEqual(util.listToRanges(list5),[2,3,(5,8),12,13,(15,19),31])
     list6 = [2,3] + range(5,9) + [12,13] + range(15,20) + [31,32]
     self.assertEqual(util.listToRanges(list6),[2,3,(5,8),12,13,(15,19),31,32])
Exemplo n.º 4
0
	def _getFMOIndat(self):
		frags = self._fragmentation.getFragments()
		indat_string = "      INDAT(1)=0\n%s"
		indat ="".join([listOfRangesToString(listToRanges(frag)) for frag in frags])
		return indat_string % indat
Exemplo n.º 5
0
 def _getFMOIndat(self):
     frags = self._fragmentation.getFragments()
     indat_string = "      INDAT(1)=0\n%s"
     indat = "".join(
         [listOfRangesToString(listToRanges(frag)) for frag in frags])
     return indat_string % indat