Beispiel #1
0
def __drawOrigCoords(origCoords):
    """Display the original pre-rotamerize coordinates as a generic object
    
    ARGUMENTS:
        origCoords - a chain object containing the atoms to be drawn
    RETURNS:
        drawNum - the generic object number
    EFFECTS:
        creates and displays a new Coot generic object
    """

    #create a new generic display object
    drawNum = new_generic_object_number("Pre-rotamerize coordinates")
    set_display_generic_object(drawNum, 1)

    lineList = []  #a list of all the bonds to be drawn

    #draw bonds for each nucleotide
    prevO3 = None
    for curNuc in origCoords.nucs:

        #draw each bond if both atoms are present
        for (atom1, atom2) in (BOND_LIST_FULL["backbone"] +
                               BOND_LIST_FULL[curNuc.type]):
            if curNuc.hasAtom(atom1) and curNuc.hasAtom(atom2):
                atom1Coords = curNuc.atoms[atom1]
                atom2Coords = curNuc.atoms[atom2]
                lineList.append(atom1Coords + atom2Coords)

        #draw a bond between O5' and the previous phosphate if both atoms are present
        if prevO3 is not None and curNuc.hasAtom("P"):
            lineList.append(prevO3 + curNuc.atoms["P"])

        #update prevPhos
        if curNuc.hasAtom("O3'"):
            prevO3 = curNuc.atoms["O3'"]
        else:
            prevO3 = None

    #actually draw the bonds
    for curLine in lineList:
        to_generic_object_add_line(drawNum, ORIG_COORDS_COLOR, 6, *curLine)
    graphics_draw()

    return drawNum
Beispiel #2
0
def __drawOrigCoords(origCoords):
    """Display the original pre-rotamerize coordinates as a generic object
    
    ARGUMENTS:
        origCoords - a chain object containing the atoms to be drawn
    RETURNS:
        drawNum - the generic object number
    EFFECTS:
        creates and displays a new Coot generic object
    """
    
    #create a new generic display object
    drawNum = new_generic_object_number("Pre-rotamerize coordinates")
    set_display_generic_object(drawNum, 1)
    
    lineList = [] #a list of all the bonds to be drawn
    
    #draw bonds for each nucleotide
    prevO3 = None
    for curNuc in origCoords.nucs:
        
        #draw each bond if both atoms are present
        for (atom1, atom2) in (BOND_LIST_FULL["backbone"] + BOND_LIST_FULL[curNuc.type]):
            if curNuc.hasAtom(atom1) and curNuc.hasAtom(atom2):
                atom1Coords = curNuc.atoms[atom1]
                atom2Coords = curNuc.atoms[atom2]
                lineList.append(atom1Coords + atom2Coords)
        
        #draw a bond between O5' and the previous phosphate if both atoms are present
        if prevO3 is not None and curNuc.hasAtom("P"):
            lineList.append(prevO3 + curNuc.atoms["P"])
        
        #update prevPhos
        if curNuc.hasAtom("O3'"):
            prevO3 = curNuc.atoms["O3'"]
        else:
            prevO3 = None
    
    #actually draw the bonds
    for curLine in lineList:
        to_generic_object_add_line(drawNum, ORIG_COORDS_COLOR, 6, *curLine)
    graphics_draw()
    
    return drawNum
def cluster_star_obj(obj, pos, thick, v_0):

    delta_0 = v_0
    delta_r2 = delta_0 / math.sqrt(2)
    delta_r3 = delta_0 / math.sqrt(3)
    delta = delta_r3

    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] + delta, pos[1] + delta, pos[2] + delta
    )
    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] - delta, pos[1] - delta, pos[2] - delta
    )
    delta = delta_0
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] - delta, pos[1], pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0], pos[1] - delta, pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0], pos[1], pos[2] - delta)
    delta = delta_r2
    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0], pos[1] - delta, pos[2] - delta
    )
    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] - delta, pos[1] - delta, pos[2]
    )
    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] - delta, pos[1], pos[2] - delta
    )

    delta = delta_0
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] + delta, pos[1], pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0], pos[1] + delta, pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0], pos[1], pos[2] + delta)
    delta = delta_r2
    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0], pos[1] + delta, pos[2] + delta
    )
    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] + delta, pos[1] + delta, pos[2]
    )
    coot.to_generic_object_add_line(
        obj, "yellowtint", thick, pos[0], pos[1], pos[2], pos[0] + delta, pos[1], pos[2] + delta
    )
Beispiel #4
0
def cluster_star_obj(obj, pos, thick, v_0):

    delta_0 = v_0
    delta_r2 = delta_0 / math.sqrt(2)
    delta_r3 = delta_0 / math.sqrt(3)
    delta = delta_r3

    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] + delta, pos[1] + delta,
                                    pos[2] + delta)
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] - delta, pos[1] - delta,
                                    pos[2] - delta)
    delta = delta_0
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] - delta, pos[1], pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0], pos[1] - delta, pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0], pos[1], pos[2] - delta)
    delta = delta_r2
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0], pos[1] - delta,
                                    pos[2] - delta)
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] - delta, pos[1] - delta,
                                    pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] - delta, pos[1],
                                    pos[2] - delta)

    delta = delta_0
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] + delta, pos[1], pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0], pos[1] + delta, pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0], pos[1], pos[2] + delta)
    delta = delta_r2
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0], pos[1] + delta,
                                    pos[2] + delta)
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] + delta, pos[1] + delta,
                                    pos[2])
    coot.to_generic_object_add_line(obj, "yellowtint", thick, pos[0], pos[1],
                                    pos[2], pos[0] + delta, pos[1],
                                    pos[2] + delta)