def test_ResidueRelatrix_1A2P(): rr = ResidueRelatrix('1A2P', rosetta_scripts_path, rosetta_database_path, min_clustal_cut_off = 80, cache_dir = '/home/oconchus/temp') rosetta_id_1 = 79 # Single jumps forward assert(rosetta_id_1 == 79) atom_id_1 = rr.convert('A', rosetta_id_1, 'rosetta', 'atom') assert(atom_id_1 == 'A 81 ') seqres_id_1 = rr.convert('A', atom_id_1, 'atom', 'seqres') assert(seqres_id_1 == 81) uniparc_id_1 = rr.convert('A', seqres_id_1, 'seqres', 'uniparc') assert(uniparc_id_1 == (u'UPI000013432A', 128)) # Double/triple jumps forward seqres_id_2 = rr.convert('A', rosetta_id_1, 'rosetta', 'seqres') assert(seqres_id_2 == 81) uniparc_id_2 = rr.convert('A', rosetta_id_1, 'rosetta', 'uniparc') assert(uniparc_id_2 == (u'UPI000013432A', 128)) # Double jumps forward uniparc_id_3 = rr.convert('A', atom_id_1, 'atom', 'uniparc') assert(uniparc_id_3 == (u'UPI000013432A', 128)) # Single jumps backward seqres_id_3 = rr.convert('A', uniparc_id_1, 'uniparc', 'seqres') assert(seqres_id_3 == 81) atom_id_2 = rr.convert('A', seqres_id_3, 'seqres', 'atom') assert(atom_id_2 == 'A 81 ') rosetta_id_2 = rr.convert('A', atom_id_2, 'atom', 'rosetta') assert(rosetta_id_2 == 79) # Double/triple jumps backward atom_id_3 = rr.convert('A', uniparc_id_1, 'uniparc', 'atom') assert(atom_id_3 == 'A 81 ') rosetta_id_3 = rr.convert('A', uniparc_id_1, 'uniparc', 'rosetta') assert(rosetta_id_3 == 79) rosetta_id_4 = rr.convert('A', seqres_id_3, 'seqres', 'rosetta') assert(rosetta_id_4 == 79) assert(rosetta_id_1 == rosetta_id_2 and rosetta_id_2 == rosetta_id_3 and rosetta_id_3 == rosetta_id_4) assert(atom_id_1 == atom_id_2 and atom_id_2 == atom_id_3) assert(seqres_id_1 == seqres_id_2 and seqres_id_2 == seqres_id_3) assert(uniparc_id_1 == uniparc_id_2 and uniparc_id_2 == uniparc_id_3) # Rosetta residue 3 maps to 'A 5 ' #print(rr.rosetta_to_atom_sequence_maps) assert(rr.convert_from_rosetta(3, 'atom') == 'A 5 ') assert(rr.convert_from_rosetta(3, 'seqres') == 5) assert(rr.convert_from_rosetta(3, 'uniparc') == (u'UPI000013432A', 52))
def test_ResidueRelatrix_1A2C(): # Rosetta residue 45 -> 'A 44A' is an insertion residue which does not appear in the UniParc sequence rr = ResidueRelatrix('1A2C', rosetta_scripts_path, rosetta_database_path, min_clustal_cut_off = 80, cache_dir = '/home/oconchus/temp', starting_clustal_cut_off = 82) rosetta_id_1 = 157 chain_id = rr.convert_from_rosetta(rosetta_id_1, 'atom')[0] # Single jumps forward atom_id_1 = rr.convert(chain_id, rosetta_id_1, 'rosetta', 'atom') assert(atom_id_1 == 'H 124 ') seqres_id_1 = rr.convert(chain_id, atom_id_1, 'atom', 'seqres') assert(seqres_id_1== 121) uniparc_id_1 = rr.convert(chain_id, seqres_id_1, 'seqres', 'uniparc') assert(uniparc_id_1 == (u'UPI0000136ECD', 484)) # Double/triple jumps forward seqres_id_2 = rr.convert(chain_id, rosetta_id_1, 'rosetta', 'seqres') uniparc_id_2 = rr.convert(chain_id, rosetta_id_1, 'rosetta', 'uniparc') # Double jumps forward uniparc_id_3 = rr.convert(chain_id, atom_id_1, 'atom', 'uniparc') # Single jumps backward seqres_id_3 = rr.convert(chain_id, uniparc_id_1, 'uniparc', 'seqres') atom_id_2 = rr.convert(chain_id, seqres_id_2, 'seqres', 'atom') rosetta_id_2 = rr.convert(chain_id, atom_id_2, 'atom', 'rosetta') # Double/triple jumps backward atom_id_3 = rr.convert(chain_id, uniparc_id_1, 'uniparc', 'atom') rosetta_id_3 = rr.convert(chain_id, uniparc_id_1, 'uniparc', 'rosetta') rosetta_id_4 = rr.convert(chain_id, seqres_id_2, 'seqres', 'rosetta') assert(rosetta_id_1 == rosetta_id_2 and rosetta_id_2 == rosetta_id_3 and rosetta_id_3 == rosetta_id_4) assert(atom_id_1 == atom_id_2 and atom_id_2 == atom_id_3) assert(seqres_id_1 == seqres_id_2 and seqres_id_2 == seqres_id_3) assert(uniparc_id_1 == uniparc_id_2 and uniparc_id_2 == uniparc_id_3)