Esempio n. 1
0
def generate_canonical_rotamer_residues_phipsi(residue_name3, target_phi_psi):
    raise NotImlementedError
    canonical_residue = generate_canonical_residue(residue_name3)
    test_sequence = "AAX[%s]AA" % residue_name3
    target_phi, target_psi = target_phi_psi
    sf = get_score_function()
    tryrot = TryRotamers(resnum=3,
                         scorefxn=sf,
                         explosion=0,
                         jump_num=0,
                         clash_check=True,
                         solo_res=False,
                         include_current=False)
    test_pose = Pose()
    make_pose_from_sequence(test_pose, test_sequence, "fa_standard")
    for i in range(1, test_pose.size() + 1):
        test_pose.set_psi(i, target_psi)
        test_pose.set_phi(i, target_phi)
        test_pose.set_omega(i, 180)
    tryrot.setup_rotamer_set(test_pose)
    rotamer_set = tryrot.rotamer_set()
    # print('rotamer_set.num_rotamers()',
    # residue_name3, target_phi_psi, rotamer_set.num_rotamers())
    rotamers = [
        rotamer_set.rotamer(i).clone()
        for i in range(1,
                       rotamer_set.num_rotamers() + 1)
    ]
    for r in rotamers:
        r.orient_onto_residue(canonical_residue)
        r.seqpos(1)
    return rotamers
Esempio n. 2
0
def pose_from_sequence(seq, res_type="fa_standard", auto_termini=True):
    """
    Returns a pose generated from a single-letter sequence of amino acid
    residues in <seq> using the <res_type> ResidueType and creates N- and C-
    termini if <auto_termini> is set to True.

    Unlike make_pose_from_sequence(), this method generates a default PDBInfo
    and sets all torsion angles to 180 degrees.

    Example:
        pose = pose_from_sequence("THANKSEVAN")
    See also:
        Pose
        make_pose_from_sequence()
        pose_from_file()
        pose_from_rcsb()
    """
    pose = Pose()
    make_pose_from_sequence(pose, seq, res_type, auto_termini)
    #print 'Setting phi, psi, omega...'
    for i in range(0, pose.total_residue()):
        res = pose.residue(i + 1)
        if not res.is_protein() or res.is_peptoid() or res.is_carbohydrate():
            continue

        pose.set_phi(i + 1, 180)
        pose.set_psi(i + 1, 180)
        pose.set_omega(i + 1, 180)
    #print 'Attaching PDBInfo...'
    # Empty PDBInfo (rosetta.core.pose.PDBInfo()) is not correct here;
    # we have to reserve space for atoms....
    pose.pdb_info(rosetta.core.pose.PDBInfo(pose))
    pose.pdb_info().name(seq[:8])
    # print pose
    return pose