diff --git a/.gitignore b/.gitignore index c7a2117..8963550 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ vagrantDNA/.Rproj.user*/* .Rproj.user vagrantDNA.Rcheck *zarr + diff --git a/vagrantDNA/.Rproj.user/7A513094/build_options b/vagrantDNA/.Rproj.user/7A513094/build_options deleted file mode 100644 index 4089afd..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/build_options +++ /dev/null @@ -1,7 +0,0 @@ -auto_roxygenize_for_build_and_reload="0" -auto_roxygenize_for_build_package="1" -auto_roxygenize_for_check="1" -live_preview_website="0" -makefile_args="" -preview_website="1" -website_output_format="all" diff --git a/vagrantDNA/.Rproj.user/7A513094/cpp-definition-cache b/vagrantDNA/.Rproj.user/7A513094/cpp-definition-cache deleted file mode 100644 index 0637a08..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/cpp-definition-cache +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/pcs/debug-breakpoints.pper b/vagrantDNA/.Rproj.user/7A513094/pcs/debug-breakpoints.pper deleted file mode 100644 index 4893a8a..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/pcs/debug-breakpoints.pper +++ /dev/null @@ -1,5 +0,0 @@ -{ - "debugBreakpointsState": { - "breakpoints": [] - } -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/pcs/files-pane.pper b/vagrantDNA/.Rproj.user/7A513094/pcs/files-pane.pper deleted file mode 100644 index 345cb45..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/pcs/files-pane.pper +++ /dev/null @@ -1,9 +0,0 @@ -{ - "sortOrder": [ - { - "columnIndex": 2, - "ascending": true - } - ], - "path": "~/Documents/GitHub/pseudogene_quantification/vagrantDNA/man" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/pcs/source-pane.pper b/vagrantDNA/.Rproj.user/7A513094/pcs/source-pane.pper deleted file mode 100644 index a528f3b..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/pcs/source-pane.pper +++ /dev/null @@ -1,3 +0,0 @@ -{ - "activeTab": -1 -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/pcs/windowlayoutstate.pper b/vagrantDNA/.Rproj.user/7A513094/pcs/windowlayoutstate.pper deleted file mode 100644 index 83b56bb..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/pcs/windowlayoutstate.pper +++ /dev/null @@ -1,14 +0,0 @@ -{ - "left": { - "splitterpos": 326, - "topwindowstate": "HIDE", - "panelheight": 780, - "windowheight": 818 - }, - "right": { - "splitterpos": 512, - "topwindowstate": "NORMAL", - "panelheight": 818, - "windowheight": 856 - } -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/pcs/workbench-pane.pper b/vagrantDNA/.Rproj.user/7A513094/pcs/workbench-pane.pper deleted file mode 100644 index f398270..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/pcs/workbench-pane.pper +++ /dev/null @@ -1,5 +0,0 @@ -{ - "TabSet1": 3, - "TabSet2": 3, - "TabZoom": {} -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/rmd-outputs b/vagrantDNA/.Rproj.user/7A513094/rmd-outputs deleted file mode 100644 index 3f2ff2d..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/rmd-outputs +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/vagrantDNA/.Rproj.user/7A513094/saved_source_markers b/vagrantDNA/.Rproj.user/7A513094/saved_source_markers deleted file mode 100644 index 2b1bef1..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/saved_source_markers +++ /dev/null @@ -1 +0,0 @@ -{"active_set":"","sets":[]} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/11029130 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/11029130 deleted file mode 100644 index 9fc5e93..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/11029130 +++ /dev/null @@ -1,7 +0,0 @@ -{ - "tempName": "Untitled1", - "source_window_id": "", - "Source": "Source", - "cursorPosition": "0,0", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/226D24EC b/vagrantDNA/.Rproj.user/7A513094/sources/prop/226D24EC deleted file mode 100644 index 3fa202b..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/226D24EC +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "2,14", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/2A7477B2 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/2A7477B2 deleted file mode 100644 index 26bb3b8..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/2A7477B2 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "1,0", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/34134B3A b/vagrantDNA/.Rproj.user/7A513094/sources/prop/34134B3A deleted file mode 100644 index 867a219..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/34134B3A +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "26,55", - "scrollLine": "19" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/3A25F4D4 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/3A25F4D4 deleted file mode 100644 index d886a6a..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/3A25F4D4 +++ /dev/null @@ -1,7 +0,0 @@ -{ - "tempName": "Untitled1", - "source_window_id": "", - "Source": "Source", - "cursorPosition": "6,70", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/4A6A260D b/vagrantDNA/.Rproj.user/7A513094/sources/prop/4A6A260D deleted file mode 100644 index bb27690..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/4A6A260D +++ /dev/null @@ -1,4 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/6EF926F2 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/6EF926F2 deleted file mode 100644 index 3fe2168..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/6EF926F2 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "0,46", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/7405AB0C b/vagrantDNA/.Rproj.user/7A513094/sources/prop/7405AB0C deleted file mode 100644 index 6dbe7bd..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/7405AB0C +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "10,0", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/78A8D4E0 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/78A8D4E0 deleted file mode 100644 index bba92df..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/78A8D4E0 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "76,44", - "scrollLine": "58" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/85B4FDB3 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/85B4FDB3 deleted file mode 100644 index 968cd8a..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/85B4FDB3 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "29,101", - "scrollLine": "21" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/B16DB1CA b/vagrantDNA/.Rproj.user/7A513094/sources/prop/B16DB1CA deleted file mode 100644 index 7beb6c0..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/B16DB1CA +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "31,0", - "scrollLine": "23" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/C5CE1899 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/C5CE1899 deleted file mode 100644 index 6aedcb1..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/C5CE1899 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "10,36", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/E473D4B6 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/E473D4B6 deleted file mode 100644 index e1b2f2f..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/E473D4B6 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "13,49", - "scrollLine": "0" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/EAFBB325 b/vagrantDNA/.Rproj.user/7A513094/sources/prop/EAFBB325 deleted file mode 100644 index a78b1b9..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/EAFBB325 +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_window_id": "", - "Source": "Source", - "cursorPosition": "49,0", - "scrollLine": "34" -} \ No newline at end of file diff --git a/vagrantDNA/.Rproj.user/7A513094/sources/prop/INDEX b/vagrantDNA/.Rproj.user/7A513094/sources/prop/INDEX deleted file mode 100644 index 4b99359..0000000 --- a/vagrantDNA/.Rproj.user/7A513094/sources/prop/INDEX +++ /dev/null @@ -1,17 +0,0 @@ -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FLICENSE="6EF926F2" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2FDESCRIPTION="7405AB0C" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2FNAMESPACE="226D24EC" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2FR%2FDivergence_Estimate.R="E473D4B6" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2FR%2FGet%20raw%20data.R="11029130" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2FR%2FRainbow_Plot.R="78A8D4E0" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fdata-raw%2FDATASET.R="C5CE1899" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fdata-raw%2FhopperDF.Rd="4FB6B84A" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fman%2FdivEst.Rd="EAFBB325" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fman%2FhopperDF.Rd="34134B3A" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fman%2FhopperFX.Rd="368C6292" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fman%2FhumanDF.Rd="B16DB1CA" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fman%2FparrotDF.Rd="85B4FDB3" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fman%2FparrotFX.Rd="FCF222AA" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Fman%2FrainbowPlot.Rd="4A6A260D" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Ftests%2Ftestthat%2Ftest_rainbowPlot.R="3A25F4D4" -~%2FDocuments%2FGitHub%2Fpseudogene_quantification%2FvagrantDNA%2Ftests%2Ftestthat.R="2A7477B2" diff --git a/vagrantDNA/.Rproj.user/shared/notebooks/patch-chunk-names b/vagrantDNA/.Rproj.user/shared/notebooks/patch-chunk-names deleted file mode 100644 index e69de29..0000000 diff --git a/vagrantDNA/.Rproj.user/shared/notebooks/paths b/vagrantDNA/.Rproj.user/shared/notebooks/paths deleted file mode 100644 index 16af313..0000000 --- a/vagrantDNA/.Rproj.user/shared/notebooks/paths +++ /dev/null @@ -1,11 +0,0 @@ -/home/hbecher/git_repos/2211-ctnnb1-project/code/01exploreData.R="AA0E783C" -/home/hbecher/git_repos/high-dimensional-stats-r/_episodes_rmd/04-principal-component-analysis.Rmd="8A47267B" -/home/hbecher/git_repos/pseudogene_quantification/vagrantDNA/DESCRIPTION="945CB5B9" -/home/hbecher/git_repos/pseudogene_quantification/vagrantDNA/R/Rainbow_Plot.R="809289D1" -/home/hbecher/git_repos/pseudogene_quantification/vagrantDNA/R/interceptPositionPlot.R="38AB3092" -/home/hbecher/git_repos/pseudogene_quantification/vagrantDNA/R/selAllPlot.R="CB217457" -/home/hbecher/git_repos/stat_rethinking_2022/scripts_animation/08_MCMC.r="A17BF693" -/home/hbecher/temp/numtSim/01sim.R="6BA3B498" -/home/hbecher/temp/numtSim/07transformData.R="6691BFB8" -/home/hbecher/temp/numtSim/10runRainbow.R="786925B5" -/home/hbecher/temp/numtSim/11runRainbow2.R="2898F751" diff --git a/vagrantDNA/DESCRIPTION b/vagrantDNA/DESCRIPTION index 3a34fa5..58d3d5c 100644 --- a/vagrantDNA/DESCRIPTION +++ b/vagrantDNA/DESCRIPTION @@ -1,7 +1,7 @@ Package: vagrantDNA Type: Package Title: Estimating the proportion of vagrant DNA in a genome -Version: 1.1.0 +Version: 1.1.1 Author: Richard Nichols and Hannes Becher Maintainer: The package maintainer Description: The package two functions rainbowPlot and divEst. They produce two different estimates of the proportion of DNA from a particular vagrant genome. They exploit low coverge data from multiple individuals in which the vagrant DNA has taken residence (see Becher and Nichols 2022). diff --git a/vagrantDNA/R/Rainbow_Plot.R b/vagrantDNA/R/Rainbow_Plot.R index eed3da5..0f62eb1 100644 --- a/vagrantDNA/R/Rainbow_Plot.R +++ b/vagrantDNA/R/Rainbow_Plot.R @@ -82,12 +82,13 @@ #' ## plot and printout (by default) the results of running rainbowPlot on the parrot data. #' rainbowPlot(parrotDF, seed = 12345, title = "Parrot") #' ## -#' ## plot without printing the results and store results in res1. -#' res1 <- rainbowPlot(parrotDF, seed = 12345, printout = FALSE, title = "Parrot") -#' ## print just the stored estimates (the first two elements of the list) -#' print(res1[1:2]) -#' ## Inspect the residuals of the lmer model -#' plot(res1$lmer.model) +#' ## plot without printing the results and store results in parrotFit +#' parrotFit <- rainbowPlot(parrotDF, seed = 12345, printout = FALSE, title = "Parrot") +#' ## Inspect relationship between intercepts and SNP location +#' interceptPositionPlot(parrotFit) +#' ## Inspect mapping depth of nuclear insert allele across samples +#' selAllPlot(parrotDF, parrotFit) +#' #' @export rainbowPlot <- function(data, nloci = 400, @@ -322,7 +323,7 @@ rainbowPlot <- function(data, if (printout) { cat('Intercept based on ', numgoodloci, 'SNP loci \n') cat('Estimate: ', signif(intercepts[1],3), '\n') - cat('Confindence Interval: ', + cat('Confidence Interval: ', signif(intercepts[2],3), '-', signif(intercepts[3],3), diff --git a/vagrantDNA/R/selAllPlot.R b/vagrantDNA/R/selAllPlot.R index ad52f8c..0144e79 100644 --- a/vagrantDNA/R/selAllPlot.R +++ b/vagrantDNA/R/selAllPlot.R @@ -16,7 +16,7 @@ #' selAllPlot(humanDF) # overall alt allele counts #' selAllPlot(humanDF, humanFit) # alt allele count at loci selected for fit #' } -selAllPlot <- function(dd,ff,ylim=c(0, 10),...){ +selAllPlot <- function(dd,ff,ylim=c(0, 10),ylab="Allele count",...){ if(hasArg(ff)){ posString <- rownames(coef(summary(ff$lmer.model))) sites <- substr(posString, 9, 20) @@ -24,6 +24,7 @@ selAllPlot <- function(dd,ff,ylim=c(0, 10),...){ boxplot(pDat$DP * exp(pDat$ylog) ~ pDat$Sample, main="Alt. allele count at selected loci", ylim=ylim, + ylab=ylab, ...) goodDatMeds <- round(as.numeric(tapply(pDat$DP * exp(pDat$ylog), pDat$Sample, function(x) boxplot.stats(x)$stats[3]))) if(sum(goodDatMeds < 2) > length(goodDatMeds)/2) warning("The majority of individuals have a median alternate allele depth of 1. This suggests that vagrant DNA proportion or the sequencing depth may be insufficient for an accurate estimate. Consider using more WGS data if possible.") @@ -31,6 +32,7 @@ selAllPlot <- function(dd,ff,ylim=c(0, 10),...){ boxplot(dd$DP * exp(dd$ylog) ~ dd$Sample, main="Alt. allele count at all loci", ylim=ylim, + ylab=ylab, ...) cat("Plot shows alt allels counts for all loci. Supply rainbowPlot object to show only selected loci.\n") goodDatMeds <- round(as.numeric(tapply(dd$DP * exp(dd$ylog), dd$Sample, function(x) boxplot.stats(x)$stats[3]))) diff --git a/vagrantDNA/man/rainbowPlot.Rd b/vagrantDNA/man/rainbowPlot.Rd index 2a7569f..e83b421 100644 --- a/vagrantDNA/man/rainbowPlot.Rd +++ b/vagrantDNA/man/rainbowPlot.Rd @@ -100,10 +100,11 @@ data(parrotDF) ## plot and printout (by default) the results of running rainbowPlot on the parrot data. rainbowPlot(parrotDF, seed = 12345, title = "Parrot") ## -## plot without printing the results and store results in res1. -res1 <- rainbowPlot(parrotDF, seed = 12345, printout = FALSE, title = "Parrot") -## print just the stored estimates (the first two elements of the list) -print(res1[1:2]) -## Inspect the residuals of the lmer model -plot(res1$lmer.model) +## plot without printing the results and store results in parrotFit +parrotFit <- rainbowPlot(parrotDF, seed = 12345, printout = FALSE, title = "Parrot") +## Inspect relationship between intercepts and SNP location +interceptPositionPlot(parrotFit) +## Inspect mapping depth of nuclear insert allele across samples +selAllPlot(parrotDF, parrotFit) + } diff --git a/vagrantDNA/man/selAllPlot.Rd b/vagrantDNA/man/selAllPlot.Rd index 25ae3e6..ee05e84 100644 --- a/vagrantDNA/man/selAllPlot.Rd +++ b/vagrantDNA/man/selAllPlot.Rd @@ -4,7 +4,7 @@ \alias{selAllPlot} \title{Boxplot of alternate (vagrant) allele counts per sample} \usage{ -selAllPlot(dd, ff, ylim = c(0, 10), ...) +selAllPlot(dd, ff, ylim = c(0, 10), ylab = "Allele count", ...) } \arguments{ \item{dd}{A dataframe, such as used to run `rainbowPlot()`} diff --git a/vagrantDNA_1.1.0.tar.gz b/vagrantDNA_1.1.1.tar.gz similarity index 69% rename from vagrantDNA_1.1.0.tar.gz rename to vagrantDNA_1.1.1.tar.gz index 84ddd18..7182698 100644 Binary files a/vagrantDNA_1.1.0.tar.gz and b/vagrantDNA_1.1.1.tar.gz differ