meyer-lab-cshl / plinkQC

R package for quality control of plink genetic datasets
Other
55 stars 28 forks source link

plot was not created #35

Closed montenegrina closed 3 years ago

montenegrina commented 4 years ago

Describe the bug A clear and concise description of what the bug is. The plot mentioned bellow: Step-by-step: Individuals with discordant sex information in https://cran.r-project.org/web/packages/plinkQC/vignettes/plinkQC.pdf was not created! I am running the mentioned command and I am getting Rplots.pdf but when I try to open it it says hat the file is damaged. I am using R 3.6.3

I am creating a basic plot in R and saving it as .pdf and it works:

pdf("Myplot.pdf") plot(x = 1:10, y = 1:10) dev.off() pdf 2

To Reproduce Provide a minimal example of what you re trying to do. If you rely on some external data, please provide a link to a small, sample dataset.

library(plinkQC) indir <- getwd() qcdir <-getwd() name='data' path2plink <- "/projects/plink" package.dir <-find.package('plinkQC')

fail_sex <-check_sex(indir=indir, qcdir=qcdir, name=name, interactive=FALSE,verbose=TRUE, path2plink=path2plink)

Expected behavior A clear and concise description of what you expected to happen.

Error messages Show the error messages received when executing the steps outlined above.

fail_sex <-check_sex(indir=indir, qcdir=qcdir, name=name, interactive=TRUE,verbose=TRUE, path2plink=path2plink) Run check_sex via plink --check-sex PLINK v1.90b6.12 64-bit (28 Oct 2019) www.cog-genomics.org/plink/1.9/ (C) 2005-2019 Shaun Purcell, Christopher Chang GNU General Public License v3 Logging to /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data.log. Options in effect: --bfile /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data --check-sex --out /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data

128528 MB RAM detected; reserving 64264 MB for main workspace. 437855 variants loaded from .bim file. 1777 people (814 males, 963 females) loaded from .fam. Using 1 thread (no multithreaded calculations invoked). Before main variant filters, 1777 founders and 0 nonfounders present. Calculating allele frequencies... done. Warning: 36546 het. haploid genotypes present (see /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data.hh ); many commands treat these as missing. Total genotyping rate is 0.973208. 437855 variants and 1777 people pass filters and QC. Note: No phenotypes present. --check-sex: 9750 Xchr and 0 Ychr variant(s) scanned, 5 problems detected. Report written to /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data.sexcheck .

fail_sex <-check_sex(indir=indir, qcdir=qcdir, name=name, interactive=FALSE,verbose=TRUE, path2plink=path2plink) Run check_sex via plink --check-sex PLINK v1.90b6.12 64-bit (28 Oct 2019) www.cog-genomics.org/plink/1.9/ (C) 2005-2019 Shaun Purcell, Christopher Chang GNU General Public License v3 Logging to /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data.log. Options in effect: --bfile /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data --check-sex --out /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data

128528 MB RAM detected; reserving 64264 MB for main workspace. 437855 variants loaded from .bim file. 1777 people (814 males, 963 females) loaded from .fam. Using 1 thread (no multithreaded calculations invoked). Before main variant filters, 1777 founders and 0 nonfounders present. Calculating allele frequencies... done. Warning: 36546 het. haploid genotypes present (see /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data.hh ); many commands treat these as missing. Total genotyping rate is 0.973208. 437855 variants and 1777 people pass filters and QC. Note: No phenotypes present. --check-sex: 9750 Xchr and 0 Ychr variant(s) scanned, 5 problems detected. Report written to /projects/com_grassim/anamaria/anamaria/anamaria/GOKIND/75327/PhenoGenotypeFiles/RootStudyConsentSet_phs000018.GAIN_GoKinD.v2.p1.c1.DS-T1DCR-IRB/GenotypeFiles/Output/test/qcdir/data.sexcheck .

Please complete the following information):

Additional context Add any other context about the problem here.

HannahVMeyer commented 3 years ago

apologies, I missed this issue. In the command above, you specify interactive=FALSE, so it will not create the plot automatically. You can set interactive=TRUE to plot the result while running the function. In either case, you can access the plot from the results object fail_sex$p_sexcheck, documented in the Value section of the function accessible via ?check_sex.

HannahVMeyer commented 3 years ago

I am going to close this issue now. Feel free to reopen if still needed.