Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
aldridgelab-morpheus
morpheus
Commits
9a106090
Commit
9a106090
authored
Jun 18, 2020
by
Michaela Olson
Browse files
clarifications to comments in code
parent
a7edcb47
Changes
19
Show whitespace changes
Inline
Side-by-side
classification_and_analysis/analysis/backwards_select_analysis.m
View file @
9a106090
...
...
@@ -52,10 +52,6 @@ end
% save the workspace used
overall_vars
.
WORKSPACE
=
chosen_workspaces
;
% save whether efflux was in lipid or not
overall_vars
.
EFFLUX_IN_LIPID
=
efflux_in_lipid
;
disp
(
strcat
(
"distance metric is "
,
d_metric
))
if
large_group
...
...
classification_and_analysis/analysis/classification_loop_content.m
View file @
9a106090
...
...
@@ -521,7 +521,6 @@ backwards_select_analysis
% from the overall vars --> just straight up look for highest percent
% and if there is more than one, take lowest value
% did I steal this from another section of code? what are you, a cop
% get all of the fieldnames for overall vars
field_names
=
fieldnames
(
overall_vars
);
...
...
classification_and_analysis/cKNN_creator.m
View file @
9a106090
...
...
@@ -231,7 +231,7 @@ moa_table = sortrows(moa_table,'DRUG');
%connectivity_plot(moa_table,color_struct,all_categories,chosen_colormap,wbg)
%sgtitle({bayes_file,run_tot_string},'Interpreter','none')
%% want to go through and make it into
funky
two way table
time
%% want to go through and make it into
a
two way table
% add a moa column
results_table
.
MOA
=
results_table
.
DRUG
;
...
...
@@ -268,11 +268,6 @@ two_way_table= make_two_way_table(results_table,'DRUG','NEIGHBOR');
%title("drugs on bottom have the neighbors of drugs on left")
%% want to create a table that adds together all of the connections
% would it be easier to start with the bayes struct or 1 way table?
% we'd need to add together first again before taking the percents... hm
% could actually just get raw values back by multiplying and dividng by 100
raw_two_way_table
=
two_way_table
;
raw_two_way_table
{:,:}
=
raw_two_way_table
{:,:}/
100
*
total_runs
;
...
...
classification_and_analysis/functions/change_to_moa.m
View file @
9a106090
function
drug_moas
=
change_to_moa
(
drugList
,
all_categories
)
% INPUT list of drugs
% will read them in and change them to their MoA
% is this like assign MoA? probably
% let me live my life
% all_categories is a struct where ,for example, all_categories.protein has
% an array of all of the different protein drugs
...
...
classification_and_analysis/functions/combine_workspaces.m
View file @
9a106090
...
...
@@ -5,7 +5,7 @@ function final_data_table = combine_workspaces(chosen_workspaces,workspace_direc
% create a structure to store the final_data_table s from each workspace
all_spaces
=
struct
;
for
i
=
chosen_workspaces
% get each individual space
e
% get each individual space
one_space
=
i
{
1
};
% need to get final data table from each space and concat final_data_table
fpath
=
strcat
(
workspace_directory
,
'/'
,
one_space
);
...
...
classification_and_analysis/functions/graph_color_moa.m
View file @
9a106090
function
graph_color_moa
(
fig
)
%less loopy than before, this bad boy ensures everything is exactly the
% same every time
% jk ended up being p loopy
% color_maker and graph_helper2 needed to run this
% like graph_color_s but color by MoA
%now to the scatter plot colors
ca
=
get
(
fig
,
'CurrentAxes'
);
...
...
@@ -32,22 +29,19 @@ function graph_color_moa(fig)
% sort drug by MoA
RNAP
=
[
"RifT"
,
"RIF"
,
"RNAP"
];
lipid
=
[
"PZA"
,
"CCCP"
,
"Gra"
,
"Mon"
,
"Nig"
,
"Nis"
,
"Sulf"
,
"BDQ"
,
"Clz"
,
"Cerold
"
];
lipid
_2
=
[
"
Tri"
,
"Ver"
,
"Thi
"
];
efflux
=
[
"efflux"
,
"Ver"
,
"Thi
"
];
lipid
=
[
"
PZA"
,
"CCCP"
,
"Gra"
,
"Mon"
,
"Nig"
,
"Nis"
,
"BDQ"
,
"Clz
"
];
protein
=
[
"Kan"
,
"Amk"
,
"Cam"
,
"AZT"
,
"Cla"
,
"Dox"
,
"Gent"
,
"Strep"
,
"Tet"
,
"Tig"
,
"Lin"
,
"protein"
];
dna
=
[
"
Dau"
,
"Nal"
,
"
Lev"
,
"Mox"
,
"MIT"
,
"Olf"
,
"dna"
,
"MOX"
,
"Olfold"
,
"Nit"
];
cell_wall
=
[
"Mer"
,
"Amp"
,
"
Amox"
,
"Ctax"
,
"Cle
x"
,
"INH"
,
"ETA"
,
"IMI"
,
"Pip"
,
"Cfox"
,
...
"Mec"
,
"Oxa"
,
"PenG"
,
"Van"
,
"Pre"
,
"Cyc"
,
"
A22"
,
"Carb"
,
"
Del"
,
"EMB"
,
"cell_wall"
,
"Cer"
,
"THL"
];
dna
=
[
"Lev"
,
"Mox"
,
"MIT"
,
"Olf"
,
"dna"
,
"MOX"
];
cell_wall
=
[
"Mer"
,
"Amp"
,
"
Cta
x"
,
"INH"
,
"ETA"
,
"IMI"
,
...
"Van"
,
"Pre"
,
"Cyc"
,
"Del"
,
"EMB"
,
"cell_wall"
,
"Cer"
,
"THL"
];
controls
=
[
"MeOH"
,
"EtOH"
,
"NaOH"
,
"water"
,
"DMSO"
,
"Untreated"
,
"control"
];
unknowns
=
[
"Unknown2019"
,
"Unknown2239"
,
"Unknown2911"
,
"Unknown3285"
,
"Unknown4050
"
];
unknowns
=
[
"Unknown2019"
,
"Unknown2239"
,
"Unknown3285
"
];
extras
=
[
"INH_control"
,
"INH_control_3x"
];
stonybrooks
=
[
"high_692"
,
"high_701"
,
"high_702"
,
"low_691"
,
"low_692"
,
"low_701"
,
"low_702"
];
%Set up arrays of similar colors for different MoA
RNAPcol
=
color_maker
(
RNAP
,
[
255
255
0
],
[
0
0
50
]);
lipidcol
=
color_maker
(
lipid
,[
0
83
166
],[
8
13
35
]);
lipid_2col
=
color_maker
(
lipid_2
,[
0
,
211
,
211
],[
100
10
5
]);
proteincol
=
color_maker
(
protein
,[
55
92
0
],[
10
20
4
]);
dnacol
=
color_maker
(
dna
,[
255
234
196
],[
0
,
-
38
,
-
62
]);
cell_wallcol
=
color_maker
(
cell_wall
,[
52
0
109
],[
9
8
14
]);
...
...
classification_and_analysis/functions/graph_color_s.m
View file @
9a106090
function
graph_color_s
(
fig
)
%less loopy than before, this bad boy ensures everything is exactly the
% same every time
% jk ended up being p loopy
% color_maker and graph_helper2 needed to run this
% used to color graph using the same color scheme each time
% apply to existing figure handle
%now to the scatter plot colors
ca
=
get
(
fig
,
'CurrentAxes'
);
...
...
@@ -33,30 +31,25 @@ function graph_color_s(fig)
% sort drug by MoA
RNAP
=
[
"RifT"
,
"RIF"
,
"RNAP"
];
efflux
=
[
"efflux"
,
"Ver"
,
"Thi"
];
lipid
=
[
"PZA"
,
"CCCP"
,
"Gra"
,
"Mon"
,
"Nig"
,
"Nis"
,
"Sulf"
,
"BDQ"
,
"Clz"
,
"Cerold"
];
lipid_2
=
[
"Tri"
];
lipid
=
[
"PZA"
,
"CCCP"
,
"Gra"
,
"Mon"
,
"Nig"
,
"Nis"
,
"BDQ"
,
"Clz"
];
protein
=
[
"Kan"
,
"Amk"
,
"Cam"
,
"AZT"
,
"Cla"
,
"Dox"
,
"Gent"
,
"Strep"
,
"Tet"
,
"Tig"
,
"Lin"
,
"protein"
];
dna
=
[
"
Dau"
,
"Nal"
,
"
Lev"
,
"Mox"
,
"MIT"
,
"Olf"
,
"dna"
,
"MOX"
,
"Olfold"
,
"Nit"
];
cell_wall
=
[
"Mer"
,
"Amp"
,
"
Amox"
,
"Ctax"
,
"Cle
x"
,
"INH"
,
"ETA"
,
"IMI"
,
"Pip"
,
"Cfox"
,
...
"Mec"
,
"Oxa"
,
"PenG"
,
"Van"
,
"Pre"
,
"Cyc"
,
"
A22"
,
"Carb"
,
"
Del"
,
"EMB"
,
"cell_wall"
,
"Cer"
,
"THL"
];
dna
=
[
"Lev"
,
"Mox"
,
"MIT"
,
"Olf"
,
"dna"
,
"MOX"
];
cell_wall
=
[
"Mer"
,
"Amp"
,
"
Cta
x"
,
"INH"
,
"ETA"
,
"IMI"
,
...
"Van"
,
"Pre"
,
"Cyc"
,
"Del"
,
"EMB"
,
"cell_wall"
,
"Cer"
,
"THL"
];
controls
=
[
"MeOH"
,
"EtOH"
,
"NaOH"
,
"water"
,
"DMSO"
,
"Untreated"
,
"control"
];
unknowns
=
[
"Unknown2019"
,
"Unknown2239"
,
"Unknown2911"
,
"Unknown3285"
,
"Unknown4050
"
];
unknowns
=
[
"Unknown2019"
,
"Unknown2239"
,
"Unknown3285
"
];
extras
=
[
"INH_control"
,
"INH_control_3x"
];
stonybrooks
=
[
"high_692"
,
"high_701"
,
"high_702"
,
"low_691"
,
"low_692"
,
"low_701"
,
"low_702"
];
%Set up arrays of similar colors for different MoA
RNAPcol
=
color_maker
(
RNAP
,
[
255
255
0
],
[
0
0
50
]);
effluxcol
=
color_maker
(
efflux
,[
100
19
38
],[
0
50
50
]);
lipidcol
=
color_maker
(
lipid
,[
0
83
166
],[
8
13
35
]);
lipid_2col
=
color_maker
(
lipid_2
,[
0
,
211
,
211
],[
100
10
5
]);
proteincol
=
color_maker
(
protein
,[
55
92
0
],[
10
20
4
]);
dnacol
=
color_maker
(
dna
,[
255
234
196
],[
0
,
-
38
,
-
62
]);
cell_wallcol
=
color_maker
(
cell_wall
,[
52
0
109
],[
9
8
14
]);
controlscol
=
color_maker
(
controls
,[
33
33
33
],[
25
25
25
]);
unknownscol
=
color_maker
(
unknowns
,[
150
20
170
],[
20
40
-
20
]);
extrascol
=
color_maker
(
extras
,[
255
255
255
],[
0
-
15
-
50
]);
stonybrookscol
=
color_maker
(
stonybrooks
,[
240
120
21
],
[
-
28
20
32
]);
%failsafe if a drug shows up that is not listed
nogroup
=
0
;
...
...
@@ -110,10 +103,6 @@ function graph_color_s(fig)
ind
=
find
(
strcmpi
(
lipid
,
name
));
graph_helper
(
scat
(
row
,
1
),
lipidcol
,
ind
,
markers
)
elseif
ismember
(
name
,
lipid_2
)
ind
=
find
(
strcmp
(
lipid_2
,
name
));
graph_helper
(
scat
(
row
,
1
),
lipid_2col
,
ind
,
markers
)
elseif
ismember
(
name
,
protein
)
ind
=
find
(
strcmpi
(
protein
,
name
));
graph_helper
(
scat
(
row
,
1
),
proteincol
,
ind
,
markers
)
...
...
@@ -126,10 +115,6 @@ function graph_color_s(fig)
ind
=
find
(
strcmpi
(
cell_wall
,
name
));
graph_helper
(
scat
(
row
,
1
),
cell_wallcol
,
ind
,
markers
)
elseif
ismember
(
name
,
stonybrooks
)
ind
=
find
(
strcmpi
(
stonybrooks
,
name
));
graph_helper
(
scat
(
row
,
1
),
stonybrookscol
,
ind
,
markers
)
elseif
ismember
(
name
,
controls
)
ind
=
find
(
strcmpi
(
controls
,
name
));
graph_helper
(
scat
(
row
,
1
),
controlscol
,
ind
,
markers
)
...
...
classification_and_analysis/functions/replace_allcap_name.m
View file @
9a106090
function
full_names
=
replace_allcap_name
(
abbv_names
)
% converts all drug abbreviations to all cap versions
% % will also change _025x to " low" and _3x to " high"
%
% abbv_names = strrep(abbv_names, 'Amp','AMP');
% abbv_names = strrep(abbv_names, 'Ctax','CTAX');
% abbv_names = strrep(abbv_names, 'Mer','MER');
% % abbv_names = strrep(abbv_names, 'INH','isoniazid');
% % abbv_names = strrep(abbv_names, 'EMB','ethambutol');
% % abbv_names = strrep(abbv_names, 'ETA','ethionamide');
% % abbv_names = strrep(abbv_names, 'IMI','imipenem');
% abbv_names = strrep(abbv_names, 'Pip','PIP');
% abbv_names = strrep(abbv_names, 'Oxa','OXA');
% abbv_names = strrep(abbv_names, 'PenG','PENG');
% abbv_names = strrep(abbv_names, 'Van','VAN');
% abbv_names = strrep(abbv_names, 'Cyc','CYC');
% abbv_names = strrep(abbv_names, 'Carb','CARB');
% abbv_names = strrep(abbv_names, 'Del','DEL');
% abbv_names = strrep(abbv_names, 'Dau','DAU');
% abbv_names = strrep(abbv_names, 'Nal','NAL');
% abbv_names = strrep(abbv_names, 'Lev','LEV');
% abbv_names = strrep(abbv_names, 'Mox','MOX');
% abbv_names = strrep(abbv_names, 'Clz','CLZ');
% % abbv_names = strrep(abbv_names, 'MIT','MIT');
% abbv_names = strrep(abbv_names, 'Olf','OLF');
% abbv_names = strrep(abbv_names, 'Kan','KAN');
% abbv_names = strrep(abbv_names, 'Amk','AMK');
% abbv_names = strrep(abbv_names, 'Cam','CAM');
% % abbv_names = strrep(abbv_names, 'AZT','azithromycin');
% abbv_names = strrep(abbv_names, 'Cla','CLA');
% abbv_names = strrep(abbv_names, 'Dox','DOX');
% abbv_names = strrep(abbv_names, 'Gent','GENT');
% abbv_names = strrep(abbv_names, 'Strep','STREP');
% abbv_names = strrep(abbv_names, 'Tet','TET');
% abbv_names = strrep(abbv_names, 'Tig','TIG');
% abbv_names = strrep(abbv_names, 'Lin','LIN');
% abbv_names = strrep(abbv_names, 'Pre','PRE');
% % abbv_names = strrep(abbv_names, 'CCCP','carbonyl cyanide 3-chlorophenylhydrazone');
% abbv_names = strrep(abbv_names, 'Cer','CER');
% abbv_names = strrep(abbv_names, 'Gra','GRA');
% abbv_names = strrep(abbv_names, 'Mon','MON');
% abbv_names = strrep(abbv_names, 'Nig','NIG');
% abbv_names = strrep(abbv_names, 'Nis','NIS');
% abbv_names = strrep(abbv_names, 'Tri','TRI');
% abbv_names = strrep(abbv_names, 'Ver','VER');
% abbv_names = strrep(abbv_names, 'Thi','THI');
% abbv_names = strrep(abbv_names, 'RifT','RIFT');
% abbv_names = strrep(abbv_names, 'Nit','NIT');
% abbv_names = strrep(abbv_names, 'Sulf','SULF');
% abbv_names = strrep(abbv_names, 'BDQ','bedaquiline');
% abbv_names = strrep(abbv_names, 'RIF','rifampicin');
% abbv_names = strrep(abbv_names, 'PZA','pyrazinamide');
abbv_names
=
upper
(
abbv_names
);
abbv_names
=
strrep
(
abbv_names
,
'_025x'
,
' L'
);
...
...
classification_and_analysis/functions/replace_full_name.m
View file @
9a106090
...
...
@@ -8,15 +8,10 @@ function full_names = replace_full_name(abbv_names)
abbv_names
=
strrep
(
abbv_names
,
'EMB'
,
'ethambutol'
);
abbv_names
=
strrep
(
abbv_names
,
'ETA'
,
'ethionamide'
);
abbv_names
=
strrep
(
abbv_names
,
'IMI'
,
'imipenem'
);
abbv_names
=
strrep
(
abbv_names
,
'Pip'
,
'piperacillin'
);
abbv_names
=
strrep
(
abbv_names
,
'Oxa'
,
'oxacillin'
);
abbv_names
=
strrep
(
abbv_names
,
'PenG'
,
'penicillin G'
);
abbv_names
=
strrep
(
abbv_names
,
'Van'
,
'vancomycin'
);
abbv_names
=
strrep
(
abbv_names
,
'Cyc'
,
'cycloserine'
);
abbv_names
=
strrep
(
abbv_names
,
'Carb'
,
'carbenicillin'
);
abbv_names
=
strrep
(
abbv_names
,
'Del'
,
'delamanid'
);
abbv_names
=
strrep
(
abbv_names
,
'Dau'
,
'daunorubicin'
);
abbv_names
=
strrep
(
abbv_names
,
'Nal'
,
'nalidixic acid'
);
abbv_names
=
strrep
(
abbv_names
,
'Lev'
,
'levofloxacin'
);
abbv_names
=
strrep
(
abbv_names
,
'Mox'
,
'moxifloxacin'
);
abbv_names
=
strrep
(
abbv_names
,
'Clz'
,
'clofazimine'
);
...
...
@@ -25,7 +20,6 @@ function full_names = replace_full_name(abbv_names)
abbv_names
=
strrep
(
abbv_names
,
'Kan'
,
'kanamycin'
);
abbv_names
=
strrep
(
abbv_names
,
'Amk'
,
'amikacin'
);
abbv_names
=
strrep
(
abbv_names
,
'Cam'
,
'chloramphenicol'
);
abbv_names
=
strrep
(
abbv_names
,
'AZT'
,
'azithromycin'
);
abbv_names
=
strrep
(
abbv_names
,
'Cla'
,
'clarithromycin'
);
abbv_names
=
strrep
(
abbv_names
,
'Dox'
,
'doxycycline'
);
abbv_names
=
strrep
(
abbv_names
,
'Gent'
,
'gentamicin'
);
...
...
@@ -34,17 +28,13 @@ function full_names = replace_full_name(abbv_names)
abbv_names
=
strrep
(
abbv_names
,
'Tig'
,
'tigecycline'
);
abbv_names
=
strrep
(
abbv_names
,
'Lin'
,
'linezolid'
);
abbv_names
=
strrep
(
abbv_names
,
'Pre'
,
'pretomanid'
);
% abbv_names = strrep(abbv_names, 'CCCP','carbonyl cyanide 3-chlorophenylhydrazone');
abbv_names
=
strrep
(
abbv_names
,
'Cer'
,
'cerulenin'
);
abbv_names
=
strrep
(
abbv_names
,
'Gra'
,
'gramicidin'
);
abbv_names
=
strrep
(
abbv_names
,
'Mon'
,
'monensin'
);
abbv_names
=
strrep
(
abbv_names
,
'Nig'
,
'nigericin'
);
abbv_names
=
strrep
(
abbv_names
,
'Nis'
,
'nisin'
);
abbv_names
=
strrep
(
abbv_names
,
'Tri'
,
'triclosan'
);
abbv_names
=
strrep
(
abbv_names
,
'Ver'
,
'verapamil'
);
abbv_names
=
strrep
(
abbv_names
,
'Thi'
,
'thioridazine'
);
abbv_names
=
strrep
(
abbv_names
,
'RifT'
,
'rifapentine'
);
abbv_names
=
strrep
(
abbv_names
,
'Nit'
,
'nitrofurantoin'
);
abbv_names
=
strrep
(
abbv_names
,
'Sulf'
,
'sulfamethizole'
);
abbv_names
=
strrep
(
abbv_names
,
'BDQ'
,
'bedaquiline'
);
abbv_names
=
strrep
(
abbv_names
,
'RIF'
,
'rifampicin'
);
...
...
classification_and_analysis/helper/filter_drugs.m
View file @
9a106090
...
...
@@ -11,7 +11,7 @@
%%%
%%% OUTPUT: final_data_table, with the chosen drugs removed
%%% apply , whether there are drugs to apply
%%% drug_to_apply, a subsection of the final_data_table only for the drug to apply
(correct?)
%%% drug_to_apply, a subsection of the final_data_table only for the drug to apply
%%% choice_indexes
%%% chosen chosen_drugs
%%%
...
...
@@ -68,7 +68,7 @@ chosen = chosen_drugs;
%%
% want to make them keep untreated, put in a boolean to get rid of it later
% after TVN
maybe?
% after TVN
% force user to select untreated
if
~
any
(
contains
(
chosen
,
'Untreated'
))
chosen
=
[
chosen
{
'Untreated'
}];
...
...
classification_and_analysis/helper/flatten_dose_response.m
View file @
9a106090
...
...
@@ -109,41 +109,41 @@ end
%% for Untreated, we can just put all of the untreated into one rep and call it a day
% this is just a fix for that bayes stuff right now le'ts go
if
bayesian
unt_reps
=
fieldnames
(
split_tables
.
drug
52
_doseResponse
.
Untreated
)
'
;
unt_reps
=
fieldnames
(
split_tables
.
drug
34
_doseResponse
.
Untreated
)
'
;
% add a new field for all reps
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
=
struct
;
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
=
struct
;
% want to make this flexible later but now just need to get things going
for
i
=
unt_reps
rep
=
i
{
1
};
unt3x
=
split_tables
.
drug
52
_doseResponse
.
Untreated
.
(
rep
)
.
Untreated_3x
;
unt025x
=
split_tables
.
drug
52
_doseResponse
.
Untreated
.
(
rep
)
.
Untreated_025x
;
unt3x
=
split_tables
.
drug
34
_doseResponse
.
Untreated
.
(
rep
)
.
Untreated_3x
;
unt025x
=
split_tables
.
drug
34
_doseResponse
.
Untreated
.
(
rep
)
.
Untreated_025x
;
if
strcmp
(
rep
,
"rep1"
)
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
=
unt3x
;
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
=
unt025x
;
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
=
unt3x
;
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
=
unt025x
;
else
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
=
...
vertcat
(
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
,
unt3x
);
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
=
...
vertcat
(
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
,
unt025x
);
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
=
...
vertcat
(
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
,
unt3x
);
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
=
...
vertcat
(
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
,
unt025x
);
end
split_tables
.
drug
52
_doseResponse
.
Untreated
=
...
rmfield
(
split_tables
.
drug
52
_doseResponse
.
Untreated
,
rep
);
split_tables
.
drug
34
_doseResponse
.
Untreated
=
...
rmfield
(
split_tables
.
drug
34
_doseResponse
.
Untreated
,
rep
);
end
% go replace the rep column to all have the same thing so it works on next
% step
maxlen
=
length
(
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
.
REP
);
maxlen
=
length
(
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
.
REP
);
for
i
=
1
:
maxlen
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
.
REP
(
i
)
=
...
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_025x
.
REP
(
i
)
=
...
{
'ALL'
};
split_tables
.
drug
52
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
.
REP
(
i
)
=
...
split_tables
.
drug
34
_doseResponse
.
Untreated
.
all_reps
.
Untreated_3x
.
REP
(
i
)
=
...
{
'ALL'
};
...
...
classification_and_analysis/helper/knn_color_setup.m
View file @
9a106090
...
...
@@ -12,65 +12,55 @@ map = interp1(vec,raw,linspace(100,0,N),'pchip');
%% Different drug categories
% put all drug categories in a structure
% maybe probably do something about the _025x and _3x nonsence
all_categories
=
struct
;
% want to also auto add 025x and 3x to each array
% categories that are the same regardless of large or small group
all_categories
.
rnap
=
[
"RIF"
,
"RifT"
,
"OLDRifT"
,
"rifapentine"
,
"rifampicin"
,
"rif6h"
,
"rift6h"
];
all_categories
.
dna
=
[
"
Dau"
,
"
Lev"
,
"MIT"
,
"Mox"
,
"
Nal"
,
"Olf"
,
"Sulf"
,
"Nit"
,
"Olfold"
,
"OLDMOX"
,
...
"daunorubicin"
,
"nalidixic acid"
,
"levofloxacin"
,
"moxifloxacin"
,
"mitomycin"
,
...
"ofloxacin"
,
"
nitrofurantoin"
,
"sulfamethizole"
,
"
mox6h"
];
all_categories
.
dna
=
[
"Lev"
,
"MIT"
,
"Mox"
,
"
Olf"
,
"OLDMOX"
,
...
"levofloxacin"
,
"moxifloxacin"
,
"mitomycin"
,
...
"ofloxacin"
,
"mox6h"
];
all_categories
.
control
=
[
"water"
,
"Untreated"
,
"NaOH"
,
"MeOH"
,
"EtOH"
,
"DMSO"
];
all_categories
.
unknown
=
[
"Unknown2019"
,
"Unknown2238"
,
"Unknown2239"
,
...
"Unknown
2911"
,
"Unknown3825"
,
"Unknown4050
"
,
"Unknown3285"
];
"Unknown
3825
"
,
"Unknown3285"
];
% different categories depending on fine grouping
if
large_group
all_categories
.
protein
=
[
"
AZT"
,
"
Amk"
,
"Cam"
,
"Cla"
,
"Dox"
,
"Gent"
,
"Kan"
,
"Lin"
,
"Strep"
,
"Tet"
,
"Tig"
,
...
"kanamycin"
,
"amikacin"
,
"chloramphenicol"
,
"
azithromycin"
,
"
clarithromycin"
,
...
all_categories
.
protein
=
[
"Amk"
,
"Cam"
,
"Cla"
,
"Dox"
,
"Gent"
,
"Kan"
,
"Lin"
,
"Strep"
,
"Tet"
,
"Tig"
,
...
"kanamycin"
,
"amikacin"
,
"chloramphenicol"
,
"clarithromycin"
,
...
"doxycycline"
,
"gentamicin"
,
"streptomycin"
,
"tetracycline"
,
"tigecycline"
,
...
"linezolid"
,
"lin6h"
];
all_categories
.
lipid
=
[
"Tri"
,
"Nis"
,
"Nig"
,
"Mon"
,
"Gra"
,
"CCCP"
,
"PZA"
,
"Clz"
,
"BDQ"
,
"OLDBDQ"
,
...
"OLDPZA"
,
"OLDClz"
,
"clofazimine"
,
"carbonyl cyanide 3-chlorophenylhydrazone"
,
...
"gramicidin"
,
"monensin"
,
"nigericin"
,
"nisin"
,
"triclosan"
,
"bedaquiline"
,
...
"pyrazinamide"
,
"bdq6h"
,
"pza6h"
,
"clz6h"
];
"pyrazinamide"
,
"bdq6h"
,
"pza6h"
,
"clz6h"
,
"Ver"
,
"Thi"
,
"verapamil"
,
"thioridazine"
];
% if we want to put the efflux acting drugs into the lipid category...
if
efflux_in_lipid
%...append them to the list of lipids
all_categories
.
lipid
=
[
all_categories
.
lipid
,
"Ver"
,
"Thi"
,
"verapamil"
,
"thioridazine"
];
% for simplicity, create a blank efflux array so that efflux still
% exists and won't get upset later
% exists and won't get upset later
-- outdated
all_categories
.
efflux
=
[
""
];
else
% if not, have them be their own separate array
all_categories
.
efflux
=
[
"Ver"
,
"Thi"
,
"verapamil"
,
"thioridazine"
];
end
all_categories
.
cell_wall
=
[
"A
22"
,
"Amp"
,
"Carb
"
,
"Ctax"
,
"Cyc"
,
"Del"
,
"EMB"
,
"ETA"
,
...
"IMI"
,
"INH"
,
"Mer"
,
"
Oxa"
,
"Pip"
,
"
Pre"
,
"Van"
,
"THL"
,
"Cer"
,
...
"PenG"
,
"OLDPre"
,
"OLDEMB"
,
"OLDINH"
,
...
all_categories
.
cell_wall
=
[
"A
mp
"
,
"Ctax"
,
"Cyc"
,
"Del"
,
"EMB"
,
"ETA"
,
...
"IMI"
,
"INH"
,
"Mer"
,
"Pre"
,
"Van"
,
"THL"
,
"Cer"
,
...
"OLDPre"
,
"OLDEMB"
,
"OLDINH"
,
...
"ampicillin"
,
"cefotaxime"
,
"meropenem"
,
"isoniazid"
,
"ethambutol"
,
...
"ethionamide"
,
"imipenem"
,
"piperacillin"
,
"oxacillin"
,
"penicillin G"
,
...
"vancomycin"
,
"cycloserine"
,
"
carbenicillin"
,
"
delamanid"
,
"pretomanid"
,
...
"ethionamide"
,
"imipenem"
,
...
"vancomycin"
,
"cycloserine"
,
"delamanid"
,
"pretomanid"
,
...
"cerulenin"
,
"emb6h"
,
"inh6h"
,
"pre6h"
];
%others = ["PZA", "Ver", "Thi", "Clz","BDQ"];
else
% finer settings
all_categories
.
peptidoglycan
=
[
"Mer"
,
"Amp"
,
"Ctax"
,
"IMI"
,
"
Pip"
,
"Oxa"
,
"Carb"
,
"
Van"
,
"Cyc"
,
"A22"
,
...
"meropenem"
,
"ampicillin"
,
"cefotaxime"
,
"imipenem"
,
"piperacillin"
,
"oxacillin"
,
...
"carbenicillin"
,
"vancomycin"
,
"cycloserine"
];
all_categories
.
peptidoglycan
=
[
"Mer"
,
"Amp"
,
"Ctax"
,
"IMI"
,
"Van"
,
"Cyc"
,
...
"meropenem"
,
"ampicillin"
,
"cefotaxime"
,
"imipenem"
,
...
"vancomycin"
,
"cycloserine"
];
all_categories
.
mycolic_acid
=
[
"INH"
,
"ETA"
,
"Del"
,
"EMB"
,
"Pre"
,
"THL"
,
"Cer"
,
...
"isoniazid"
,
"ethionamide"
,
"ethambutol"
,
"delamanid"
,
"pretomanid"
,
...
"cerulenin"
];
all_categories
.
s50_subunit
=
[
"
AZT"
,
"
Cla"
,
"Cam"
,
"Lin"
];
all_categories
.
s50_subunit
=
[
"Cla"
,
"Cam"
,
"Lin"
];
all_categories
.
s30_subunit
=
[
"Gent"
,
"Kan"
,
"Amk"
,
"Strep"
,
"Tet"
,
"Dox"
,
"Tig"
];
all_categories
.
atp_synthesis
=
[
"BDQ"
,
"CCCP"
,
"Clz"
,
"Gra"
,
"Mon"
,
"Nig"
,
"Nis"
,
"PZA"
];
%efflux = ["Ver","Thi"];
...
...
classification_and_analysis/helper/knn_helper.m
View file @
9a106090
...
...
@@ -9,9 +9,6 @@
% large_group - default to true
% create_graph - default to false
% create_cm -default to off
% would need knn_with_apply - maybe cut that? could make default to false
% would need tit_add if random - could make default to false
% idk this seems like a lot of inputs I don't feel gr8 about it
% outputs would be
% pct_correct
...
...
classification_and_analysis/helper/load_workspaces.m
View file @
9a106090
...
...
@@ -14,8 +14,6 @@
% on final data table (default: true)
% - (OPTIONAL) remove_extra_controls - Will remove:
% EtOH, MeOH, NaOH, water (default: true)
% - (OPTIONAL) remove_bad_treated - Will remove:
% 'IMI', 'Nal', 'Nig', 'Dau' (defualt: true)
%
% - (OPTIONAL) workspace_directory - the directory where to look for
% workspaces (default: './workspaces')
...
...
@@ -34,16 +32,6 @@
% - choice_extension - either 'DRUG' or 'DRUG_EXP' depending on var conditions
% - choice_variable - a list of either drugs or drug_exps depending on var conditions
%% TODO
% - Fix AfterTVN in this file and PCA_analysis
% - Optimize workspace loading (only load final_data_table)
%% Questions
% - Is it necessary to normalize/zero-mean merged table if going to do so
% anyways after drug filtering?
% - Why add applied drugs back in before tvn?
% - Is it ok to normalize final_data_table beforehand?
%% Generate defaults
if
~
exist
(
'remove_INH_control'
,
'var'
)
remove_INH_control
=
true
;
...
...
classification_and_analysis/helper/merged_table_setup.m
View file @
9a106090
...
...
@@ -5,7 +5,7 @@
%
% Called when using multiple workspaces in load_workspaces.m
%
% DESCRIPTION: -
*NO NOT ANYMORE* Calls normalize_and_zero_mean() on final_data table.
% DESCRIPTION: -
% - Initializes several variables which describe the data in
% the new normalized table. Many of these exist beforehand,
% we just need to make sure they reflect the concatenated
...
...
classification_and_analysis/helper/new_34drug_joint.m
View file @
9a106090
...
...
@@ -25,7 +25,6 @@ if ~exist('bayesian','var')
bayesian
=
false
;
end
% apply on 24hour timepoint workspace
apply_timepoint_drugs
=
false
;
%ALSO MUST COMMENT OUT CLUSTERGRAM SECTION OF PCA_analysis (idk lol it was throwing an error)
do_joint_profile
=
true
;
...
...
@@ -127,9 +126,6 @@ end
%% Cool table fixes
% Eventually, you'll probably want to do all these and save them in the
% workspace
% Set DRUG to drug_dose
final_data_table_3x
.
DRUG
=
strcat
(
final_data_table_3x
.
ID
,
'_3x'
);
...
...
@@ -168,7 +164,7 @@ end
final_data_table
=
[
final_data_table_025x
;
final_data_table_3x
];
% Set the EXP to the same thing so the joint profile allows them to canoodle
final_data_table
.
EXP
(:)
=
{
'drug
52
_doseResponse'
};
final_data_table
.
EXP
(:)
=
{
'drug
34
_doseResponse'
};
%% Strike fear into the eyes of the enemy and only allow those we chose to survive
%Extract only the ids that the two doses have in common
...
...
segmentation_pipeline/MicrobeJ_segmentation.m
View file @
9a106090
...
...
@@ -1187,10 +1187,7 @@ if FM_tf
end
end
%% Getting rid of outliers -- still working on best way to do this
% some outliers are egregious (ie 15 orders of magnitude too large) but
% don't want to accidentally destroy something biologically significant
% also don't have normal distributions -- quite a few lognormal-apparent
%% Getting rid of outliers
bad_bac_out
=
[];
bad_FM_out
=
[];
...
...
@@ -2245,7 +2242,7 @@ for i = drugs
stop_point
=
length
(
joined_bacteria_groups
.
(
drug
));
end
% for following sec
i
ton, we used grouped_no_nan for cell workspace and
% for following sect
i
on, we used grouped_no_nan for cell workspace and
% we use joined for img workspace. Boolean cell_mode is used to get from
% one to the other.
for
j
=
1
:
stop_point
...
...
@@ -2440,26 +2437,6 @@ end
clear
num_bacteria_rows
num_FM_rows
num_syto_rows
numeric_avg_bacteria_cols
numeric_avg_FM_cols
numeric_avg_syto_cols
drug_label
clear
new_row
bact_row
FM_row
syto_row
%~~~~~edit ends
%% *not implemented* Adds ratio of fluorescence area and cell area as another varaible in bacteria file
%%%%Should be calculated on cell by cell basis, but this works for now
%{
for
i
=
drugs
drug
=
i
{
1
};
table
=
all_data
.
(
drug
);
syto_area_percentage
=
[];
FM_area_percentage
=
[];
for
j
=
1
:
size
(
table
,
1
)
syto_area_percentage
(
j
)
=
table
{
j
,
'SHAPE_area'
}/
table
{
j
,
's_SHAPE_area'
};
FM_area_percentage
(
j
)
=
table
{
j
,
'SHAPE_area'
}/
table
{
j
,
'f_SHAPE_area'
};
end
%all_data.(drug).syto_area_percentage =
end
%}
%% Merge all tables into big final table
%create table
...
...
segmentation_pipeline/config.yml
View file @
9a106090
...
...
@@ -3,7 +3,7 @@
################################################
# MICROBEJ SEGMENTATION CONFIGURATION SETTINGS #
################################################
# Contains all the configuration needed for running
bcp_
MicrobeJ_
processing
.m
# Contains all the configuration needed for running MicrobeJ_
segmentation
.m
# Save this file as config.yml and place in the root directory of the program
metadata
:
...
...
segmentation_pipeline/segmentation_functions/printstructfun.m
View file @
9a106090
function
[
outputArg1
]
=
printstructfun
(
x
,
transverse_file
)
%function previously contained in
bcp_
MicrobeJ_
processing
with the addition
%function previously contained in MicrobeJ_
segmentation
with the addition
%of a timing function that gives the time taken to process each drug at
%what is the longest section of the code
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment