Re: plot

48 views
Skip to first unread message

Nicholas M. Glykos

unread,
Aug 13, 2019, 11:37:34 AM8/13/19
to Anahita Khammari, carma-molecu...@googlegroups.com

> In figure 4.a of attached paper, how could I have the plot of the proportion
> of variance versus eigenvalue rank? what are the equations to obtain the
> values of X and Y axis in mentioned plot?
> and what are the numbers on the curve? How could I calculate them?
> Which files of CARMA output could be useful to obtain those numbers?

The sum of all (eigenvectors/eigenvalues) explains the whole (100%) of variance.
What they show in this figure is the percentage of each eigenvalue compared
with the sum of all eigenvalues. The correct illustration for what they
want to show is a cumulative histogram. The way to calculate this requires
to scale all values in the carma.dPCA.eigenvalues.dat in such a way that
their sum is 100 (corresponding to 100%).

You can calculate such a plot for the unix shell as follows :



[1] Calculate the sum of all eigenvalues :

awk '{ print $1 }' carma.dPCA.eigenvalues.dat | paste -sd+ | bc



[2] Convert the eigenvalues to percentages and calculate the running sum
("4.5823868682" below is the sum you found from step [1] above) :

awk '{ val = 100.0 * $0 / 4.5823868682 ; total += val ; print val, total}' carma.dPCA.eigenvalues.dat > scaled_eigenvalues.dat



[3] Prepare the plots with your favorite program. For a quick view of the
data we usually do :

wget https://utopia.duth.gr/glykos/progs/plot
chmod 755 plot
./plot -k1 < scaled_eigenvalues.dat
./plot -k2 < scaled_eigenvalues.dat

The first plot will be the same as the figure you've mentioned, the second
plot will show the values that they have added with arrows.



Please subscribe to the carma mailing list and send all other questions to
the list and not directly to me.




--


Nicholas M. Glykos, Department of Molecular Biology
and Genetics, Democritus University of Thrace, University Campus,
Dragana, 68100 Alexandroupolis, Greece, Tel/Fax (office) +302551030620,
Ext.77620, Tel (lab) +302551030615, https://utopia.duth.gr/glykos/

Reply all
Reply to author
Forward
0 new messages