From d72e0ef441ce6b09034c0cddf50c068f3a312d33 Mon Sep 17 00:00:00 2001
From: dimit98 <dimit98@mi.fu-berlin.de>
Date: Sat, 24 Oct 2020 13:12:28 +0200
Subject: [PATCH] specter changes

---
 rules/clustering.smk |  4 ++--
 scripts/Specter.m    | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 scripts/Specter.m

diff --git a/rules/clustering.smk b/rules/clustering.smk
index e43d194..469c0c8 100644
--- a/rules/clustering.smk
+++ b/rules/clustering.smk
@@ -35,8 +35,8 @@ rule specter:
                downsampling = "0" if config["downsampling"]["downsampling_method"] =="normal" else "1"
         shell:
                """
-               cd scripts/Specter/
-               matlab -r 'n_clusters={params.number_of_clusters};ensemble_size={params.ensemble_size};mingamma={params.mingamma};downsampling=string({params.downsampling});' < Specter_demo.m 
+               cd scripts/
+               matlab -r 'n_clusters={params.number_of_clusters};ensemble_size={params.ensemble_size};mingamma={params.mingamma};downsampling=string({params.downsampling});' < Specter.m 
                """
 	
 rule clustering_specter:
diff --git a/scripts/Specter.m b/scripts/Specter.m
new file mode 100644
index 0000000..c4016a4
--- /dev/null
+++ b/scripts/Specter.m
@@ -0,0 +1,17 @@
+% load all necessary library
+addpath('Specter/dimred');
+addpath('Specter/LSC');
+addpath('Specter/utils');
+addpath('Specter');
+format short g;
+
+%% read gene expression data: rows are cells, collumns are features (PCs, genes)
+if downsampling == "0"
+  data = csvread("../file_dir/specter_pca_data_normal.csv");
+else
+  data = csvread("../file_dir/specter_pca_data_sphetcher.csv");
+end
+
+specter_labels = eval_auto_Specter(data, n_clusters, ensemble_size, mingamma);
+
+csvwrite("../file_dir/specter_clustering.csv", specter_labels);
-- 
GitLab