EuracBiomedicalResearch / FamAgg

This is the development version of the FamAgg Bioconductor package.
https://EuracBiomedicalResearch.github.io/FamAgg
MIT License
0 stars 2 forks source link

Argument "main=" not used/causes error in plotPed #16

Closed the-x-at closed 5 years ago

the-x-at commented 6 years ago

According to the documentation of plotPed, argument main should be passed on to doPlotPed, where it is explicitly listed as an argument (main=NULL). Using this argument results in undesired behavior, as demonstrated by the following example:

library(FamAgg)
data("minnbreast")
family <- minnbreast[minnbreast$famid==4, ]
mbped <- family[, c("famid", "id", "fatherid", "motherid", "sex")]
colnames(mbped) <- c("family", "id", "father", "mother", "sex")
fad <- FAData(pedigree=mbped)
switchPlotfun("haplopaint")
plotPed(fad, family=4, device="png", filename="~/works.png")
## "Error in expected number of arguments!"
plotPed(fad, family=4, device="png", main="My title", filename="~/error.png")
switchPlotfun("ks2paint")
## String "My title" does not show up in image.
plotPed(fad, family=4, device="png", main="My title", filename="~/works-a-bit.png")

FamAgg version 1.8.0 was used.

jorainer commented 6 years ago

passing main down to haplopaint with the -family parameter. Will check if that needs eventually special formatting.

jorainer commented 6 years ago

OK, plot.pedigree from the kinship2 package simply ignores the main parameter. No way we can define a title in plots created with that (will change the documentation on that).

Re haplopaint, I am now quoting the -family command line parameter. It should work now (version 1.9.1), but I can't verify because haplopaint is missing a lot of dependencies on my system - @the-x-at can you please check?

the-x-at commented 6 years ago

The haplopainter script expects a family number as parameter to option -family. This will not work for supplying generic text. I checked the haplopainter source, there is no way to add a plot title from the command line. It can only be done in the GUI with Options->Configuration->Ped & Case Info->Title.

Now, that neither haplopainter nor the kinship2 plotting functions accept a title, I recommend to remove option main= from the plotting options for doPlotPed.

Alternatively, I could modify haplopainter source code to accept an option -title.

jorainer commented 6 years ago

OK, then I'll remove the main parameter.

jorainer commented 6 years ago

Done in https://github.com/EuracBiomedicalResearch/FamAgg/commit/ef11e8ab02d5f72bc2d61926f98af4551930824f