# # Cviceni 4, ukol D: molekula ve formátu MOL # def read_mol(text): pass def distance(mol, index1, index2): pass def angle(mol, index1, index2, index3): pass def torsion(data, index1, index2, index3, index4): pass def TBL(mol): pass def main(): mol = read_mol(caffeine) distance38 = distance(mol, 3, 8) angle879 = angle(mol, 8, 7, 9) torsion5978 = torsion(mol, 5, 9, 7, 8) # BONUS total_bond_length = TBL(mol) print("Vzdalenost mezi atomy 3 a 8: {}".format(distance38)) print("Vazebny uhel mezi atomy 8, 7 a 9: {}".format(angle879)) print("Torzni uhel mezi atomy 5, 9, 7 a 8: {}".format(torsion5978)) print("Celkova vazebna delka v molekule: {}".format(total_bond_length)) caffeine = """ 2519 -OEChem-10071420273D 24 25 0 0 0 0 0 0 0999 V2000 0.4700 2.5688 0.0006 O 0 0 0 0 0 0 0 0 0 0 0 0 -3.1271 -0.4436 -0.0003 O 0 0 0 0 0 0 0 0 0 0 0 0 -0.9686 -1.3125 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 2.2182 0.1412 -0.0003 N 0 0 0 0 0 0 0 0 0 0 0 0 -1.3477 1.0797 -0.0001 N 0 0 0 0 0 0 0 0 0 0 0 0 1.4119 -1.9372 0.0002 N 0 0 0 0 0 0 0 0 0 0 0 0 0.8579 0.2592 -0.0008 C 0 0 0 0 0 0 0 0 0 0 0 0 0.3897 -1.0264 -0.0004 C 0 0 0 0 0 0 0 0 0 0 0 0 0.0307 1.4220 -0.0006 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.9061 -0.2495 -0.0004 C 0 0 0 0 0 0 0 0 0 0 0 0 2.5032 -1.1998 0.0003 C 0 0 0 0 0 0 0 0 0 0 0 0 -1.4276 -2.6960 0.0008 C 0 0 0 0 0 0 0 0 0 0 0 0 3.1926 1.2061 0.0003 C 0 0 0 0 0 0 0 0 0 0 0 0 -2.2969 2.1881 0.0007 C 0 0 0 0 0 0 0 0 0 0 0 0 3.5163 -1.5787 0.0008 H 0 0 0 0 0 0 0 0 0 0 0 0 -1.0451 -3.1973 -0.8937 H 0 0 0 0 0 0 0 0 0 0 0 0 -2.5186 -2.7596 0.0011 H 0 0 0 0 0 0 0 0 0 0 0 0 -1.0447 -3.1963 0.8957 H 0 0 0 0 0 0 0 0 0 0 0 0 4.1992 0.7801 0.0002 H 0 0 0 0 0 0 0 0 0 0 0 0 3.0468 1.8092 -0.8992 H 0 0 0 0 0 0 0 0 0 0 0 0 3.0466 1.8083 0.9004 H 0 0 0 0 0 0 0 0 0 0 0 0 -1.8087 3.1651 -0.0003 H 0 0 0 0 0 0 0 0 0 0 0 0 -2.9322 2.1027 0.8881 H 0 0 0 0 0 0 0 0 0 0 0 0 -2.9346 2.1021 -0.8849 H 0 0 0 0 0 0 0 0 0 0 0 0 1 9 2 0 0 0 0 2 10 2 0 0 0 0 3 8 1 0 0 0 0 3 10 1 0 0 0 0 3 12 1 0 0 0 0 4 7 1 0 0 0 0 4 11 1 0 0 0 0 4 13 1 0 0 0 0 5 9 1 0 0 0 0 5 10 1 0 0 0 0 5 14 1 0 0 0 0 6 8 1 0 0 0 0 6 11 2 0 0 0 0 7 8 2 0 0 0 0 7 9 1 0 0 0 0 11 15 1 0 0 0 0 12 16 1 0 0 0 0 12 17 1 0 0 0 0 12 18 1 0 0 0 0 13 19 1 0 0 0 0 13 20 1 0 0 0 0 13 21 1 0 0 0 0 14 22 1 0 0 0 0 14 23 1 0 0 0 0 14 24 1 0 0 0 0 M END > 2519 > 0.4 > 1 > 15 1 -0.57 10 0.69 11 0.04 12 0.3 13 0.26 14 0.3 15 0.15 2 -0.57 3 -0.42 4 0.05 5 -0.42 6 -0.57 7 -0.24 8 0.29 9 0.71 > 0 > 5 1 1 acceptor 1 2 acceptor 3 4 6 11 cation 5 4 6 7 8 11 rings 6 3 5 7 8 9 10 rings > 14 > 0 > 0 > 0 > 0 > 0 > 1 > 1 > 000009D700000001 > 22.901 > 25.487 > 10967382 1 18338799025773621285 11132069 177 18339075025094499008 12524768 44 18342463625094026902 13140716 1 17978511158789908153 16945 1 18338517550775811621 193761 8 15816500986559935910 20588541 1 18339082691204868851 21501502 16 18338796715286957384 22802520 49 18128840606503503494 2334 1 18338516344016692929 23402539 116 18270382932679789735 23552423 10 18262240993325675966 23559900 14 18199193898169584358 241688 4 18266458702623303353 2748010 2 18266180539182415717 5084963 1 17698433339235542986 528886 8 18267580380709240570 53812653 166 18198902694142226312 66348 1 18339079396917369615 > 256.45 4.01 2.83 0.58 0.71 0.08 0 -0.48 0 -0.81 0 0.01 0 0 > 550.88 > 143.9 > 2 5 10 $$$$ """ main()