Skip to content

Commit

Permalink
reorganize R scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkelSchubert committed Jun 17, 2020
1 parent 9031a2d commit b3b5bd3
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ include *.txt
include mapdamage/seqtk/kseq.h
include mapdamage/seqtk/README.md
include mapdamage/seqtk/seqtk.c
recursive-include mapdamage/Rscripts *.r
recursive-include mapdamage/r *.r
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions mapdamage/Rscripts/stats/main.R → mapdamage/r/stats/main.r
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ suppressPackageStartupMessages(library(gam))
suppressPackageStartupMessages(library(RcppGSL))

#Miscellaneous functions
source("function.R")
source("function.r")

#Prior and proposal distributions for the parameters
source("priorPropose.R")
source("priorPropose.r")

#Update functions for the gibbs sampler
source("postConditonal.R")
source("postConditonal.r")

#functions for the grid search
source("start.R")
source("start.r")

#functions for loading the data
source("data.R")
source("data.r")


#######################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The posterior conditional function utilized by the
# Gibbs sampler in function.R. They have all the
# Gibbs sampler in function.r. They have all the
# same form maybe they should be implemented in a
# smarter way.

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ use_bw_theme <- getArgument("USE_BW_THEME", as.logical)
#
#######################################################

source("main.R")
source("main.r")
File renamed without changes.
8 changes: 4 additions & 4 deletions mapdamage/rscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def misincorporation_plot(options):
logger.info("Saving misincorporation plot to '%s'", output)

return _rscript_call(
Path("mapDamage.R"),
Path("mapDamage.r"),
COMP=fcomp,
PDFOUT=output,
AROUND=options.refplot,
Expand All @@ -43,7 +43,7 @@ def length_distribution_plot(options):
logger.info("Saving length distribution plot to '%s'", output)

return _rscript_call(
Path("lengths.R"),
Path("lengths.r"),
LGDIST=flength,
PDFOUT=output,
MISINCORP=fmut,
Expand Down Expand Up @@ -76,7 +76,7 @@ def perform_bayesian_estimates(options):
folder = options.folder.absolute()

return _rscript_call(
Path("stats") / "runGeneral.R",
Path("stats") / "runGeneral.r",
GRID_ITER=options.rand,
BURN_IN=options.burn,
ADJUST_ITER=options.adjust,
Expand All @@ -97,7 +97,7 @@ def perform_bayesian_estimates(options):


def _rscript_call(filepath, **kwargs):
cwd = Path(resource_filename("mapdamage", "Rscripts")) / filepath.parent
cwd = Path(resource_filename("mapdamage", "r")) / filepath.parent
command = ["Rscript", filepath.name]
for item in sorted(kwargs.items()):
command.append("%s=%s" % item)
Expand Down
Binary file added mapdamage/seqtk.cpython-36m-x86_64-linux-gnu.so
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def run(self):
version="2.2.0",
author="Aurélien Ginolhac, Mikkel Schubert, Hákon Jónsson",
packages=["mapdamage"],
package_data={"mapdamage": ["Rscripts/*.R", "Rscripts/stats/*.R", "tests/*"]},
package_data={"mapdamage": ["r/*.r", "r/stats/*.r", "tests/*"]},
entry_points={"console_scripts": ["mapDamage=mapdamage.main:entry_point"]},
url="https://github.com/ginolhac/mapDamage",
license="LICENSE.txt",
Expand Down

0 comments on commit b3b5bd3

Please sign in to comment.