OSCR

How human-derived brain organoids are built differently from brain organoids derived from genetically-close relatives: a multi-scale hypothesis.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Fortran · 857 lines · 19 KB · CC-BY-4.0

  1. ! Author: Sarthak Gupta
  2. ! Contact : [email hidden]
  3. ! This code takes equillibrated system
  4. ! Chromatin+Shell+Linkages+Crosslinkers
  5. ! and compress the system with parallel plates
  6. ! at tunable compression rates and strains
  7. ! Algorithim for compression
  8. ! 1) Read the coordinates from the files
  9. ! 2) Set the boundaries at the top most and bottom most particle
  10. ! 3)
  11. module combination
  12. implicit none
  13. integer,parameter :: NC=5000 ! No. of monomers in the polymer
  14. integer,parameter :: N_S=5000*2 ! No. of monomers in the shell
  15. integer,parameter :: Total=NC+N_S
  16. !integer,parameter :: NL=250 ! No. of Linkages
  17. !integer,parameter :: Num_C=2500 ! No. of Linkages
  18. Real*8,allocatable,dimension(:) :: R_O_Chromatin
  19. integer,allocatable,dimension(:) :: E1_CH,E2_CH
  20. Real*8,dimension(Total) :: X,Y,Z
  21. Real*8,dimension(Total) :: FX,FY,FZ
  22. Integer,dimension(Total,Total) :: Flag_Ignore
  23. integer :: N,NSE
  24. integer,allocatable,dimension(:) :: E1,E2
  25. integer,allocatable,dimension(:) :: E1_new,E2_new
  26. real*8,allocatable,dimension(:) :: R_O
  27. integer :: iset,seed,Total_Step,interval,step
  28. Real*8 :: del,mu,Diff
  29. Real*8 :: Temp_Seed,rrr
  30. Real*8 :: K_connect,sigma,Eq_length,K_Soft,sigma_Shell
  31. integer, parameter :: L=60 ! Length of one side cube box
  32. Real*8 :: Cell_Length,XCELL,YCELL,ZCELL
  33. integer :: NXCELL,NYCELL,NZCELL
  34. integer :: NCELL
  35. integer,dimension(:,:),allocatable :: neigh
  36. integer,dimension(:),allocatable :: HOC,LLIST
  37. integer :: HBOX
  38. Real*8 :: Upper_Plate_Ini,Upper_Plate_Final
  39. Real*8 :: Lower_Plate_Ini,Lower_Plate_Final
  40. Real*8 :: Upper_Plate_Move,Lower_Plate_Move
  41. Real*8 :: V_compress
  42. Real*8,dimension(Total) :: Fz_Compress_UP,Fz_Compress_Lower
  43. Real*8 :: Strain_rate,time
  44. integer :: NL,Num_C,F_M,Ens
  45. Character*20 :: NL_Ch,Num_C_Ch,F_M_Ch, Ens_Ch
  46. Character*50 :: filename1,filename2,filename3,filename4
  47. Character*50 :: filename5,filename6,filename7,filename8
  48. character(len=20), dimension(:), allocatable :: args
  49. integer :: num_args
  50. integer :: TC,NF
  51. Real*8 :: Strain,PIE,Energy_Shell,Energy_Chromatin,Energy_Linkage,Energy_CrossLinker,Energy_System
  52. Real*8 :: Plate_Diff_Ini
  53. end module combination
  54. program join
  55. use combination
  56. implicit none
  57. integer :: I,J
  58. real*8, external :: gauss
  59. real*8 :: ran2
  60. num_args = command_argument_count()
  61. allocate(args(num_args))
  62. do i = 1, num_args
  63. call get_command_argument(i,args(i))
  64. end do
  65. READ(args(1),*)NL
  66. READ(args(2),*)Num_C
  67. READ(args(3),*)Ens !then, convert them to REALs
  68. allocate(R_O_Chromatin(NL+Num_C),E1_CH(NL+Num_C),E2_CH(NL+Num_C))
  69. Call naming
  70. Call read_coordinates
  71. !_________________ Dynamics _________________________!
  72. !Strain_rate=5.d0/(10**(5)) ! Strain rate
  73. Strain=-0.20 ! Strain
  74. Total_Step=10000000
  75. del=0.0001 ! dt for the system
  76. mu=1.d0 ! Mobility Constant
  77. Diff=1.d0 ! Diffusion Constant
  78. NF=1000 ! Number of frames recorded
  79. interval=int(Total_Step/NF)
  80. PIE=4.D0*DATAN(1.D0) !Just pie, you know.
  81. !time= (5.d0/(10**(6)))/(Strain_rate)
  82. !TC=nint(time*10)
  83. ! print*,interval,TC
  84. !____________________________________________________!
  85. !________________ Seed ________________________!
  86. Call init_random_seed()
  87. Call Random_number(Temp_Seed)
  88. Seed=-987745878!Temp_Seed*(-10000)
  89. !____________________________________________________!
  90. !_________________ Spring ___________________________!
  91. K_connect=140.d0
  92. Eq_length=1.d0
  93. !____________________________________________________!
  94. !___________Soft_Repulsuion__________________________!
  95. K_Soft = K_connect*1.d0 ! No leak at this
  96. sigma =0.43089*2.d0
  97. sigma_Shell=0.43089*2.d0
  98. !____________________________________________________!
  99. !_______________Compression__________________________!
  100. Upper_Plate_Ini=maxval(Z)
  101. Lower_Plate_Ini=minval(Z)
  102. Plate_Diff_Ini=Upper_Plate_Ini-Lower_Plate_Ini
  103. Upper_Plate_Final=Upper_Plate_Ini + Strain*Plate_Diff_Ini
  104. Lower_Plate_Final=Lower_Plate_Ini - Strain*Plate_Diff_Ini
  105. V_compress=(Upper_Plate_Final-Upper_Plate_Ini)/Real(Total_Step)
  106. !print*,Upper_Plate_Ini,Upper_Plate_Final,Lower_Plate_Ini,Lower_Plate_Final
  107. !print*,(Upper_Plate_Ini-Upper_Plate_Final)/(Upper_Plate_Ini-Lower_Plate_Ini)
  108. !print*,(Lower_Plate_Final-Lower_Plate_Ini)/(Upper_Plate_Ini-Lower_Plate_Ini)
  109. Upper_Plate_Move=Upper_Plate_Ini
  110. Lower_Plate_Move=Lower_Plate_Ini
  111. !____________________________________________________!
  112. !_________________ Cell Linked Listing ___________________!
  113. Cell_Length=sigma
  114. XCELL=Cell_Length
  115. YCELL=Cell_Length
  116. ZCELL=Cell_Length
  117. NXCELL=nint(L/Cell_Length)
  118. NYCELL=NXCELL
  119. NZCELL=NYCELL
  120. NCELL=NXCELL*NYCELL*NZCELL
  121. HBOX=L/2.d0
  122. !_________________________________________________________!
  123. allocate(Neigh(0:NCELL-1,0:26))
  124. Do I=0,NCELL-1
  125. DO J=0,26
  126. Neigh(I,J)=0
  127. END Do
  128. END DO
  129. Call Neighbor
  130. allocate(HOC(0:NCELL-1),LLIST(Total))
  131. !print*,NCELL,Cell_Length,NXCELL
  132. !print*, NF,Upper_Plate_Ini,Lower_Plate_Ini,Upper_Plate_Ini-Lower_Plate_Ini
  133. iset=0 ! Initial flag setting for Gaussian random distribution function
  134. rrr=gauss(seed,iset) ! Calling function to set the flag
  135. Do step=1,Total_Step
  136. Call Sorting
  137. call Force_Calculation
  138. call update_position
  139. Upper_Plate_Move=Upper_Plate_Move + (V_compress)
  140. Lower_Plate_Move=Lower_Plate_Move - (V_compress)
  141. If(mod(step,interval)==0) then
  142. print*,step,Upper_Plate_Move,Lower_Plate_Move,1-((Upper_Plate_Move-Lower_Plate_Move)/(Upper_Plate_Ini-Lower_Plate_Ini))
  143. call Save_Pos
  144. end if
  145. End Do
  146. End Program join
  147. !********** finding out neighbours of cell ***********
  148. Subroutine Neighbor
  149. use combination
  150. implicit none
  151. integer :: icell
  152. integer :: ix,iy,iz
  153. integer :: ixx,iyy,izz
  154. integer :: j2,jcell
  155. !OPEN (102,file='neigh.dat')
  156. DO icell = 0,NCELL-1
  157. iz = int(dble(icell)/dble(NXCELL*NYCELL))
  158. iy = int(dble(icell-NXCELL*NYCELL*iz)/dble(NXCELL))
  159. ix = icell-NXCELL*NYCELL*iz-NXCELL*iy
  160. iz = iz-1 !- to find the neighbour
  161. iy = iy-1
  162. ix = ix-1
  163. DO izz = 0,2 ! neighbour cells form cube with (3*3*3)
  164. IF (iz .LT. 0) THEN ! 0,2 means 0,1,2
  165. iz = iz+NZCELL
  166. END IF
  167. IF ((iz+izz) .GT. (NZCELL-1)) THEN
  168. iz = iz-NZCELL
  169. END IF
  170. DO iyy = 0,2
  171. IF (iy .LT. 0) THEN
  172. iy = iy+NYCELL
  173. END IF
  174. IF ((iy+iyy) .GT. (NYCELL-1)) THEN
  175. iy = iy-NYCELL
  176. END IF
  177. DO ixx = 0,2
  178. IF (ix .LT. 0) THEN
  179. ix = ix+NXCELL
  180. END IF
  181. IF ((ix+ixx) .GT. (NXCELL-1)) THEN
  182. ix = ix-NXCELL
  183. END IF
  184. j2 = ixx+3*iyy+9*izz !bcz unit cell of 3 unit, so in z, pt should be multipd by 3**2 = 9
  185. jcell = (ix+ixx)+(iy+iyy)*NXCELL+(iz+izz)*NXCELL*NYCELL ! cell number, j2 is cell index
  186. neigh(icell,j2) = jcell
  187. ! WRITE(102,*)icell,j2,neigh(icell,j2)
  188. END DO !-ixx loop
  189. END DO !-iyy loop
  190. END DO !-izz loop
  191. End Do
  192. return
  193. end subroutine Neighbor
  194. !*******distribute the molecules to the cells***********!
  195. Subroutine Sorting
  196. use combination
  197. implicit none
  198. integer :: i
  199. integer :: ic
  200. integer :: icellx,icelly,icellz
  201. !IF(MOD(STEP,100).EQ.0)THEN
  202. DO I = 0,NCELL-1
  203. HOC(I) = 0
  204. END DO
  205. DO I = 1,Total
  206. !RXX(I) = RXX(I) - L*int((RXX(I)-HBOX)/HBOX)
  207. !RYY(I) = RYY(I) - L*int((RYY(I)-HBOX)/HBOX)
  208. !RZZ(I) = RZZ(I) - L*int((RZZ(I)-HBOX)/HBOX)
  209. icellx = int(X(I)/XCELL)!--x-index of cell
  210. icelly = int(Y(I)/YCELL)!--y-index of cell
  211. icellz = int(Z(I)/ZCELL)!--z-index of cell
  212. ic = icellx+icelly*NXCELL+icellz*NXCELL*NYCELL!--index of cell
  213. LLIST(I) = HOC(ic)
  214. HOC(ic) = I
  215. END DO
  216. !END IF
  217. return
  218. end subroutine Sorting
  219. subroutine Save_pos
  220. use combination
  221. implicit none
  222. integer :: I,J
  223. Do I=1,total
  224. Write(1000)X(I),Y(I),Z(I)
  225. IF(step==Total_Step) Write(2000)X(I),Y(I),Z(I)
  226. End Do
  227. return
  228. end subroutine Save_pos
  229. subroutine update_position
  230. use combination
  231. implicit none
  232. real*8, external :: gauss
  233. real*8 :: ran2
  234. integer :: I
  235. Do I=1,Total
  236. x(i)=x(i)+ mu*(FX(I))*del + ((sqrt(2.0*Diff*del))*gauss(seed,iset))
  237. y(i)=y(i)+ mu*(FY(I))*del + ((sqrt(2.0*Diff*del))*gauss(seed,iset))
  238. z(i)=z(i)+ mu*(FZ(I))*del + ((sqrt(2.0*Diff*del))*gauss(seed,iset))
  239. End Do
  240. return
  241. end subroutine update_position
  242. subroutine Force_Calculation
  243. use combination
  244. implicit none
  245. Real*8,dimension(Total) :: Fx_Har,Fy_Har,Fz_Har
  246. Real*8,dimension(Total) :: Fx_Rep,Fy_Rep,Fz_Rep
  247. integer :: i,j,Ed1,Ed2
  248. Real*8 :: xr,yr,zr,dis
  249. Real*8 :: r,const,ffx,ffy,ffz
  250. integer :: cellx,celly,cellz
  251. integer :: js,cell,jcell,M
  252. Real*8 :: X1,Y1,Z1,X2,Y2,Z2
  253. Energy_Shell=0.d0
  254. Energy_Chromatin=0.d0
  255. Energy_Linkage=0.d0
  256. Energy_CrossLinker=0.d0
  257. Do I=1,Total
  258. FX(I)=0.d0
  259. FY(I)=0.d0
  260. FZ(I)=0.d0
  261. Fx_Har(I)=0.d0
  262. Fy_Har(I)=0.d0
  263. Fz_Har(I)=0.d0
  264. Fz_Compress_UP(I)=0.d0
  265. Fz_Compress_Lower(I)=0.d0
  266. Fx_Rep(I)=0.d0
  267. Fy_Rep(I)=0.d0
  268. Fz_Rep(I)=0.d0
  269. End Do
  270. !___________ Chromatin Spring_______________!
  271. Do I=1,NC-1
  272. Ed1=E1_new(I)
  273. Ed2=E2_new(I)
  274. !print*,Ed1,Ed2,I
  275. Flag_Ignore(Ed1,Ed2)=1
  276. xr=x(Ed1)-x(Ed2)
  277. yr=y(Ed1)-y(Ed2)
  278. zr=z(Ed1)-z(Ed2)
  279. dis=sqrt(xr*xr + yr*yr + zr*zr)
  280. r=dis-Eq_length
  281. const=(-1.d0)*(K_Connect/(real(dis)))
  282. ffx=(const*r)*xr
  283. ffy=(const*r)*yr
  284. ffz=(const*r)*zr
  285. Fx_har(Ed1)=Fx_har(Ed1)+ffx
  286. Fx_har(Ed2)=Fx_har(Ed2)-ffx
  287. Fy_har(Ed1)=Fy_har(Ed1)+ffy
  288. Fy_har(Ed2)=Fy_har(Ed2)-ffy
  289. Fz_har(Ed1)=Fz_har(Ed1)+ffz
  290. Fz_har(Ed2)=Fz_har(Ed2)-ffz
  291. End Do
  292. !___________________________________________!
  293. !_________ Shell Spring ____________________!
  294. Do I=NC-1+1,NC-1+NSE
  295. Ed1=E1_new(I)
  296. Ed2=E2_new(I)
  297. !print*,Ed1,Ed2,I
  298. Flag_Ignore(Ed1,Ed2)=1
  299. xr=x(Ed1)-x(Ed2)
  300. yr=y(Ed1)-y(Ed2)
  301. zr=z(Ed1)-z(Ed2)
  302. dis=sqrt(xr*xr + yr*yr + zr*zr)
  303. r=dis-R_O(I)!r_knot
  304. const=(-1.d0)*(K_Connect/(real(dis)))
  305. ffx=(const*r)*xr
  306. ffy=(const*r)*yr
  307. ffz=(const*r)*zr
  308. Fx_har(Ed1)=Fx_har(Ed1)+ffx
  309. Fx_har(Ed2)=Fx_har(Ed2)-ffx
  310. Fy_har(Ed1)=Fy_har(Ed1)+ffy
  311. Fy_har(Ed2)=Fy_har(Ed2)-ffy
  312. Fz_har(Ed1)=Fz_har(Ed1)+ffz
  313. Fz_har(Ed2)=Fz_har(Ed2)-ffz
  314. End Do
  315. !___________________________________________!
  316. !_________ Linkage Spring ____________________!
  317. Do I=1,NL
  318. Ed1=E1_CH(I)
  319. Ed2=E2_CH(I)
  320. !print*,Ed1,Ed2,I
  321. Flag_Ignore(Ed1,Ed2)=1
  322. xr=x(Ed1)-x(Ed2)
  323. yr=y(Ed1)-y(Ed2)
  324. zr=z(Ed1)-z(Ed2)
  325. dis=sqrt(xr*xr + yr*yr + zr*zr)
  326. r=dis-R_O_Chromatin(I)!r_knot
  327. const=(-1.d0)*(K_Connect/(real(dis)))
  328. ffx=(const*r)*xr
  329. ffy=(const*r)*yr
  330. ffz=(const*r)*zr
  331. Fx_har(Ed1)=Fx_har(Ed1)+ffx
  332. Fx_har(Ed2)=Fx_har(Ed2)-ffx
  333. Fy_har(Ed1)=Fy_har(Ed1)+ffy
  334. Fy_har(Ed2)=Fy_har(Ed2)-ffy
  335. Fz_har(Ed1)=Fz_har(Ed1)+ffz
  336. Fz_har(Ed2)=Fz_har(Ed2)-ffz
  337. End Do
  338. !___________________________________________!
  339. !_________ Cross-Linker Spring ____________________!
  340. Do I=Nl+1,NL+Num_C
  341. Ed1=E1_CH(I)
  342. Ed2=E2_CH(I)
  343. !print*,Ed1,Ed2,I
  344. Flag_Ignore(Ed1,Ed2)=1
  345. xr=x(Ed1)-x(Ed2)
  346. yr=y(Ed1)-y(Ed2)
  347. zr=z(Ed1)-z(Ed2)
  348. dis=sqrt(xr*xr + yr*yr + zr*zr)
  349. r=dis-R_O_Chromatin(I)!r_knot
  350. const=(-1.d0)*(K_Connect/(real(dis)))
  351. ffx=(const*r)*xr
  352. ffy=(const*r)*yr
  353. ffz=(const*r)*zr
  354. Fx_har(Ed1)=Fx_har(Ed1)+ffx
  355. Fx_har(Ed2)=Fx_har(Ed2)-ffx
  356. Fy_har(Ed1)=Fy_har(Ed1)+ffy
  357. Fy_har(Ed2)=Fy_har(Ed2)-ffy
  358. Fz_har(Ed1)=Fz_har(Ed1)+ffz
  359. Fz_har(Ed2)=Fz_har(Ed2)-ffz
  360. Energy_CrossLinker=Energy_CrossLinker+(0.5*K_Connect*r*r)
  361. End Do
  362. !___________________________________________!
  363. !_________ Compression Force _______________!
  364. Do I=NC+1,Total
  365. IF(Z(I).GT.Upper_Plate_Move) Then
  366. zr=Z(I)-Upper_Plate_Move
  367. dis=sqrt(zr*zr)
  368. r=dis
  369. const=(-1.d0)*(K_Connect/(real(dis)))
  370. ffz=(const*r)*zr
  371. Fz_Compress_UP(I)=Fz_Compress_UP(I)+ffz
  372. End IF
  373. IF(Z(I).LT.Lower_Plate_Move) Then
  374. zr=Z(I)-Lower_Plate_Move
  375. dis=sqrt(zr*zr)
  376. r=dis
  377. const=(-1.d0)*(K_Connect/(real(dis)))
  378. ffz=(const*r)*zr
  379. Fz_Compress_Lower(I)=Fz_Compress_Lower(I)+ffz
  380. End IF
  381. End Do
  382. !___________________________________________!
  383. ! Purely repulsive soft potential for all the monomers which
  384. ! doesn't have any other interactions.
  385. DO I = 1,Total
  386. X1 = X(I)
  387. Y1 = Y(I)
  388. Z1 = Z(I)
  389. cellx = int(X(I)/XCELL) !--x-index of cell
  390. celly = int(Y(I)/YCELL) !--y-index of cell
  391. cellz = int(Z(I)/ZCELL) !--z-index of cell
  392. cell = cellx + celly*NXCELL + cellz*NXCELL*NYCELL!--index of cell having this catalytic particle
  393. !print*,step,I,CEll,X(I),Y(I),Z(I)
  394. DO M = 0,26
  395. jcell = neigh(cell,M)
  396. Js = HOC(jcell) !--Head particle of a cell
  397. DO WHILE (Js .NE. 0)
  398. IF(Flag_Ignore(i,js)==1) then ! Ignore this interaction, if there is another interaction
  399. Else
  400. X2 = X(js)
  401. Y2 = Y(js)
  402. Z2 = Z(js)
  403. xr=X1-X2
  404. yr=Y1-Y2
  405. zr=Z1-Z2
  406. xr=xr-(L*nint(xr/L))
  407. yr=yr-(L*nint(yr/L))
  408. zr=zr-(L*nint(yr/L))
  409. dis= sqrt(xr*xr + yr*yr + zr*zr)
  410. if((dis.lt.Sigma).and.(js.gt.i)) then
  411. r=dis-Sigma
  412. const=(-1.d0)*(K_Soft/(real(dis)))
  413. ffx=(const*r)*xr
  414. ffy=(const*r)*yr
  415. ffz=(const*r)*zr
  416. fx_Rep(i)=fx_Rep(i)+ffx
  417. fx_Rep(js)=fx_Rep(js)-ffx
  418. fy_Rep(i)=fy_Rep(i)+ffy
  419. fy_Rep(js)=fy_Rep(js)-ffy
  420. fz_Rep(i)=fz_Rep(i)+ffz
  421. fz_Rep(js)=fz_Rep(js)-ffz
  422. end if !--dd.lt.cutoffsq1
  423. End IF
  424. Js = LLIST(Js) !--goto next particle of the cells
  425. END DO !--do while j .ne.0 loop
  426. END DO !--m =0,26 loop
  427. End do
  428. !_______________________________________________________________________________________________!
  429. Do I=1,total
  430. FX(I)=FX(I)+Fx_Har(I)+Fx_Rep(I)
  431. FY(I)=FY(I)+Fy_Har(I)+Fy_Rep(I)
  432. FZ(I)=FZ(I)+Fz_Har(I)+Fz_Rep(I)+Fz_Compress_UP(I)+Fz_Compress_Lower(I)
  433. End Do
  434. return
  435. end subroutine Force_Calculation
  436. subroutine read_coordinates
  437. use combination
  438. implicit none
  439. integer :: I,J,K
  440. Real*8 :: xr,yr,zr,dis
  441. Integer :: Ed1,Ed2
  442. real*8 :: xcm_shell,ycm_shell,zcm_shell
  443. real*8 :: xcm_chromatin,ycm_chromatin,zcm_chromatin
  444. Do I=1,Total
  445. read(100) X(I),Y(I),Z(I)
  446. !print*,i,X(I),Y(I),Z(I)
  447. End Do
  448. xcm_shell=0.d0
  449. ycm_shell=0.d0
  450. zcm_shell=0.d0
  451. Do I=1,NC
  452. xcm_shell=xcm_shell+x(i)
  453. ycm_shell=ycm_shell+y(i)
  454. zcm_shell=zcm_shell+z(i)
  455. End Do
  456. xcm_shell=xcm_shell/real(NC)
  457. ycm_shell=ycm_shell/real(NC)
  458. zcm_shell=zcm_shell/real(NC)
  459. Do I=1,NC
  460. x(i)=x(i)-xcm_shell+(L/2.d0)
  461. y(i)=y(i)-ycm_shell+(L/2.d0)
  462. z(i)=z(i)-zcm_shell+(L/2.d0)
  463. End Do
  464. xcm_chromatin=0.d0
  465. ycm_chromatin=0.d0
  466. zcm_chromatin=0.d0
  467. Do I=NC+1,Total
  468. xcm_chromatin=xcm_chromatin+x(i)
  469. ycm_chromatin=ycm_chromatin+y(i)
  470. zcm_chromatin=zcm_chromatin+z(i)
  471. End Do
  472. xcm_chromatin=xcm_chromatin/real(N_S)
  473. ycm_chromatin=ycm_chromatin/real(N_S)
  474. zcm_chromatin=zcm_chromatin/real(N_S)
  475. Do I=NC+1,Total
  476. x(i)=x(i)-xcm_chromatin+(L/2.d0)
  477. y(i)=y(i)-ycm_chromatin+(L/2.d0)
  478. z(i)=z(i)-zcm_chromatin+(L/2.d0)
  479. End Do
  480. read(30) N,NSE
  481. allocate(E1(NSE),E2(NSE))
  482. allocate(E1_new(NSE+NC-1),E2_new(NSE+NC-1),R_O(NSE+NC-1))
  483. ! Chromatin Edges reading
  484. ! Since, its a chain of NC=5000 particles
  485. Do I=1,NC-1
  486. E1_new(I)=I
  487. E2_new(I)=I+1
  488. End do
  489. ! Shell Edges reading from the file
  490. ! Writting into the edge variables
  491. Do I=1,NSE
  492. Read(20) E1(I),E2(I)
  493. E1_new(I+NC-1)=E1(I)+NC
  494. E2_new(I+NC-1)=E2(I)+NC
  495. End do
  496. Do I=1,NSE+NC-1
  497. read(50) R_O(I)
  498. End do
  499. Do I=1,NL
  500. read(110) E1_CH(I),E2_CH(I),R_O_Chromatin(I)
  501. !if(i.le.nl) print*,i,E1_CH(I),E2_CH(I),R_O_Chromatin(I)
  502. End do
  503. Do I=1,Num_C
  504. read(120) E1_CH(NL+I),E2_CH(NL+I),R_O_Chromatin(NL+I)
  505. !if(i.le.nl) print*,i,E1_CH(I),E2_CH(I),R_O_Chromatin(I)
  506. End do
  507. Do I=1,total
  508. Do J=1,total
  509. Flag_Ignore(I,J)=0
  510. End do
  511. End Do
  512. return
  513. end subroutine read_coordinates
  514. subroutine naming
  515. use combination
  516. implicit none
  517. integer :: No_of_crosslinkers,No_of_linkers
  518. write(NL_Ch,'(i0)') NL
  519. write(Num_C_Ch,'(i0)') Num_C
  520. write(Ens_Ch,'(i0)') Ens
  521. filename1='Shell_Polymer_Equb_'//trim(adjustl(Ens_Ch))//'.dat'
  522. filename2='Shell_Edges_'//trim(adjustl(Ens_Ch))//'.dat'
  523. filename3='Shell_Info_'//trim(adjustl(Ens_Ch))//'.dat'
  524. filename5='Result_'//trim(adjustl(NL_Ch))//'_'//trim(adjustl(Num_C_Ch))//'_' &
  525. //trim(adjustl(Ens_Ch))//'.dat'
  526. filename6='Last_Frame_'//trim(adjustl(NL_Ch))//'_'//trim(adjustl(Num_C_Ch))//'_' &
  527. //trim(adjustl(Ens_Ch))//'.dat'
  528. filename7='Rest_Length_'//trim(adjustl(Ens_Ch))//'.dat'
  529. Open(unit=100,file=filename1,form="unformatted")
  530. Open(unit=20,file=filename2,form="unformatted")
  531. Open(unit=30,file=filename3,form="unformatted")
  532. Open(unit=1000,file=filename5,form="unformatted")
  533. Open(unit=2000,file=filename6,form="unformatted")
  534. Open(unit=50,file=filename7,form="unformatted")
  535. No_of_linkers=400
  536. write(NL_Ch,'(i0)') No_of_linkers
  537. No_of_crosslinkers=2500
  538. write(Num_C_Ch,'(i0)') No_of_crosslinkers
  539. filename4='Linker_'//trim(adjustl(NL_Ch))//'_'//trim(adjustl(Ens_Ch))//'.dat'
  540. filename8='Crosslinker_'//trim(adjustl(Num_C_Ch))//'_'//trim(adjustl(Ens_Ch))//'.dat'
  541. Open(unit=110,file=filename4,form="unformatted")
  542. Open(unit=120,file=filename8,form="unformatted")
  543. Return
  544. end subroutine naming
  545. FUNCTION gauss(seed,iset)
  546. implicit none
  547. integer :: seed,iset
  548. real*8 :: gauss,w_gfx
  549. real*8 :: x1,x2,ran2,fac
  550. save fac,x2
  551. w_gfx=2.0
  552. if (iset==0) then
  553. do while(w_gfx>=1.0)
  554. x1=(2.0*ran2(seed))-1.0
  555. x2=(2.0*ran2(seed))-1.0
  556. w_gfx=(x1*x1)+(x2*x2)
  557. end do
  558. fac=sqrt(-2.0*log(w_gfx)/w_gfx)
  559. gauss=x1*fac
  560. iset=1
  561. else
  562. gauss=x2*fac
  563. iset=0
  564. end if
  565. return
  566. end function gauss
  567. SUBROUTINE init_random_seed()
  568. INTEGER :: i, n, clock
  569. INTEGER, DIMENSION(:), ALLOCATABLE :: seed
  570. CALL RANDOM_SEED(size = n)
  571. ALLOCATE(seed(n))
  572. CALL SYSTEM_CLOCK(COUNT=clock)
  573. seed = clock + 37 * (/ (i - 1, i = 1, n) /)
  574. CALL RANDOM_SEED(PUT = seed)
  575. DEALLOCATE(seed)
  576. END SUBROUTINE
  577. FUNCTION ran2(idum)
  578. INTEGER idum,IM1,IM2,IMM1,IA1,IA2,IQ1,IQ2,IR1,IR2,NTAB,NDIV
  579. real*8 ran2,AM,EPS,RNMX
  580. PARAMETER (IM1=2147483563,IM2=2147483399,AM=1./IM1,IMM1=IM1-1, &
  581. IA1=40014,IA2=40692,IQ1=53668,IQ2=52774,IR1=12211,IR2=3791, &
  582. NTAB=32,NDIV=1+IMM1/NTAB,EPS=1.2e-7,RNMX=1.-EPS)
  583. INTEGER idum2,j,k,iv(NTAB),iy
  584. SAVE iv,iy,idum2
  585. DATA idum2/123456789/, iv/NTAB*0/, iy/0/
  586. if (idum.le.0) then
  587. idum=max(-idum,1)
  588. idum2=idum
  589. do 11 j=NTAB+8,1,-1
  590. k=idum/IQ1
  591. idum=IA1*(idum-k*IQ1)-k*IR1
  592. if (idum.lt.0) idum=idum+IM1
  593. if (j.le.NTAB) iv(j)=idum
  594. 11 continue
  595. iy=iv(1)
  596. endif
  597. k=idum/IQ1
  598. idum=IA1*(idum-k*IQ1)-k*IR1
  599. if (idum.lt.0) idum=idum+IM1
  600. k=idum2/IQ2
  601. idum2=IA2*(idum2-k*IQ2)-k*IR2
  602. if (idum2.lt.0) idum2=idum2+IM2
  603. j=1+iy/NDIV
  604. iy=iv(j)-idum2
  605. iv(j)=idum
  606. if(iy.lt.1)iy=iy+IMM1
  607. ran2=min(AM*iy,RNMX)
  608. return
  609. END

Compress.f90, under CC-BY-4.0 · at the source

Overview

Authors: Tao Zhang1, Sarthak Gupta2, Madeline A. Lancaster3, J. M. Schwarz2,4
  1. Department of Polymer Science and Engineering, School of Chemistry and Chemical Engineering, Shanghai Jiao Tong University Shanghai 200240 China
  2. Department of Physics, Syracuse University Syracuse NY 13244 USA
  3. MRC Laboratory of Molecular Biology, Cambridge Biomedical Campus Francis Crick Avenue Cambridge CB2 0QH UK
  4. Indian Creek Farm Ithaca NY 14850 USA
Institutions: Shanghai Jiao Tong University (China); Syracuse University (United States); MRC Laboratory of Molecular Biology (United Kingdom); Indian Creek Farm (United States)
Journal: Soft matter, volume 22, issue 9, pages 1979-1993
Dates: received 7 November 2025; accepted 13 January 2026; published online 19 January 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1039/d5sm01116g · PMID 41586835 · PMCID PMC12834241 · OpenAlex W7124721152
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: human (organism)
Methods: Statistics, Spectral & time-frequency
MeSH: Brain*, Models, Biological*, Organoids*, Animals, Chromatin, Gorilla gorilla, Humans, Pan troglodytes (* major topic)
Journal subjects: Chemistry
Topic: Pluripotent Stem Cells Research (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: National Natural Science Foundation of China (National Science Foundation of China) (22303051); DOD (Isaac Newton Award for Transformative Ideas during the COVID19 Pandemic); UK Medical Research Council (MC UP 1201/9)
Citations: not cited yet (Europe PMC); 102 references in the paper

Abstract

How genes influence tissue-scale organization remains a longstanding biological puzzle. While experimental efforts quantify gene expression, chromatin, cellular, and tissue structure, computational models lag behind. To help accelerate multiscale modeling, we demonstrate how a tissue-scale, cellular-based model can be merged with a cell nuclear model incorporating a deformable lamina shell and chromatin to test hypotheses linking chromatin and tissue scales. Specifically, we propose a hypothesis to explain structural differences between human, chimpanzee, and gorilla-derived brain organoids. Recent experiments reveal that a cell fate transition from neuroepithelial to radial glial cells includes a new intermediate state that is delayed in human-derived organoids, leading to significantly narrowed and lengthened apical cells. Additional experiments also demonstrated that ZEB2, a transcription factor, plays a major role in the onset of the novel intermediate state. We hypothesize that this delay stems from chromatin reorganization triggered by mechanical strain as the respective brain organoids develop, with a higher critical threshold in human-derived cells. Here, we computationally test the feasibility of such a hypothesis by exploring how slightly different initial configurations of chromatin, as modeled by different numbers of chromatin crosslinkers, organize in response to mechanical strain with increasingly different initial configurations representing less genetically-close relatives. We find that even small differences in the number of chromatin crosslinkers (>0.01%) yield distinguishable chromatin displacement on average beyond 35% mechanical strain. At higher strains, we observe a new type of nonlinear chromatin scaling law with an exponent of 3.24(5). Finally, we show how differences in chromatin strain maps and more conventional contact maps can reveal structural distinctions between genetically-close species.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above.

Zenodo 17557600

License: CC-BY-4.0
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Languages: Fortran (1)
Size: 4 files, 1 script
Software Heritage: not checked
Found in: “Data availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
1 file

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 1 script, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

Data for this article, including codes and simulation raw data are available at Zenodo at https://doi.org/10.5281/zenodo.17557600.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 8 MeSH terms, 3 funders, 95 references.

Cite

This paper

Zhang, T., Gupta, S., Lancaster, M. A., & Schwarz, J. M. (2026). How human-derived brain organoids are built differently from brain organoids derived from genetically-close relatives: a multi-scale hypothesis. Soft matter, 22(9), 1979-1993. https://doi.org/10.1039/d5sm01116g

BibTeX

@article{zhang2026how,
author = {Zhang, Tao and Gupta, Sarthak and Lancaster, Madeline A. and Schwarz, J. M.},
title = {{How human-derived brain organoids are built differently from brain organoids derived from genetically-close relatives: a multi-scale hypothesis}},
journal = {Soft matter},
year = {2026},
month = mar,
volume = {22},
number = {9},
pages = {1979--1993},
publisher = {Royal Society of Chemistry},
issn = {1744-683X},
doi = {10.1039/d5sm01116g},
url = {https://doi.org/10.1039/d5sm01116g},
pmid = {41586835},
pmcid = {PMC12834241}
}

RIS

TY - JOUR
AU - Zhang, Tao
AU - Gupta, Sarthak
AU - Lancaster, Madeline A.
AU - Schwarz, J. M.
TI - How human-derived brain organoids are built differently from brain organoids derived from genetically-close relatives: a multi-scale hypothesis
T2 - Soft matter
J2 - Soft Matter
PY - 2026
DA - 2026/03/04
VL - 22
IS - 9
SP - 1979
EP - 1993
SN - 1744-683X
PB - Royal Society of Chemistry
DO - 10.1039/d5sm01116g
UR - https://doi.org/10.1039/d5sm01116g
LA - en
ER -

CSL-JSON

{
"id": "10.1039/d5sm01116g",
"type": "article-journal",
"title": "How human-derived brain organoids are built differently from brain organoids derived from genetically-close relatives: a multi-scale hypothesis",
"container-title": "Soft matter",
"author": [
{
"family": "Zhang",
"given": "Tao"
},
{
"family": "Gupta",
"given": "Sarthak"
},
{
"family": "Lancaster",
"given": "Madeline A."
},
{
"family": "Schwarz",
"given": "J. M."
}
],
"container-title-short": "Soft Matter",
"volume": "22",
"issue": "9",
"page": "1979-1993",
"DOI": "10.1039/d5sm01116g",
"PMID": "41586835",
"PMCID": "PMC12834241",
"ISSN": "1744-683X",
"publisher": "Royal Society of Chemistry",
"URL": "https://doi.org/10.1039/d5sm01116g",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
4
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1093/bib/bbag096 [code]
scDIAGRAM: detecting chromatin compartments from individual single-cell Hi-C matrix without imputation or reference features.
Journal: Briefings in bioinformatics
In common: 5 references
[2] doi:10.1038/s41467-026-71877-z [code]
Hi-Compass: a depth-aware deep learning framework for predicting cell-type-specific 3D genome organization from single-cell to spatial resolution.
Journal: Nature communications
In common: 4 references
[3] doi:10.1007/s00401-026-03018-1
Tau oligomerization induces nuclear lamina invagination and chromatin remodeling in Alzheimer's disease.
Journal: Acta neuropathologica
In common: 3 references
[4] doi:10.3389/fcell.2026.1809251
Pbx1 and Pbx3 cooperatively regulate intermediate progenitor genesis and corticogenesis in the mouse neocortex.
Journal: Frontiers in cell and developmental biology
In common: 3 references
[5] doi:10.1371/journal.pgen.1012081
ADNP regulates chromatin architecture and lineage fidelity during neural differentiation.
Journal: PLoS genetics
In common: 3 references
[6] doi:10.1080/19491034.2026.2697135
Elevation of the mechanically-sensitive e protein emerin links nuclear mechanotransduction to tau-induced cytoskeletal remodeling in neurons.
Journal: Nucleus (Austin, Tex.)
In common: 2 references
[7] doi:10.1016/j.stemcr.2026.103012
Identification of novel genes with enriched expression in human intermediate progenitors reveals a key role for CDKN3 in cortical development.
Journal: Stem cell reports
In common: 2 references
[8] doi:10.1038/s41586-026-10832-w [code]
Subnuclear genome compartmentalization controls bivalent chromatin activity.
Journal: Nature
In common: 2 references
[9] doi:10.1038/s41586-026-10648-8
Confined migration induces non-lethal DNA damage in developing neurons.
Journal: Nature
In common: 2 references
[10] doi:10.1101/gad.352886.125
Independent control of neurogenesis and dorsoventral patterning by NKX2-2.
Journal: Genes & development
In common: 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.