added foundation option flat
This commit is contained in:
@@ -43,12 +43,26 @@ def conc_df_from_file(input_path="input/", foundation="vivo_average"):
|
|||||||
|
|
||||||
# Load foundation file, a line with e.g. in-vivo averages
|
# Load foundation file, a line with e.g. in-vivo averages
|
||||||
# The code expects a one-line-foundation.
|
# The code expects a one-line-foundation.
|
||||||
|
molecule_names = ['Ala', 'Asc', 'Asp', 'Cr', 'GABA', 'GPC', 'GSH',
|
||||||
|
'Glc', 'Gln', 'Glu', 'Ins', 'Lac', 'NAA', 'NAAG',
|
||||||
|
'PCho', 'PCr', 'PE', 'Scyllo', 'Tau',
|
||||||
|
'mm', 'Glu+Gln', 'GPC+PCho', 'Cr+PCr',
|
||||||
|
'Glc+Tau', 'NAA+NAAG']
|
||||||
|
|
||||||
if foundation == "vivo_average":
|
if foundation == "vivo_average":
|
||||||
try:
|
try:
|
||||||
df_foundation = pd.read_csv(
|
df_foundation = pd.read_csv(
|
||||||
"basis/fit_conc_result.csv").mean().to_frame().transpose()
|
"basis/fit_conc_result.csv").mean().to_frame().transpose()
|
||||||
except:
|
except:
|
||||||
print("No basis/fit_conc_result.csv file supplied")
|
print("No basis/fit_conc_result.csv file supplied")
|
||||||
|
if foundation == "flat":
|
||||||
|
try:
|
||||||
|
df_foundation = pd.read_csv(
|
||||||
|
"basis/fit_conc_result.csv").mean().to_frame().transpose()
|
||||||
|
for molecule in molecule_names:
|
||||||
|
df_foundation[molecule] = 0
|
||||||
|
except:
|
||||||
|
print("No basis/fit_conc_result.csv file supplied")
|
||||||
else:
|
else:
|
||||||
print("Only foundation mode vivo_average not chosen")
|
print("Only foundation mode vivo_average not chosen")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user