Regarding more frequent tick marks for cij plot (plot.dccm)
Hello,
I have found this question helpful, issue 339, but perhaps I'm overlooking something.
I have toggled with the 'plot.dccm.R' function from the new_funs/ repository, however I cannot seem to find a way to add tick marks to the default plot. I too work with the HIV protease, however, I would like to have more tick marks on the 198 x 198 contour plot instead of just the marks at (1) 50, 100, 150, (200). I'm looking to add tickmarks at ever 10 or 20 residues instead of every 50 for example.
I've only toggled with one section of code, maybe I'm not working with the correct portion.
##-- Customized axis tick labels
if(!is.null(resno)) {
if(is.pdb(resno)) {
## Take Calpha residue numbers from PDB input
ca.inds <- atom.select(resno, "calpha", verbose = FALSE)
resno <- resno$atom$resno[ca.inds$atom]
}
if(length(resno) != nrow(x)) {
warning("Length of input 'resno' does not equal the length of input 'x'; Ignoring 'resno'")
resno=NULL
}
}
xy.at <- pretty(seq_along(x[1, ]))
xy.at <- xy.at[xy.at <= ncol(x)]
xy.at[1] <- 1
if(is.null(resno)) {
scales <- list(at=xy.at, labels=xy.at)
} else {
labs <- resno[xy.at]
labs[is.na(labs)] <- ""
scales <- list(at=xy.at, labels=labs)
}
Is this perhaps something that should be done with the scales() argument?
Comments (7)
-
-
reporter This works perfectly! Thank you. However, when I try to use the 'margin.segments' argument to plot the community annotations there is a minor issue in that the tickmarks/numbers end in 'NA' on the axis.
I hope you can see the attached photos.
-
Sorry, I don't see the photos... How did you add the 'margin.segments' argument?
-
reporter Hi,
I use the argument 'margin.segments = net$communities$membership'. When I do not adjust the tickmarks this works fine and places the annotations correctly on the side. When I do adjust the tickmarks and use this argument, the tickmarks become skewed such that everything after 95 becomes 1, 6, 11, 16...NA as the final tickmark label.
-
Sorry, I can't reproduce the problem with the example from
help(plot.dccm)
. Could you please provide sample files along with the command you used to plot? I guess a DCCM matrix and a net object should be sufficient. They can be stored in the same '.RData' file. You can send them directly to xinqyao@umich.edu, if you don't mind. -
reporter Hi,
I was just going to email you all the files but I seemed to have figured out the issue as I was walking the the steps to send in the email!!!!! As it turns out, I was using plot.dccm(cij, reso=pdb, sse=sse, margin.segments=dmnnet$communities$membership) which for some reason was leading to my issue. However, when I remove the 'resno' argument, everything works fine.
I thank you for your willingness to help me! You all are great in a great lab!
-
- changed status to resolved
- Log in to comment
Hi,
You are looking at the right section of codes. Simply modify the xy.at before setting up 'scales'. For example, putting the line
xy.at <- seq(0, ncol(x), 10)
just after 'xy.at[1] <- 1' should give a plot with ticking every 10 residues. Let me know if it works.