Skip to content

Code improvements  #52

@danielnachun

Description

@danielnachun

Now that our package has draft implementations of most major steps, we should start to think about polishing the code more to emphasize simplicity, readability and consistency. Broadly speaking I think we should prioritize our choice of packages to use functions from sources in the following order:

  • tidyverse packages from CRAN
  • other packages from CRAN
  • Bioconductor packages
  • Packages only available on GitHub

The following packages that we currently depend on can probably be removed

  • Rlab - uses a message2 function that is not even in the documentation - can we just use the base message function?
  • doMC, doParallel and foreach - all of these can be replaced with a combination of tidyverse packages:future, dplyr and purrr.
  • data.table - the fread function can be replaced with the vroom function from the vroom package.
  • plink2R - this can be replaced with snpStats for loading bed/bim/fam files and pgenlibr

The following packages are currently only available on GitHub. We cannot submit our package to CRAN or Bioconductor until these packages have been made available on one of those two resources:

  • Gao's version of susieR
  • mr.mash.alpha
  • mr.ash.alpha

Stylistically, I would like to also strictly enforce several concepts from functional programming:

  • no loops - replace these with group_modify or group_map from dplyr when working with data frames, and map (or its derivates) from purrr when working with lists
  • immutable variables - once a variable is declare it should be modified. The only exception to this is to save memory
  • descriptive variable names - variables which are not part of algebraic operations with formal notation in the manuscript should have descriptive variable names.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions