You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I would like to highlight multiple fingerprint, and for this I am doing the following:
def getSubstructDepiction(mol,atomID,radius,molSize=(450,200)):
if radius>0:
env = Chem.FindAtomEnvironmentOfRadiusN(mol,radius,atomID)
atomsToUse=[]
for b in env:
atomsToUse.append(mol.GetBondWithIdx(b).GetBeginAtomIdx())
atomsToUse.append(mol.GetBondWithIdx(b).GetEndAtomIdx())
atomsToUse = list(set(atomsToUse))
else:
atomsToUse = [atomID]
env=None
return atomsToUse
def depictBit(bitId,mol,molSize=(450,200)):
info={}
fp = AllChem.GetMorganFingerprintAsBitVect(mol,radius=2,nBits=2048,bitInfo=info,useFeatures=True)
aid,rad = info[bitId][0]
return getSubstructDepiction(mol,aid,rad,molSize=molSize)
And Now I want to put different colors for example to fp 666 and 966:
First at all just for check if the first function turns the highlight fragment correctly for this fingerprints I can do the next:
fingerprint_bits_1 = depictBit(666, b) # [18, 21, 22, 23, 24, 25]
fingerprint_bits_2 = depictBit(966, b) #[10, 3, 5, 6]
So in the above image I can see that everything works correctly. However if, I try to use different color with the following code:
The result is not exactly than the two images above:
Could you help me please?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions