diff --git a/rules/clustering.smk b/rules/clustering.smk
index e43d1941014af96f27c7a438245e07214f2c8b89..469c0c8489d7376b50d04e43c19487f4094f6cc3 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 0000000000000000000000000000000000000000..c4016a4034d1952532331bf14b1947c086ea6d4e
--- /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);