I have maybe more technical question than code-related. I try to perform PCA (with MDAnalysis package) with only PDB file - this pdb file contain 100 aligned structures (which are, of course, same - it means same type and amount of atoms; it was done in PyMol).
I use my previously made code for PCA with standard trajectories, but it returns error "No covariance information can be gathered from asingle trajectory frame."
Thus, my hypotesis is that PCA cant be done only using PDB files or it could be, but I dont have right pdb-inputs. I would like to know if there is someone, who has ever tried something like this or has good experience with MDAnalysis and could give me any suggestions (I am new to computational chemistry).
Code is, I think, not so much needed, however I attach it:
import matplotlib.pyplot as plt
import MDAnalysis as mda
from MDAnalysis.analysis.pca import PCA
import numpy as np
u = mda.Universe("mypdb.pdb")
ca = u.select_atoms('name CA')
pca = PCA(u, select='name CA').run()
n_pcs = np.where(pca.cumulated_variance > 0.95)[0][0]
reduced_data = pca.transform(ca, n_components=n_pcs)
plt.plot(pca.variance, "-o")