示例#1
0
 def __init__(self,
              UnitigGraph,
              breakpoint_penalty=1,
              data_penalty=1,
              trash_penalty=1,
              expected_value_penalty=1,
              infer_c=None,
              infer_d=None,
              default_ploidy=2):
     SequenceGraphLpProblem.__init__(self)
     self.graph = UnitigGraph
     self.breakpoint_penalty = breakpoint_penalty
     self.data_penalty = data_penalty
     self.trash_penalty = trash_penalty
     self.expected_value_penalty = expected_value_penalty
     self.expected_ploidy = {}
     for para in UnitigGraph.paralogs.iterkeys():
         if para == "Notch2NL-C" and infer_c is not None:
             self.expected_ploidy[para] = infer_c
         elif para == "Notch2NL-D" and infer_d is not None:
             self.expected_ploidy[para] = infer_d
         else:
             self.expected_ploidy[para] = default_ploidy
     # list of Block objects
     self.blocks = []
     # maps Block objects to the paralogs they contain
     self.block_map = {x: [] for x in UnitigGraph.paralogs.iterkeys()}
     self._build_blocks(UnitigGraph, infer_c, infer_d)
 def __init__(self, Avals, Bvals, windowSize, stepSize, breakpoint_penalty, data_penalty, deletion_penalty):
     aStart = 146152644-3000
     bStart = 148603586-3000
     aStop = 146233816+4000
     bStop = 148684557+4000
     SequenceGraphLpProblem.__init__(self)
     self.windows = []
     for aPos, bPos in izip(xrange(aStart, aStop - windowSize, stepSize),
                            xrange(bStart, bStop - windowSize, stepSize)):
         A = [y for x, y in Avals if x >= aPos and y < aPos]
         B = [y for x, y in Bvals if x >= bPos and y < bPos]
         self.windows.append([aPos, bPos, Window(A, B)])
     self.build_model(breakpoint_penalty, data_penalty, deletion_penalty)
 def __init__(self, Avals, Bvals, windowSize, stepSize, breakpoint_penalty,
              data_penalty, deletion_penalty):
     aStart = 146152644 - 3000
     bStart = 148603586 - 3000
     aStop = 146233816 + 4000
     bStop = 148684557 + 4000
     SequenceGraphLpProblem.__init__(self)
     self.windows = []
     for aPos, bPos in izip(xrange(aStart, aStop - windowSize, stepSize),
                            xrange(bStart, bStop - windowSize, stepSize)):
         A = [y for x, y in Avals if x >= aPos and y < aPos]
         B = [y for x, y in Bvals if x >= bPos and y < bPos]
         self.windows.append([aPos, bPos, Window(A, B)])
     self.build_model(breakpoint_penalty, data_penalty, deletion_penalty)
    def __init__(self, deBruijnGraph, normalizing, breakpointPenalty=15, dataPenalty=1, tightness=1, inferC=None, 
                 inferD=None, defaultPloidy=2.0):
        SequenceGraphLpProblem.__init__(self)
        self.blocks = []
        self.block_map = {x[0]: [] for x in deBruijnGraph.paralogs}
        self.offset_map = {x[0]: int(x[1]) for x in deBruijnGraph.paralogs}

        self.normalizing = normalizing
        self.breakpointPenalty = breakpointPenalty
        self.dataPenalty = dataPenalty
        self.tightness = tightness
        self.inferC = inferC
        self.inferD = inferD
        self.defaultPloidy = defaultPloidy

        self.buildBlocks(deBruijnGraph)
        self.G = deBruijnGraph
示例#5
0
 def __init__(self, UnitigGraph, breakpoint_penalty=1, data_penalty=1, trash_penalty=1, expected_value_penalty=1,
              infer_c=None, infer_d=None, default_ploidy=2):
     SequenceGraphLpProblem.__init__(self)
     self.graph = UnitigGraph
     self.breakpoint_penalty = breakpoint_penalty
     self.data_penalty = data_penalty
     self.trash_penalty = trash_penalty
     self.expected_value_penalty = expected_value_penalty
     self.expected_ploidy = {}
     for para in UnitigGraph.paralogs.iterkeys():
         if para == "Notch2NL-C" and infer_c is not None:
             self.expected_ploidy[para] = infer_c
         elif para == "Notch2NL-D" and infer_d is not None:
             self.expected_ploidy[para] = infer_d
         else:
             self.expected_ploidy[para] = default_ploidy
     # list of Block objects
     self.blocks = []
     # maps Block objects to the paralogs they contain
     self.block_map = {x: [] for x in UnitigGraph.paralogs.iterkeys()}
     self._build_blocks(UnitigGraph, infer_c, infer_d)
示例#6
0
    def __init__(self,
                 deBruijnGraph,
                 normalizing,
                 breakpointPenalty=15,
                 dataPenalty=1,
                 tightness=1,
                 inferC=None,
                 inferD=None,
                 defaultPloidy=2.0):
        SequenceGraphLpProblem.__init__(self)
        self.blocks = []
        self.block_map = {x[0]: [] for x in deBruijnGraph.paralogs}
        self.offset_map = {x[0]: int(x[1]) for x in deBruijnGraph.paralogs}

        self.normalizing = normalizing
        self.breakpointPenalty = breakpointPenalty
        self.dataPenalty = dataPenalty
        self.tightness = tightness
        self.inferC = inferC
        self.inferD = inferD
        self.defaultPloidy = defaultPloidy

        self.buildBlocks(deBruijnGraph)
        self.G = deBruijnGraph