Skip to content

Commit 79a281d

Browse files
author
julia
committed
last touches for figures
1 parent a1d8c90 commit 79a281d

13 files changed

+1162
-725
lines changed

02_Embedding/Embedding_results.ipynb

Lines changed: 14 additions & 12 deletions
Large diffs are not rendered by default.

02_Embedding/PCA_results.ipynb

Lines changed: 162 additions & 70 deletions
Large diffs are not rendered by default.

02_Embedding/Visualize_gradients.ipynb

Lines changed: 61 additions & 179 deletions
Large diffs are not rendered by default.

03_Mesh_Sampling/sample_gene_mesh.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import os
2+
import pickle
3+
from glob import glob
4+
import numpy as np
5+
import nibabel as nb
6+
from nighres import io
7+
from profile_functions import profile_sampling
8+
9+
# Load previously created profiles
10+
with open('/home/julia/data/gradients/results/profiles/profiles.pkl', 'rb') as pf:
11+
profiles=pickle.load(pf)
12+
mesh = io.load_mesh('/home/julia/data/gradients/allen_atlas/brain_mesh.vtk')
13+
14+
15+
16+
data = nb.load('/home/julia/data/gradients/results/gene_expression/pca_img.nii.gz').get_data()
17+
mask = nb.load('/home/julia/data/gradients/allen_atlas/gene_expression/gene_mask.nii.gz').get_data()
18+
19+
data_mesh = np.zeros((len(profiles), data.shape[3]))
20+
21+
for p in range(6):
22+
data[:,:,:,p][mask==0] = np.nan
23+
data_mesh[:,p] = np.squeeze(profile_sampling(data[:,:,:,p], profiles))
24+
25+
io.save_mesh('/home/julia/data/gradients/results/gene_expression/pcs_mesh.vtk',
26+
{'faces':mesh['faces'], 'points':mesh['points'],'data':np.nan_to_num(data_mesh)})

03_Mesh_Sampling/sample_gene_viz.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import os
2+
import pickle
3+
from glob import glob
4+
import numpy as np
5+
import nibabel as nb
6+
from nighres import io
7+
from profile_functions import profile_sampling
8+
9+
# Load previously created profiles
10+
with open('/home/julia/data/gradients/results/profiles/profiles.pkl', 'rb') as pf:
11+
profiles=pickle.load(pf)
12+
mesh = io.load_mesh('/home/julia/data/gradients/allen_atlas/brain_mesh.vtk')
13+
14+
15+
16+
data = nb.load('/home/julia/data/gradients/results/gene_expression/pca_img.nii.gz').get_data()
17+
mask = nb.load('/home/julia/data/gradients/allen_atlas/gene_expression/gene_mask.nii.gz').get_data()
18+
19+
for p in [0, 1,3]:
20+
data[:,:,:,p][mask==0] = np.nan
21+
data_mesh = np.squeeze(profile_sampling(data[:,:,:,p], profiles))
22+
data_mesh_min = data_mesh.copy()
23+
data_mesh_min[np.isnan(data_mesh)] = np.nanmin(data_mesh)
24+
data_mesh_max = data_mesh.copy()
25+
data_mesh_max[np.isnan(data_mesh)] = np.nanmax(data_mesh)
26+
io.save_mesh('/home/julia/data/gradients/results/gene_expression/pc{}_viz_min.vtk'.format(p+1),
27+
{'faces':mesh['faces'], 'points':mesh['points'],
28+
'data':data_mesh_min})
29+
io.save_mesh('/home/julia/data/gradients/results/gene_expression/pc{}_viz_max.vtk'.format(p+1),
30+
{'faces':mesh['faces'], 'points':mesh['points'],
31+
'data':data_mesh_max})

05_Distance_Origins.ipynb

Lines changed: 62 additions & 7 deletions
Large diffs are not rendered by default.

06_Distance_Sensory.ipynb

Lines changed: 40 additions & 23 deletions
Large diffs are not rendered by default.

07_Gene_expression.ipynb

Lines changed: 127 additions & 181 deletions
Large diffs are not rendered by default.

08_Cytoarchitectonic_Type.ipynb

Lines changed: 176 additions & 21 deletions
Large diffs are not rendered by default.

09_Reproducibility.ipynb

Lines changed: 365 additions & 147 deletions
Large diffs are not rendered by default.

10_T1w_T2w.ipynb

Lines changed: 53 additions & 14 deletions
Large diffs are not rendered by default.

regions.csv

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
,id,acronym,cluster,type,comment
2-
0,1,MOp,somatomotor,4.0,
3-
1,2,MOs,somatomotor,3.0,
4-
2,3,SSs,somatomotor,3.0,
5-
3,4,AUDd,auditory,3.0,
6-
4,5,AUDp,auditory,4.0,
7-
5,6,AUDpo,auditory,3.0,AUDd
8-
6,7,AUDv,auditory,3.0,
9-
7,8,VISal,visual,3.0,
10-
8,9,VISam,medial,2.5,
11-
9,10,VISl,visual,2.5,
12-
10,11,VISp,visual,4.0,
13-
11,12,VISpl,visual,2.5,
14-
12,13,VISpm,medial,2.5,
15-
13,14,VISli,visual,2.5,VISl
16-
14,15,VISpor,visual,2.5,VISpl
17-
15,16,ACAd,prefrontal,1.0,
18-
16,17,ACAv,prefrontal,1.0,
19-
17,18,ORBl,prefrontal,1.0,
20-
18,19,ORBm,prefrontal,1.0,
21-
19,20,ORBvl,prefrontal,1.0,
22-
20,21,AId,lateral,1.0,
23-
21,22,AIp,lateral,1.0,
24-
22,23,AIv,lateral,1.0,
25-
23,24,RSPagl,medial,1.0,
26-
24,25,RSPd,medial,1.0,
27-
25,26,RSPv,medial,1.0,
28-
26,27,VISa,medial,2.5,VISam
29-
27,28,VISrl,visual,2.5,VISam
30-
28,29,FRP,prefrontal,1.0,
31-
29,30,GU,lateral,2.0,
32-
30,31,VISC,lateral,3.0,
33-
31,32,PL,prefrontal,1.0,
34-
32,33,ILA,prefrontal,1.0,
35-
33,34,PTLp,,3.0,
36-
34,35,TEa,lateral,2.0,
37-
35,36,PERI,lateral,1.0,
38-
36,37,ECT,lateral,1.0,
39-
37,38,SSp-n,somatomotor,3.0,
40-
38,39,SSp-bfd,somatomotor,4.0,
41-
39,40,SSp-ll,somatomotor,3.0,
42-
40,41,SSp-m,somatomotor,4.0,
43-
41,42,SSp-ul,somatomotor,3.0,
44-
42,43,SSp-tr,somatomotor,3.0,
45-
43,44,SSp-un,somatomotor,3.0,SS-ul
1+
,id,acronym,cluster,type,comment,gradient 0,gradient 1,gradient 2,gradient 3,gradient 4,gradient 5
2+
0,1,MOp,somatomotor,4.0,,-0.03568782220436858,-0.0154091686558519,0.012741753963790497,-0.009172594346709396,0.00513099071314284,0.006942156512608698
3+
1,2,MOs,somatomotor,3.0,,0.0025069955301969832,-0.0038474656471718448,0.007450081944977764,-0.00852061521706441,0.01620450791402551,0.00545335607639779
4+
2,3,SSs,somatomotor,3.0,,-0.037188072283479055,0.004716490049550846,0.006545009335317476,0.006152018592577589,-0.005468950854635708,0.0024740030188930857
5+
3,4,AUDd,auditory,3.0,,0.027084484061886877,-0.00882208942035993,-0.010148324479741387,0.02137535058962912,-0.004731137306298215,0.0203513917495246
6+
4,5,AUDp,auditory,4.0,,0.023690990394506624,-0.015741204338250724,-0.027671141356768784,0.02242979666929468,-0.0046490854099804305,0.02640433057183475
7+
5,6,AUDpo,auditory,3.0,AUDd,0.02764427053385348,-0.015167741877328583,-0.028876219189862978,0.018338051318978994,-0.007029948557261843,0.02148287811124272
8+
6,7,AUDv,auditory,3.0,,0.01677497114234613,-0.01667618093389804,-0.022042757065424814,0.017783322706419254,-0.002279473761893708,0.0183686040513011
9+
7,8,VISal,visual,3.0,,0.03546450903818704,-0.014262727913795526,-0.013816362634135819,0.0066368668164588475,-0.011542584462089634,0.003738091392618345
10+
8,9,VISam,medial,2.5,,0.03664784824381885,-0.034575769563189016,-0.004727341169375709,-0.016962041931056576,-0.015741711718165,-0.009740052384057184
11+
9,10,VISl,visual,2.5,,0.022031015266856035,-0.01691377728871901,-0.02522555623419092,0.004209564736667964,-0.012519093406702422,-0.0008995287011991099
12+
10,11,VISp,visual,4.0,,0.021906912850628447,-0.016112270382924527,-0.02168625104870265,-0.00287919821921698,-0.014649128403145598,-0.008183182644497444
13+
11,12,VISpl,visual,2.5,,0.017202950034946613,-0.0006559658106645402,-0.018795304783684692,-0.000840477962273393,-0.005178477651338038,0.0006215153236242401
14+
12,13,VISpm,medial,2.5,,0.025782534399085857,-0.028259620252080685,-0.015777645419001684,-0.011077604149900304,-0.01809544045812366,-0.012104042805846857
15+
13,14,VISli,visual,2.5,VISl,0.02331003829360946,-0.01930581183399556,-0.02939384406528814,0.00846385380185372,-0.01137439258709325,0.006591885454338201
16+
14,15,VISpor,visual,2.5,VISpl,0.01803609421088807,-0.013133548093789818,-0.024651003000279486,0.0057220768972405444,-0.0027912771127564942,0.00505269893496346
17+
15,16,ACAd,prefrontal,1.0,,0.049156435503822364,0.04380858182699291,0.0021732595083364453,-0.008304685557589115,0.007122142424478201,0.010078329216053106
18+
16,17,ACAv,prefrontal,1.0,,0.03471179406886994,0.046521921011585234,-0.008860126439363658,-0.006608019227667518,0.007315084023385196,0.007733537607240533
19+
17,18,ORBl,prefrontal,1.0,,0.001834130476560833,0.015021343181546838,-0.008230939107083592,0.0012263360134773425,0.017201780142172673,-0.01256586999363855
20+
18,19,ORBm,prefrontal,1.0,,0.008769781628544535,0.021653223479806766,-0.01803273164162894,0.005798338124054226,0.015225672380725815,-0.0135376299241882
21+
19,20,ORBvl,prefrontal,1.0,,0.007352208122509061,0.021464070127030128,-0.014579885760316743,0.003667949755938446,0.01320010274472815,-0.013110154081436072
22+
20,21,AId,lateral,1.0,,-0.030785714180116348,0.008286815521519471,-0.005609767774207506,-0.004205963277787184,0.013143504740069499,-0.009713357112487237
23+
21,22,AIp,lateral,1.0,,-0.008533311145568667,0.0003489173029746817,-0.013680942784038874,0.0007157022939999406,0.009518774846486897,-0.011782727711268684
24+
22,23,AIv,lateral,1.0,,-0.009835795310435594,0.010619825422793768,-0.009661432472975908,0.0005217851566158371,0.015972277161371267,-0.013936702770180895
25+
23,24,RSPagl,medial,1.0,,0.03513684736934701,-0.006300926905046231,-0.004834776095938908,-0.014151367073083166,-0.014007746363691616,-0.0027013600359914744
26+
24,25,RSPd,medial,1.0,,0.04286721676138723,0.018859731241181194,0.003481548265915452,-0.017266168822451692,-0.012754577013920453,0.0038145778953509123
27+
25,26,RSPv,medial,1.0,,0.037925760918057314,0.03019428822369065,0.003574209661543702,-0.014795699778914031,-0.008523019465363943,0.0060864467276379635
28+
26,27,VISa,medial,2.5,VISam,,,,,,
29+
27,28,VISrl,visual,2.5,VISam,,,,,,
30+
28,29,FRP,prefrontal,1.0,,-0.0038605886035127292,0.018719508342013108,-0.00682736856656231,0.0028734685707201865,0.01141208689185815,-0.00935872428792932
31+
29,30,GU,lateral,2.0,,-0.055373115846687374,0.015208334062496817,-0.004636537320219352,-0.01013369355985064,-0.0017168796276973133,-0.010157906006656206
32+
30,31,VISC,lateral,3.0,,-0.02570769547732643,-0.0026758247820425824,-0.00904318412230503,-0.0012477557949768258,0.009404232518315063,-0.004731674607943033
33+
31,32,PL,prefrontal,1.0,,0.016151421334309597,0.025818452100899187,-0.015691345384680182,0.004739349097281792,0.013901693399453309,-0.005110804083024109
34+
32,33,ILA,prefrontal,1.0,,0.006998184834244141,0.019632357741947194,-0.02159360254147906,0.006857785738314195,0.014187297322424375,-0.010702659676050542
35+
33,34,PTLp,,3.0,,0.04122236730647212,-0.026806576606755343,0.005214380394296107,-0.008477325030278886,-0.010155403405069366,-0.008005883351485285
36+
34,35,TEa,lateral,2.0,,0.01470271308987962,-0.016353471161860575,-0.024360402554022987,0.012758795250639166,0.0002723286185947523,0.010978079586852242
37+
35,36,PERI,lateral,1.0,,0.012458122917137243,-0.013640796055080189,-0.018729406437181784,0.005798707196909988,0.006205020517152061,0.00012977528847527383
38+
36,37,ECT,lateral,1.0,,0.010333748317736929,-0.01393376030783684,-0.01916059778440597,0.007350613499738287,0.006389087262624834,0.0022354685847421917
39+
37,38,SSp-n,somatomotor,3.0,,-0.04205997217251256,0.013601220022292599,0.01735282324804151,0.024691922757035238,-0.012881523058093905,-0.006064723480905253
40+
38,39,SSp-bfd,somatomotor,4.0,,0.024950074942656487,0.005517790709076995,0.024364720593995616,0.029828268724769364,-0.005060652278553895,-0.008739635718358247
41+
39,40,SSp-ll,somatomotor,3.0,,0.03758299475002744,-0.03484300444836011,0.02318144411854765,-0.014215276341127351,-0.0018546157633588401,-0.007214879522050393
42+
40,41,SSp-m,somatomotor,4.0,,-0.07861515117883872,0.012192508143236892,0.00510583093860704,-0.0038642487443138734,-0.0192532275547663,0.0015614039139625615
43+
41,42,SSp-ul,somatomotor,3.0,,0.002406497080178514,-0.016742136067313652,0.026627026231592243,0.007574824303077244,0.0006508582191240066,-0.001505637561250587
44+
42,43,SSp-tr,somatomotor,3.0,,0.0436252038482357,-0.033743564204289145,0.01619047462548478,-0.01638858488131051,-0.007718789807695899,-0.008909259927816904
45+
43,44,SSp-un,somatomotor,3.0,SS-ul,0.007867341004875772,-0.005862159542420153,0.027915650675218562,0.020094451479307017,-0.0037063463040761433,-0.006298998026724369

sample_gene_mesh.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)