From 110b0b21e9fd1555f75e9e62dde3e14b0108ff0f Mon Sep 17 00:00:00 2001 From: Valerio Caporioni Date: Sun, 26 May 2024 10:59:53 +0200 Subject: [PATCH] solved delimiter issue in data cleaning --- brainage/__pycache__/utils.cpython-311.pyc | Bin 21639 -> 17758 bytes brainage/neural_net.py | 1 + brainage/utils.py | 16 ++++++---------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/brainage/__pycache__/utils.cpython-311.pyc b/brainage/__pycache__/utils.cpython-311.pyc index b43d1aadac86ca02d410ac3bd04663fcfa1482a1..a8e0398c5a208ee809febcbc83d5cc6e1a83d160 100644 GIT binary patch delta 1247 zcmY+DTTC2P7{|}IGXrdQSpl~!yFm9wy9}_>l%_(3(h{gNTP?ST0->9g8DL>Ay^a8()mA51unbjc4Zk^8YU9 ze$Gpq@cmVA-K?zKM_76K&yks~$2VMcu(lC-1%ewN-iC#DRrx4BCLcJAG4a2 zdS)F|8W<0$5v6g##+y^Oji_bw&0O=M98mlp1m0t@_pLbhO~?w25?tQ40{ca!{67a&;IQB}d{s#p zs5+BbN~DrXAVFtyX*HwM1~wpVK}I!hOg7SEsLc+;#ZxIs7Fe*rWJFO=C^X`q>?C z>s@EtJ!jjF^&4|FL4cTX_0eqs&fU0zfjax8l^c}bf@VoJg|4R^cFCmydTxSD#MiH{^Dx!f)mK&Ywj4TGNZM z)mS06Yustsv|Zv&OvfzE<`(1ZymBf{@kVJ5tGUcomcu%=a!R>w=g4vNax8HyGnnOi zHl9jqx?E24+-c3`d9JL?>aTD=Mt$vVpa`IUYshrc`BF{ zGue!;CG%>&dWfn@a#~l}rQFNOW3=lln8XKN7o^WvdXF)6d|WKsVv>H2pPpz7zR6^< zjQ1p&@GSj^N8VyErRAie&(Z5>@4W~kc)9mj?T6eiK9itx^bXH6IBwzBz0XOzOimf+ zPM!udh7L6RyT>w|mSJyafxgU=0G0Sn8V~yht4!#h|2Q(|<@k}DE#^ZZO)x><8g!*{Aj^RN?cRH)&QtAo%G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ynm8SI!s<1(vzsoL$hNf~+d6LBI#RYy z+18n8N<8)EI@#Ixv2*ur=kAnquk75Ltlk$lF6sMJ&U)J>} zb^UiMZ8O{ET2hs3<;t~SKsL)Et6!^0I1`>Xd*ls$DM!ET=ugJV2U6t&a``~K_{(Cd zwJTBaw*3wJt$|e6F1c&hdk0f3gL2E@5>>9RRUl<-j`ya@ny1uLJ}|wmRjzHjeh~i> z+FPoG;rcPT_A$A3XZ-O+`Lw85F!`d;lveDa%5CE3yBm{(@UlMNH8 zSi^)2U&gxl;MDMJ)2Frdm$%FvO>9b`l*i(a->F}9<>-q?FCD*pJidGC(B#madgjXE z7Y|<=xjeE=sC(qf;ERKo_FUcrGWsU>$M=IJri!W7$paS;#1Gsxmapu#Ob%TfiVrQ8 z)y^KCJCo2>C(F?D(i^?ab-9;e2R#7$9m^wpP2$%&>5JY2bVBOgc}PP($K<`dv+app z&>?#P(i)F1$chC2IYIE6OumN@N4SLWA;Ka8CUsipa^dOga%Entaf4#x;Ebd{5?U!n?OO!|9Y-^gB?-m*lkz{4s^ZH%A0T~w1Ss#&s821~r+Vr|mW pns6ueJt=*UtnWF$b5UJ+{=n4El)740S0}U2Qaz=%!!)Jj{SUl118x8S diff --git a/brainage/neural_net.py b/brainage/neural_net.py index 1f2f4e9..3a6e4d7 100644 --- a/brainage/neural_net.py +++ b/brainage/neural_net.py @@ -357,6 +357,7 @@ def neural_net_parsing(): p_value_emp(pad_control, pad_asd) sites_asd = get_sites(args.filename, site_col = args.site_col, group_col = args.group, group_value = 1) # 1 is for ASD group + print(np.mean(pad_control), np.mean(pad_asd)) sites_barplot(pad_asd, sites_asd) if args.plot: plt.show() diff --git a/brainage/utils.py b/brainage/utils.py index 3aa4b25..c8d079f 100644 --- a/brainage/utils.py +++ b/brainage/utils.py @@ -102,7 +102,7 @@ def handle_spurious(df: pd.DataFrame, *args: str) -> pd.DataFrame: if isinstance(arg, str): df.drop(arg, axis="columns", inplace=True) else: - print("Invalid argument!") + logger.error('Invalid argument') # Replace -9999 with NaN df.replace(-9999, np.nan, inplace=True) @@ -370,19 +370,15 @@ def sites_barplot(numbers, sites): plt.savefig("../plots/bar_plot.png", transparent = True) if __name__ == "__main__": - - # Uncomment for a rapid test - + df = pd.read_csv('../data/abide.csv', delimiter = ';') + ## First step # check_for_spurious(df, show = True) - # check_site_correlation(df).to_csv("../data/site_correlation.csv") + ## Second step # df = handle_spurious(df, "FIQ", # "Left-vessel_Volume_mm3", # "Right-vessel_Volume_mm3", # "5th-Ventricle_Volume_mm3") - # df.to_csv('../data/abide_clean.csv') - # check_site_correlation(df).to_csv("site_correlation_no_spurious.csv") - df = pd.read_csv("../data/abide.csv", delimiter = ';') - # # handle_spurious(df) - get_correlation(df) + # df.to_csv('../data/abide_clean.csv', sep=';') + # logger.info('Done') \ No newline at end of file