Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
surjray-repos committed Aug 23, 2019
1 parent 064f580 commit 56c9c1c
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
generate_joint_plot_of_tree_donut_muller_and_errors(U, clust, Mutant_Frequencies_M, Ugt, clustgt);

% generate a list of top 10 trees ranked by their probabilities according to our assumed model
generate_list_of_top_k_trees_with_probabilities(10,top_k_value, max_tree_size, min_tree_size, error_rate, ourcode_all_Ms, ourcode_output);
generate_list_of_top_k_trees_with_probabilities(10, top_k_value, max_tree_size, min_tree_size, error_rate, ourcode_all_Ms, ourcode_output);
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,67 +10,71 @@
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.

%% Skeleton code demonstrating the calculation of standard deviation among the results of the four error types for the various tools
%% Calculates of standard deviation among the results of the four error types for the various tools
% The tools have been run on the the simulated data provided in the
% AncesTree paper. The results have been contrasted against ground truth
% provided in the same paper to calculate the errors.

phylowgs_exact_mean_error = mean(all_four_errors_phylowgs_exact,2);
phylowgs_exact_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_exact_mean_error_std(i,1) = std(all_four_errors_phylowgs_exact(i,:))/sqrt(size(all_four_errors_phylowgs_exact,2));
end
function compare_algs_real_data[phylowgs_exact_mean_error, phylowgs_exact_mean_error_std, phylowgs_citup_mean_error, phylowgs_citup_mean_error_std, phylowgs_exact_mean_error_std ] = compute_means_and_std_of_error_for_all_tools_vs_all_tools(all_four_errors_phylowgs_exact, all_four_errors_phylowgs_exact, all_four_errors_phylowgs_citup)

phylowgs_citup_mean_error = mean(all_four_errors_phylowgs_citup,2);
phylowgs_citup_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_citup_mean_error_std(i,1) = std(all_four_errors_phylowgs_citup(i,:))/sqrt(size(all_four_errors_phylowgs_citup,2));
end
phylowgs_exact_mean_error = mean(all_four_errors_phylowgs_exact,2);
phylowgs_exact_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_exact_mean_error_std(i,1) = std(all_four_errors_phylowgs_exact(i,:))/sqrt(size(all_four_errors_phylowgs_exact,2));
end

phylowgs_ancestree_mean_error = mean(all_four_errors_phylowgs_ancestree,2);
phylowgs_ancestree_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_ancestree_mean_error_std(i,1) = std(all_four_errors_phylowgs_ancestree(i,:))/sqrt(size(all_four_errors_phylowgs_ancestree,2));
end
phylowgs_citup_mean_error = mean(all_four_errors_phylowgs_citup,2);
phylowgs_citup_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_citup_mean_error_std(i,1) = std(all_four_errors_phylowgs_citup(i,:))/sqrt(size(all_four_errors_phylowgs_citup,2));
end

exact_citup_mean_error = mean(all_four_errors_exact_citup,2);
exact_citup_mean_error_std = zeros(4,1);
for i = 1:4
exact_citup_mean_error_std(i,1) = std(all_four_errors_exact_citup(i,:))/sqrt(size(all_four_errors_exact_citup,2));
end
phylowgs_ancestree_mean_error = mean(all_four_errors_phylowgs_ancestree,2);
phylowgs_ancestree_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_ancestree_mean_error_std(i,1) = std(all_four_errors_phylowgs_ancestree(i,:))/sqrt(size(all_four_errors_phylowgs_ancestree,2));
end

exact_ancestree_mean_error = mean(all_four_errors_exact_ancestree,2);
exact_ancestree_mean_error_std = zeros(4,1);
for i = 1:4
exact_ancestree_mean_error_std(i,1) = std(all_four_errors_exact_ancestree(i,:))/sqrt(size(all_four_errors_exact_ancestree,2));
end
exact_citup_mean_error = mean(all_four_errors_exact_citup,2);
exact_citup_mean_error_std = zeros(4,1);
for i = 1:4
exact_citup_mean_error_std(i,1) = std(all_four_errors_exact_citup(i,:))/sqrt(size(all_four_errors_exact_citup,2));
end

citup_ancestree_mean_error = mean(all_four_errors_citup_ancestree,2);
citup_ancestree_mean_error_std = zeros(4,1);
for i = 1:4
citup_ancestree_mean_error_std(i,1) = std(all_four_errors_citup_ancestree(i,:))/sqrt(size(all_four_errors_citup_ancestree,2));
end
exact_ancestree_mean_error = mean(all_four_errors_exact_ancestree,2);
exact_ancestree_mean_error_std = zeros(4,1);
for i = 1:4
exact_ancestree_mean_error_std(i,1) = std(all_four_errors_exact_ancestree(i,:))/sqrt(size(all_four_errors_exact_ancestree,2));
end

phylowgs_canopy_mean_error = mean(all_four_errors_phylowgs_canopy,2);
phylowgs_canopy_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_canopy_mean_error_std(i,1) = std(all_four_errors_phylowgs_canopy(i,:))/sqrt(size(all_four_errors_phylowgs_canopy,2));
end
citup_ancestree_mean_error = mean(all_four_errors_citup_ancestree,2);
citup_ancestree_mean_error_std = zeros(4,1);
for i = 1:4
citup_ancestree_mean_error_std(i,1) = std(all_four_errors_citup_ancestree(i,:))/sqrt(size(all_four_errors_citup_ancestree,2));
end

exact_canopy_mean_error = mean(all_four_errors_exact_canopy,2);
exact_canopy_mean_error_std = zeros(4,1);
for i = 1:4
exact_canopy_mean_error_std(i,1) = std(all_four_errors_exact_canopy(i,:))/sqrt(size(all_four_errors_exact_canopy,2));
end
phylowgs_canopy_mean_error = mean(all_four_errors_phylowgs_canopy,2);
phylowgs_canopy_mean_error_std = zeros(4,1);
for i = 1:4
phylowgs_canopy_mean_error_std(i,1) = std(all_four_errors_phylowgs_canopy(i,:))/sqrt(size(all_four_errors_phylowgs_canopy,2));
end

citup_canopy_mean_error = mean(all_four_errors_citup_canopy,2);
citup_canopy_mean_error_std = zeros(4,1);
for i = 1:4
citup_canopy_mean_error_std(i,1) = std(all_four_errors_citup_canopy(i,:))/sqrt(size(all_four_errors_citup_canopy,2));
end
exact_canopy_mean_error = mean(all_four_errors_exact_canopy,2);
exact_canopy_mean_error_std = zeros(4,1);
for i = 1:4
exact_canopy_mean_error_std(i,1) = std(all_four_errors_exact_canopy(i,:))/sqrt(size(all_four_errors_exact_canopy,2));
end

citup_canopy_mean_error = mean(all_four_errors_citup_canopy,2);
citup_canopy_mean_error_std = zeros(4,1);
for i = 1:4
citup_canopy_mean_error_std(i,1) = std(all_four_errors_citup_canopy(i,:))/sqrt(size(all_four_errors_citup_canopy,2));
end

ancestree_canopy_mean_error = mean(all_four_errors_ancestree_canopy,2);
ancestree_canopy_mean_error_std = zeros(4,1);
for i = 1:4
ancestree_canopy_mean_error_std(i,1) = std(all_four_errors_ancestree_canopy(i,:))/sqrt(size(all_four_errors_ancestree_canopy,2));
end

ancestree_canopy_mean_error = mean(all_four_errors_ancestree_canopy,2);
ancestree_canopy_mean_error_std = zeros(4,1);
for i = 1:4
ancestree_canopy_mean_error_std(i,1) = std(all_four_errors_ancestree_canopy(i,:))/sqrt(size(all_four_errors_ancestree_canopy,2));
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
% Copyright (c) 2019 Surjyendu Ray
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.

%% Function to plot the inferred trees from PhyloWGS output along with their respective fitting cost

% INPUTS:
% phylowgs_output is a matlab cell object having 3 components.
% Each component is a cell object indexed by sol_id, which lists different good solutions.
% The number of solutions that PhyloWGS outputs is given by how many different sol_id indices there are in the output
% phylowgs_output{1}{sol_id} = adjacency matrix for the sol_id th output tree. This is a directed tree. If we have this matrix T, then U = inv(I - T), where U appears in the PPM model as F = UM.
% phylowgs_output{2}{sol_id} = cluster membership information for the clustering. An array with 2 columns, the 2nd column designating the cluster ID, and the 1st column designating the mutation that belongs to that cluster
% phylowgs_output{3}{sol_id} = frequencies of the input, after mutations have been clustered, helps in obtaining clustered frequencies of mutants.


function generate_list_of_PhyloWGS_trees(phylowgs_output)

figure;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
function generate_list_of_top_k_trees_with_probabilities(display_top_k,top_k_value, max_tree_size, min_tree_size, error_rate, ourcode_all_Ms, ourcode_output)
% Copyright (c) 2019 Surjyendu Ray
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.

%% Function to plot the inferred trees from EXACT output along with their respective probabilities

% INPUT
% display_top_k = how many top scoring inferred trees we want as output in the plot
% top_k_value =



function generate_list_of_top_k_trees_with_probabilities(display_top_k, top_k_value, max_tree_size, min_tree_size, error_rate, ourcode_all_Ms, ourcode_output)

figure;

Expand Down

0 comments on commit 56c9c1c

Please sign in to comment.