Open kokyriakidis opened 4 years ago
Hi @kokyriakidis
The file names are linked with the colnames of your data, so you can just change the names of columns in your data, and the file names will be updated automatically.
You can annotate any SNP of interest by parameter highlight
, a vector containing the names of your interested SNPs, then assign the labels to parameter highlight.text
. CMplot doesn't provide the function of locating the top SNP of per chromosome and annotating automatically, that means you need to find those SNPs prior to using CMplot.
Best, LL
Hi,
Great question. I have a related one. See below my code:
Pmap.temp <- subset(dt.temp, select = c("rsid", "chromosome", "position", "frequentist_add_pvalue"))
CMplot(Pmap.temp,
plot.type = "q",
cex.lab = 1,
main = paste0("QQ plot [",var.temp,"]"),
file.output = TRUE,
# file = "jpg",
memo = paste0(PLOT_loc, "/",Today,".",PROJECTNAME,".",SUBPROJECTNAME,".",var.temp,".QQ."))
What I want is that it saves the plot at a specific location with a specific name. Now I get a message like this:
QQplot.frequentist_add_pvalue_/Users/swvanderlaan/PLINK/analyses/ucorbio/UCORBIO_7Q22/UCORBIO_7Q22.FULL/PLOTS/20200507.UCORBIO_7Q22.FULL.Gp.QQ..jpg
But I'd like it to be saved like this:
/Users/swvanderlaan/PLINK/analyses/ucorbio/UCORBIO_7Q22/UCORBIO_7Q22.FULL/PLOTS/20200507.UCORBIO_7Q22.FULL.Gp.QQ.jpg
Where the variables are like this:
PLOT_loc = /Users/swvanderlaan/PLINK/analyses/ucorbio/UCORBIO_7Q22/UCORBIO_7Q22.FULL/PLOTS/
Today = 20200507
PROJECTNAME = UCORBIO_7Q22
SUBPROJECTNAME = FULL
var.temp = Gp
How do I control this through CMplot?
Hi @swvanderlaan ,
Thanks for your good question.
Sorry that there is no parameter in CMplot can direct the path for all output files. The parameter 'memo' is designed to append a specific character at the end of each file name, aiming to avoid file overwriting. To change the file path, I would suggest to use the R function setwd()
in front of CMplot
, then change back at behind.
Best, LL
Yes, excellent suggestion. I thought of that option too. Thanks!
But are you working on a way such that we can just name the file the way we want to? So where memo = "myfavoriteplot.jpg"
and the file would be just that, myfavoriteplot.jpg
. Now I have a QQ plot with 7 traits and 7 names in the filename... while those names are also in the plot legend...
My problem is that in front of the memo name it concats a string "Rectangular-Manhattan.", e.g. "Rectangular-Manhattan.P_memo" . In the future it may be better to just display the memo
As you may know, there are various types of plots in function of CMplot
, therefore, it's hard to use one filename given by users to name all files, although it may work by providing a vector of file names, I think it would make it more complex. So by default, CMplot
uses the combination of types of plots and names of traits to be the final file names.
Hi @swvanderlaan ,
Thanks for your good question. Sorry that there is no parameter in CMplot can direct the path for all output files. The parameter 'memo' is designed to append a specific character at the end of each file name, aiming to avoid file overwriting. To change the file path, I would suggest to use the R function
setwd()
in front ofCMplot
, then change back at behind.Best, LL
Hi LL, I'm somehow facing a similar problem: I'm calling CMplot on a cluster where it does not allow users to change directories while executing a specific job. Hence a similar run for me yields this error:
setwd(marker): cannot change working directory
And also I'm using a pipeline and calling CMplot many times so it's not possible to put the script in a single directory and run from there...
Any thought on how to solve this or is it possible to add a parameter like outputdir
to the function?
Hi @Suuuuuuuus,
It sounds strange that a cluster not allows users to change directories. Are you sure the folder you entered is an valid folder? Or did you check if the folder exists? The error "cannot change working directory" usually occurs when the folder doesn't exist or wrote a wrong path.
Best, LL
Hey LL, thanks for the very fast response! I am 100% sure this is the problem with our cluster (we use slurm) because my snakemake jobs also fail when I do something like “cd ..” in the rule. I’m asking our IT people about this as well so hopefully they’ll get back to me soon :) Anyway thank you so much xD
---- Replied Message ---- | From | Lilin @.> | | Date | 09/07/2023 02:35 | | To | YinLiLin/CMplot @.> | | Cc | Sus @.>, Mention @.> | | Subject | Re: [YinLiLin/CMplot] Output file name (#26) |
Hi @Suuuuuuuus,
It sounds strange that a cluster not allows users to change directories. Are you sure the folder you entered is an valid folder? Or did you check if the folder exists? The error "cannot change working directory" usually occurs when the folder doesn't exist or wrote an wrong path.
Best, LL
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Hi @YinLiLin !
Is there a way to change output file name and not use the default
Rectangular-Manhattan.P_memo
? I want it just to printmemo
Also, can I just annotate with text only the top result per chromosome, as in qqman?