Parcourir la source

added Conformation.dissimilarity method, unfinished

Nicolas Zimmermann il y a 5 ans
Parent
révision
dc6da63651
1 fichiers modifiés avec 13 ajouts et 1 suppressions
  1. 13 1
      src/projet8.py

+ 13 - 1
src/projet8.py Voir le fichier

@@ -43,7 +43,19 @@ class Conformations:
43 43
 
44 44
         return squareform(pdist(dfnum, metric ='jaccard'))
45 45
 
46
-
46
+    def dissimilarity(self, matrix):
47
+        """
48
+        Returns a matrix of the distance between all conformations computed
49
+        according to a substitution matrix of the protein blocks.
50
+        If no substitution matrix is specified, use the matrix from the
51
+        PBxplore package.
52
+        """
53
+        dissimilarity = np.ndarray((self.df.shape[0],self.df.shape[0])) 
54
+        if matrix == None:
55
+            matrix = pd.read_table("data/PBs_substitution_matrix.dat",
56
+                                   index_col=False, sep ='\t')
57
+        matrix.index = matrix.columns
58
+        
47 59
 
48 60
 if __name__ == "__main__":
49 61
     if len(sys.argv) != 2: