contact_map
contact_map copied to clipboard
ContactFrequency to pandas dataframe
Dear all,
I really like using ContactMap Explorer! I was wandering if there is a way to create a pandas dataframe out of a ContactFrequency calculation.
Like:
traj=mdt.load('trajectory.h5')
peptide = topology.select('chainid 1 and element != "H"')
protein = topology.select('chainid 0 and resid 77 or resid 124 or resid 130 or resid 137 and element != "H"')
contacts = ContactFrequency(traj, query=peptide, haystack=protein, cutoff=0.45)
df=pd.DataFrame(contacts)
where the query would be the columns and the haystack the rows or the other way round, doesn't matter.
Thanks for your effort! Have a nice day.