def test_interc(c1,c2,join_options,graph,ends,linked):
    os1=oscaffold[c1]
    os1_mine = (args.fromS <= os1) and (os1 < args.endS)
    if not os1_mine: return([-100])
    #        print "test interc",c1,c2,oscaffold[c1],oscaffold[c2],ends[oscaffold[c1]],ends[oscaffold[c2]],linked.get(c1),linked.get(c2),len(linked.keys())
    if False:
        for free_end in ends[scaffold[c1]]:
            for c2_end in [c2+".5",c2+".3"]:
                if c2_end in linked:
                    #                    print 1,free_end,c2_end
                    try:
                        gs.test_interc_option( c2_end, linked[c2_end], free_end, join_options, graph )
                    except Exception as e:
                        print("c2_end=",c2_end,"--",linked[c2_end],free_end)
                        print(e)
                        raise Exception('too connected 1')
    for free_end in ends[scaffold[c2]]:
        for c1_end in [c1+".5",c1+".3"]:
            if c1_end in linked:
                #                    print 2,free_end,c1_end
                try:
                    gs.test_interc_option( c1_end, linked[c1_end], free_end, join_options, graph )
                except Exception as e:
                    print("c1_end=",c1_end,"--",linked[c1_end],free_end)
                    print(e)
                    raise Exception('too connected 2')

    if len(join_options)>0:
        join_options.sort(reverse=True)
        #            print join_options
        return(join_options[0])
    return([-100.0])
Example #2
0
def test_interc(c1, c2, join_options, graph, ends, linked):
    os1 = oscaffold[c1]
    os1_mine = (args.fromS <= os1) and (os1 < args.endS)
    if not os1_mine: return ([-100])
    #        print "test interc",c1,c2,oscaffold[c1],oscaffold[c2],ends[oscaffold[c1]],ends[oscaffold[c2]],linked.get(c1),linked.get(c2),len(linked.keys())
    if False:
        for free_end in ends[scaffold[c1]]:
            for c2_end in [c2 + ".5", c2 + ".3"]:
                if c2_end in linked:
                    #                    print 1,free_end,c2_end
                    try:
                        gs.test_interc_option(c2_end, linked[c2_end], free_end,
                                              join_options, graph)
                    except Exception as e:
                        print("c2_end=", c2_end, "--", linked[c2_end],
                              free_end)
                        print(e)
                        raise Exception('too connected 1')
    for free_end in ends[scaffold[c2]]:
        for c1_end in [c1 + ".5", c1 + ".3"]:
            if c1_end in linked:
                #                    print 2,free_end,c1_end
                try:
                    gs.test_interc_option(c1_end, linked[c1_end], free_end,
                                          join_options, graph)
                except Exception as e:
                    print("c1_end=", c1_end, "--", linked[c1_end], free_end)
                    print(e)
                    raise Exception('too connected 2')

    if len(join_options) > 0:
        join_options.sort(reverse=True)
        #            print join_options
        return (join_options[0])
    return ([-100.0])
Example #3
0
def test_interc(c1, c2, join_options, graph, ends, linked, slen,
                max_interc_len):
    os1 = oscaffold.get(c1, -1)
    #os1_mine = (args.fromS <= os1) and (os1 < args.endS)
    #if not os1_mine: return([-100])
    #print "test interc:",c1,c2,oscaffold.get(c1,0),oscaffold.get(c2,0) ,ends[scaffold[c1]],ends[scaffold[c2]]#,c2_end in linked, c1_end in linked #,linked.get(c1),linked.get(c2),len(linked.keys())
    print("test interc:", c1, c2, scaffold[c1], scaffold[c2],
          ends[scaffold[c1]], ends[scaffold[c2]])
    if slen[scaffold[c1]] < max_interc_len:
        for free_end in ends[scaffold[c1]]:
            for c2_end in [c2 + ".5", c2 + ".3"]:
                #                print "c2_end in linked:",c2_end,c2_end in linked
                if c2_end in linked:
                    print(1, free_end, c2_end)
                    try:
                        gs.test_interc_option(c2_end, linked[c2_end], free_end,
                                              join_options, graph)
                    except Exception as e:
                        print("c2_end=", c2_end, "--", linked[c2_end],
                              free_end)
                        print(e)
                        raise Exception('too connected 1')
    if slen[scaffold[c2]] < max_interc_len:
        for free_end in ends[scaffold[c2]]:
            for c1_end in [c1 + ".5", c1 + ".3"]:
                #                print "c1_end in linked:",c1_end,c1_end in linked
                if c1_end in linked:
                    print(2, free_end, c1_end)
                    try:
                        gs.test_interc_option(c1_end, linked[c1_end], free_end,
                                              join_options, graph)
                    except Exception as e:
                        print("c1_end=", c1_end, "--", linked[c1_end],
                              free_end)
                        print(e)
                        raise Exception('too connected 2')

    if len(join_options) > 0:
        join_options.sort(reverse=True)
        print("join options:", join_options)
        return (join_options[0])
    return ([-100.0])
def test_interc(c1,c2,join_options,graph,ends,linked,slen,max_interc_len):
    os1=oscaffold.get(c1,-1)
    #os1_mine = (args.fromS <= os1) and (os1 < args.endS)
    #if not os1_mine: return([-100])
    #print "test interc:",c1,c2,oscaffold.get(c1,0),oscaffold.get(c2,0) ,ends[scaffold[c1]],ends[scaffold[c2]]#,c2_end in linked, c1_end in linked #,linked.get(c1),linked.get(c2),len(linked.keys())
    print("test interc:", c1,c2,scaffold[c1],scaffold[c2],ends[scaffold[c1]],ends[scaffold[c2]])
    if slen[scaffold[c1]] < max_interc_len: 
        for free_end in ends[scaffold[c1]]:
            for c2_end in [c2+".5",c2+".3"]:
#                print "c2_end in linked:",c2_end,c2_end in linked
                if c2_end in linked:
                    print(1,free_end,c2_end)
                    try:
                        gs.test_interc_option( c2_end, linked[c2_end], free_end, join_options, graph )
                    except Exception as e:
                        print("c2_end=",c2_end,"--",linked[c2_end],free_end)
                        print(e)
                        raise Exception('too connected 1')
    if slen[scaffold[c2]] < max_interc_len:
        for free_end in ends[scaffold[c2]]:
            for c1_end in [c1+".5",c1+".3"]:
#                print "c1_end in linked:",c1_end,c1_end in linked
                if c1_end in linked:
                    print(2,free_end,c1_end)
                    try:
                        gs.test_interc_option( c1_end, linked[c1_end], free_end, join_options, graph )
                    except Exception as e:
                        print("c1_end=",c1_end,"--",linked[c1_end],free_end)
                        print(e)
                        raise Exception('too connected 2')

    if len(join_options)>0:
        join_options.sort(reverse=True)
        print("join options:",join_options)
        return(join_options[0])
    return([-100.0])