@@ -394,7 +394,7 @@ def __init__(self,number,time,channel,r,u,v,basepairs,wrap):
394394 # assign constants from postion data
395395 self .n_beads = len (self .r )
396396 self .end_to_end = np .linalg .norm (self .r [- 1 ,:]- self .r [0 ,:])
397- self .n_bps = int (np .sum (self .basepairs [self .basepairs != 0 ])+ np .sum (self .wrap [self .wrap > 1 ]))
397+ self .n_bps = int (np .sum (self .basepairs [self .basepairs != 0 ])+ np .sum (self .wrap [self .wrap > 0 ]))
398398 self .end_to_end_norm = self .end_to_end / (self .n_bps * length_per_bp )
399399 # centered beads
400400 self .center_r = None
@@ -433,7 +433,7 @@ def centerBeads(self,nside=16,type='regular'):
433433 return 0
434434 self .center_r = np .zeros ((self .n_beads - 1 )* 3 ).reshape ([self .n_beads - 1 ,3 ])
435435 for i in range (self .n_beads - 1 ):
436- if (self .wrap [i ]> 1 ): # nucleosome
436+ if (self .wrap [i ]> 0 ): # nucleosome
437437 # make rotation matrix
438438 uin = np .asarray (self .u [i ,:]); vin = np .asarray (self .v [i ,:]); cross = np .cross (uin , vin )
439439 mat = np .matrix ([vin , cross , uin ]).reshape ([3 ,3 ]).T
@@ -460,7 +460,7 @@ def pairwiseNucleosomeDistance(self):
460460 except :
461461 print ('warning: this has already been run' )
462462 return
463- nucLocs = np .asarray (np .linspace (0 ,self .n_beads - 1 ,self .n_beads )[self .wrap > 1 ],dtype = 'int' )
463+ nucLocs = np .asarray (np .linspace (0 ,self .n_beads - 1 ,self .n_beads )[self .wrap > 0 ],dtype = 'int' )
464464 self .pair_dist = scipy .spatial .distance .pdist (self .center_r [nucLocs ,:])
465465
466466 # determine the reduced pairwise distances between nucleosomes
@@ -505,7 +505,7 @@ def pairwiseNucleosomeOrientation(self, cutoff=12):
505505 # do nothing
506506 pass
507507 # check orientation if within cutoff
508- nucLocs = np .asarray (np .linspace (0 ,self .n_beads - 1 ,self .n_beads )[self .wrap > 1 ],dtype = 'int' )
508+ nucLocs = np .asarray (np .linspace (0 ,self .n_beads - 1 ,self .n_beads )[self .wrap > 0 ],dtype = 'int' )
509509 ind = 0
510510 for i in range (len (nucLocs )):
511511 for j in range (i + 1 ,len (nucLocs )):
@@ -577,7 +577,7 @@ def interpolate(self):
577577 Uout , Vout , Rout = rotate_bead (self .u [i ,:], self .v [i ,:], self .r [i ,:], self .basepairs [i ], self .wrap [i ])
578578 matIn = np .matrix ([self .v [i ,:], np .cross (self .u [i ,:],self .v [i ,:]), self .u [i ,:]]).T
579579 mat = np .matrix ([Vout , np .cross (Uout ,Vout ), Uout ]).T
580- if (self .wrap [i ] > 1 ): # nucleosome
580+ if (self .wrap [i ] > 0 ): # nucleosome
581581 for n_wrap ,j in enumerate (np .linspace (summedLeftOver , np .floor (self .wrap [i ])+ summedLeftOver , int (np .floor (self .wrap [i ])))):
582582 strand1 , base , strand2 = DNAhelix (j ,v = 0 )
583583 Rin = np .asarray (nucleosome_tran [len (nucleosome_tran )- 1 - n_wrap ,:])
@@ -908,12 +908,12 @@ def __init__(self,path_to_data,time,channel):
908908 # assign constants from postion data
909909 self .n_beads = len (self .r )
910910 self .end_to_end = np .linalg .norm (self .r [- 1 ,:]- self .r [0 ,:])
911- self .n_bps = int (np .sum (self .basepairs [self .basepairs != 0 ])+ np .sum (self .wrap [self .wrap > 1 ]))
911+ self .n_bps = int (np .sum (self .basepairs [self .basepairs != 0 ])+ np .sum (self .wrap [self .wrap > 0 ]))
912912 self .end_to_end_norm = self .end_to_end / (self .n_bps * length_per_bp )
913913 # centered beads
914914 self .center_r = None
915915 # pairwise nucleosomes
916- self .n_nucs = np .sum (self .wrap > 1 )
916+ self .n_nucs = np .sum (self .wrap > 0 )
917917 self .n_pair_dist = int (scipy .special .comb (self .n_nucs ,2 ))
918918 self .pair_dist = None
919919 self .reduced_pair_dist = None
0 commit comments