def __get_prd_for_scaffold(self, prd_file_name): for e1id, e2id, D, weight, delta in saveparser.prd(prd_file_name): if (e1id, e2id) not in self.prd: e1 = self.graph.es[e1id] e2 = self.graph.es[e2id] if len(e1.v2.out) != 0 or len(e2.v1.inn) != 0: continue if D - e1.len > 0 and D - e1.len < self.d: if (e1id, e2id) not in self.prd_for_scaffold: self.prd_for_scaffold[(e1id, e2id)] = [] self.prd_for_scaffold[(e1id, e2id)].append((D, weight, delta))
def __get_additional_prd(self, prd_file_name): for e1id, e2id, D, weight, delta in saveparser.prd(prd_file_name): if (e1id, e2id) not in self.prd: e1= self.graph.es[e1id] e2 = self.graph.es[e2id] if len(e1.v2.out) != 0 or len(e2.v1.inn) != 0: continue e1_len = e1.len if D - e1_len > 0 and D - e1_len < 100: if (e1id, e2id) not in self.additional_prd: self.additional_prd[(e1id, e2id)] = [] self.additional_prd[(e1id, e2id)].append((D, weight, delta))
def __get_prd_for_scaffold(self, prd_file_name): for e1id, e2id, D, weight, delta in saveparser.prd(prd_file_name): if (e1id, e2id) not in self.prd: e1 = self.graph.es[e1id] e2 = self.graph.es[e2id] if len(e1.v2.out) != 0 or len(e2.v1.inn) != 0: continue if D - e1.len > 0 and D - e1.len < self.d: if (e1id, e2id) not in self.prd_for_scaffold: self.prd_for_scaffold[(e1id, e2id)] = [] self.prd_for_scaffold[(e1id, e2id)].append( (D, weight, delta))
def __use_prd(self, prd_filename, config): for e1id, e2id, D, weight, delta in saveparser.prd(prd_filename): e1 = self.graph.es[e1id] e2 = self.graph.es[e2id] if (e1, e2) not in self.rectangles: # there' no possible rectangles between e1 and e2 continue r = self.rectangles[(e1, e2)] for diag in r.diagonals.itervalues(): diag.inc_prd_support(D, weight, delta, config) if diag != diag.conj: diag.conj.inc_prd_support( D - e1.len + e2.len, weight, delta, config ) # TODO: check if prd is symmetric or not
def __use_prd(self, prd_filename, config): for e1id, e2id, D, weight, delta in saveparser.prd(prd_filename): e1 = self.graph.es[e1id] e2 = self.graph.es[e2id] if ( e1, e2 ) not in self.rectangles: # there' no possible rectangles between e1 and e2 continue r = self.rectangles[(e1, e2)] for diag in r.diagonals.itervalues(): diag.inc_prd_support(D, weight, delta, config) if diag != diag.conj: diag.conj.inc_prd_support( D - e1.len + e2.len, weight, delta, config) # TODO: check if prd is symmetric or not
def __get_prd(self, prd_file_name): for e1id, e2id, D, weight, delta in saveparser.prd(prd_file_name): self.prd[(e1id, e2id)] = (D, weight, delta + 2)
def __get_prd(self, prd_file_name): for e1id, e2id, D, weight, delta in saveparser.prd(prd_file_name): if (e1id, e2id) not in self.prd: self.prd[(e1id, e2id)] = [] self.prd[(e1id, e2id)].append((D, weight, delta))