From dc6da63651a798fd2e3ff32ef26cfeea3293261a Mon Sep 17 00:00:00 2001 From: Nicolas Zimmermann Date: Tue, 17 Sep 2019 01:13:58 +0200 Subject: [PATCH] added Conformation.dissimilarity method, unfinished --- src/projet8.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/projet8.py b/src/projet8.py index 17f06e6..b4c6819 100644 --- a/src/projet8.py +++ b/src/projet8.py @@ -43,7 +43,19 @@ class Conformations: return squareform(pdist(dfnum, metric ='jaccard')) - + def dissimilarity(self, matrix): + """ + Returns a matrix of the distance between all conformations computed + according to a substitution matrix of the protein blocks. + If no substitution matrix is specified, use the matrix from the + PBxplore package. + """ + dissimilarity = np.ndarray((self.df.shape[0],self.df.shape[0])) + if matrix == None: + matrix = pd.read_table("data/PBs_substitution_matrix.dat", + index_col=False, sep ='\t') + matrix.index = matrix.columns + if __name__ == "__main__": if len(sys.argv) != 2: