nmrproject/ILP/nmrSimilarity.py

161 lines
3.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#Also ILP? Minimize distance becuse two vectors might be shifted to oneanother (high weight on height distance to keep same height)
import gurobipy as gp
from gurobipy import GRB, Model, quicksum
#Xanthine
HXANTHINE= {
1: ([7.96], [1]),
2: ([9.45], [1]),
3: ([7.725], [1]),
4: ([7.625], [1]),
}
CXANTHINE= {
1: ([159.40], [1]),
2: ([164.01], [1]),
3: ([120.94], [1]),
4: ([161.24], [1]),
5: ([146.98], [1]),
}
#1-Methylxanthine
H1XANTHINE= {
1: ([7.93], [1]),
2: ([9.45], [1]),
3: ([4.05], [3]),
4: ([7.91], [1]),
}
C1XANTHINE= {
1: ([161.50], [1]),
2: ([166.28], [1]),
3: ([120.65], [1]),
4: ([158.74], [1]),
5: ([146.25], [1]),
6: ([38.55], [1]),
}
#3-Methylxanthine
H3XANTHINE= {
1: ([4.15], [3]),
2: ([7.73], [1]),
3: ([7.99], [1]),
4: ([9.49], [1]),
}
C3XANTHINE= {
1: ([161.83], [1]),
2: ([163.37], [1]),
3: ([121.24], [1]),
4: ([163.15], [1]),
5: ([146.49], [1]),
6: ([39.71], [1]),
}
#7-Methylxanthine
H3XANTHINE= {
1: ([7.55], [1]),
2: ([4.47], [3]),
3: ([7.72], [1]),
4: ([7.655], [1]),
}
C3XANTHINE= {
1: ([159.50], [1]),
2: ([165.47], [1]),
3: ([122.15], [1]),
4: ([162.31], [1]),
5: ([151.55], [1]),
6: ([45.06], [1]),
}
#Theophylline
H13XANTHINE= {
1: ([4.03], [3]),
2: ([7.98], [1]),
3: ([4.19], [3]),
4: ([9.49], [1]),
}
C13XANTHINE= {
1: ([163.77], [1]),
2: ([165.26], [1]),
3: ([120.73], [1]),
4: ([160.99], [1]),
5: ([145.80], [1]),
6: ([40.42], [1]),
7: ([37.60], [1]),
}
#Paraxanthine
H17XANTHINE= {
1: ([4.50], [3]),
2: ([7.70], [1]),
3: ([3.98], [3]),
4: ([7.82], [1]),
}
C17XANTHINE= {
1: ([161.41], [1]),
2: ([167.17], [1]),
3: ([121.81], [1]),
4: ([160.18], [1]),
5: ([151.09], [1]),
6: ([45.17], [1]),
7: ([36.96], [1]),
}
#Theobromine
H37XANTHINE= {
1: ([4.49], [3]),
2: ([7.75], [1]),
3: ([4.11], [3]),
4: ([7.65], [1]),
}
C37XANTHINE= {
1: ([161.76], [1]),
2: ([164.86], [1]),
3: ([122.51], [1]),
4: ([164.29], [1]),
5: ([151.10], [1]),
6: ([39.33], [1]),
7: ([45.07], [1]),
}
#Caffeine
H37XANTHINE= {
1: ([7.73], [1]),
2: ([4.15], [3]),
3: ([4.52], [3]),
4: ([4.01], [3]),
}
C37XANTHINE= {
1: ([163.66], [1]),
2: ([166.66], [1]),
3: ([122.03], [1]),
4: ([162.23], [1]),
5: ([150.50], [1]),
6: ([40.09], [1]),
7: ([45.23], [1]),
8: ([37.17], [1]),
}
#Neue Quelle für 13CNMR für beide
#Experimental 7-Methylxanthine nmr
HNMR1= {
1: ([10.85], [1]),
2: ([11.50], [1]),
3: ([3.82], [3]),
4: ([7.88], [1]),
}
#Experimental Theobromine nmr
HNMR1= {
1: ([11.10], [1]),
2: ([3.33], [3]),
3: ([3.84], [3]),
4: ([7.97], [1]),
}
def build_model(name, nmrnode, nmrmeasured, excluded_support=None):
model = Model(name)
#Maximize likelihood or minimize Deviation
#Values for two spectra and optimize largest for both different?
#Spectra in Nodes to allow maximize overlapp with both spectra or one spectra.
#5.4.2 Eliminating XH signals from 1H NMR spectra