can PCA and Cross-correlation images that are in pdf file format can open in xmgrace?

Issue #349 resolved
Former user created an issue

i am using your code for PCA and cross-correlation analysis and it saves the files in pdf format. i want to ask you is it possible that this code can open into xmgrace? if it is possible then please give me an example. i am desperately waiting for your answer Best Regards Thankyou

Comments (15)

  1. Lars Skjærven

    Hi, The output of both the PCA and DCCM is not in PDF format but R data structures. You can however certainly save corresponding plots in PDF format. To open the results of both PCA and DCCM in xmgrace you'll have to outout the results in a format that xmgrace will understand, i.e. a formatted text file. See functions write.table or write.csv for more information on how to do that. That said, I'm not sure why you would want to plot in xmgrace instead of R... ?

  2. Xinqiu Yao

    Hi,

    Bio3D does not support Xmgrace directly. There are a lot other figure format you can use, e.g. pdf, tiff, png, bmp, jpeg, etc. Simply type help(XX) (where XX is the function name like 'pdf') to get information about how to use them. Alternatively, you can plot on screen and save it to pdf by the command dev.copy2pdf(). Let me know if this helps you.

  3. Ayesha kanwal

    Hi, Dear Xin-Qui Yao , i want while i am running code for PCA the plot graph image open in xmgrace . how can make it possible ? i know Bio3D does not support Xmgrace directly but in which way i can make it possible ?

  4. Ayesha kanwal

    hi Bary Grant , what would be the best possibility to convert it into graceplot format .agr or dat ? Although i know Bio3D does not directly export to xmgrace. But i want to convert it because its my project requirement. kindly help me .

  5. Lars Skjærven

    did you check out functions write.table and similar to output to a formatted text file which xmgrace can read?

  6. Ayesha kanwal

    Dear Lars skjaerven, i didn't read write.table. you also told me about this in your first email but that i didn't get your point now i read it and if there is any confusion then i'll let you know . thanks

  7. Ayesha kanwal

    Hi, i read it but i cannot understand how can i convert my dcd and pdb (pca and cross-correlation) plot results that are generated in a pdf format can change into graceplot format ? as i read the example of write.table. nothing is clear to me :(

  8. Barry Grant

    We do not understand what you are attempting to accomplish. If you are having problems with graceplot or xmgrace then please ask on their help forum.

    Again - as written above - using R you can write your result data to a file using the write.table() function. This could them be opened with another program.
    Here is an example of writing a cij matrix to such a text file (in this case tab separated).

    > library(bio3d)
    > pdb <- read.pdb("4q21")
      Note: Accessing on-line PDB file
      HEADER    ONCOGENE PROTEIN                        25-SEP-91   4Q21
    > modes <- nma(pdb)
     Building Hessian...        Done in 0.066 seconds.
     Diagonalizing Hessian...   Done in 0.344 seconds.
    > cij <- dccm(modes)
      |======================================================================| 100%
    > write.table(cij, file="MyOutput.txt", quote=FALSE, sep="\t", row.names=FALSE, col.names=FALSE)
    
  9. Ayesha kanwal

    Hi, i have only an issue that while using Bio3D R package that is used to calculate PCA and cross-correlation etc. i want to plot graph output format into grace file format e.g in .agr format or .dat format not in pdf format. i want that i can visualize graph in grace interface. but i could not found how i can make it possible.

  10. Ayesha kanwal

    Hi, if i want to write table of pc it gave the following error

    write.table(pc, file="pc.txt", sep="\t")
    Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : 
      cannot coerce class ""pca"" to a data.frame
    

    how can i resolve this issue ?

  11. Lars Skjærven

    pc from functions pca() or pca.xyz() is a list object while write.table() expects a matrix or data frame. To proceed and resolve this problem you need to read about R data structures, principal component analysis in bio3d, and the write.table function.

    Relevant documentation:

    See also the New to R? section under http://thegrantlab.org/bio3d/user-guide

  12. Log in to comment