Giter VIP home page Giter VIP logo

aroma.cn's People

Contributors

gara-z avatar henrikbengtsson avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

aroma.cn's Issues

Update package title to use Title Case

From Writing R Extensions:

The mandatory 'Title' field should give a short description of the package. Some package listings may truncate the title to 65 characters. It should use title case (that is, use capitals for the principal words), not use any markup, not have any continuation lines, and not end in a period.

ROBUSTNESS: Add explicit 'stringsAsFactors' arguments [cbind, rbind]

$ for pkg in $pkgs; do echo "$pkg:"; (cd "$pkg"; grep -E "^[ \t]*[^#].*[cr]bind" -- */*.R | grep -vF stringsAsFactors;); echo; read -r -p "Press ENTER to continue ..."; done

aroma.cn:
R/AromaUnitPscnBinarySet.doSegmentByPairedPSCBS.R:    dataII <- cbind(dfT[,1:2], dfN[,1:2])
R/AromaUnitPscnBinarySet.doSegmentByPairedPSCBS.R:    data <- cbind(dataA, dataII)
R/C1C2.R:    rbind(c1c2, NA)
R/C1C2.R:  c1c2 <- Reduce(rbind, c1c2TList)
R/C1C2.R:  c1c2 <- cbind(c1c2, w=w)
R/NaiveFracBGenotyping.R:    cs[isDiploid] <- rowMins(abs(cbind(beta[isDiploid]-a, beta[isDiploid]-b)))
R/PairedPSCBS.CALL2.R:      df <- rbind(df, dfKK)
R/PairedPSCBS.CALL2.R:    df <- rbind(df, dfKK)
R/PairedPSCBS.CALL2.R:  segs <- cbind(segs, df)
R/PairedPSCBS.fitC1C2Peaks.R:  dd <- cbind(pList$C1$density[idxs[,1]], pList$C2$density[idxs[,2]])
R/PairedPSCBS.fitC1C2Peaks.R:  verbose && print(verbose, cbind(c1=c1, c2=c2, weights=w))
R/PairedPSCBS.NORM.R:    res <- as.matrix(cbind(l=l, b=b, w=w, k=k))
R/PeaksAndValleys.EXTS.R:  fitC <- cbind(fit, callId=NA_integer_, call=NA_real_)
R/PrincipalCurve.XTRAS.R:    xy <- cbind(y, yN)
R/PruneCNA.PLOT.R:            x <- cbind(x, length=x[,2]-x[,1])
R/segmentByPruneCBS.R:    regions <- rbind(regions3, regions4)
R/segmentByPruneCBS.R:    regions <- rbind(regions3, regions4)

SUGGESTION: More efficient code using matrixStats (>= 0.50.0)

In matrixStats (>= 0.50.0), which is now on CRAN, we introduced support for subsetted calculations that are optimized both for speed and memory usage. There are now new arguments idxs, rows and cols for most functions which allows you to very easily make use of this.

For your package, I believe following functions could gain from this:

$aroma.cn$C1C2toAB
dxy <- colDiffs(xy[, 1:2])

by updating to something like:

$aroma.cn$C1C2toAB
dxy <- colDiffs(xy, cols=1:2)

and adding matrixStats (>= 0.50.0) to your DESCRIPTION file.

dsApplyInPairs() -> future.apply::future_mapply()

In order to full deprecate dsApplyInPairs() and dsApply() in R.filesets, we need to remove usage of dsApplyInPairs() in aroma.cn.

The most likely way forward with this is to replace dsApplyInPairs() with a futurized mapply() function, i.e. a future.apply::future_mapply(). Now, the latter does not exist yet, but is on the road map.

ROBUSTNESS: Make sure search file reg exp patterns have trailing $

Make sure all regular expressions used for searching / setting up file sets have trailing $. For instance, instead of:

  pattern <- sprintf("%s.asb", typeTags);
  res <- AromaUnitFracBCnBinarySet$byPath(outPath, pattern=pattern);

use

  pattern <- sprintf("%s[.]asb$", typeTags);
  res <- AromaUnitFracBCnBinarySet$byPath(outPath, pattern=pattern);

ROBUSTNESS: Add explicit 'stringsAsFactors' arguments [data.frame]

$ for pkg in $pkgs; do echo "$pkg:"; (cd "$pkg"; grep -E "^[ \t]*[^#].*data[.]frame" -- */*.R | grep -vF stringsAsFactors;); echo; read -r -p "Press ENTER to continue ..."; done

aroma.cn:
R/AromaUnitPscnBinarySet.doSegmentByPairedPSCBS.R:    dataA <- Arguments$getInstanceOf(dataA, "data.frame")
R/calculatePairedPSCNByGenotype.R:setMethodS3("calculatePairedPSCNByGenotype", "data.frame", function(data, ...) {
R/CBS.findAtomicAberrations.R:  res <- data.frame(
R/CopyNumberRegions.findAtomicAberrations.R:  res <- data.frame(
R/fitLoessKD.matrix.R:setMethodS3("fitLoessKD", "data.frame", function(X, ...) {
R/fitLoessKD.matrix.R:setMethodS3("normalizeLoessKD", "data.frame", function(X, ...) {
R/fitLoessKD.matrix.R:  XN <- as.data.frame(XN)
R/MultiSourceCopyNumberNormalization.R:  Y <- as.data.frame(Y)
R/PairedPSCBS.CALL2.R:  segs <- as.data.frame(fit)
R/PairedPSCBS.CALL2.R:    data=list(betaTN=betaTN, muN=muN, segments=as.data.frame(fit)),
R/PairedPSCBS.CALL2.R:      dfKK <- data.frame(
R/PairedPSCBS.CALL2.R:    dfKK <- data.frame(
R/PairedPSCBS.findAtomicAberrations.R:  res <- data.frame(
R/PairedPscbsModel.R:      data <- data.frame(chromosome=cp$chromosome, x=cp$position,
R/PairedPSCBS.NORM.R:    data=as.data.frame(fit),
R/RawAlleleBFractions.XTRAS.R:  data <- data.frame(total=2, fracB=beta)
R/segmentByPruneCBS.R:    regions <- as.data.frame(cnr)[,c("start","stop")]
R/segmentByPruneCBS.R:        data <- as.data.frame(cnrT)
R/segmentByPruneCBS.R:        data <- as.data.frame(cnr)
R/segmentByPruneCBS.R:    regions <- as.data.frame(cnr)[,c("start","stop")]
R/segmentByPruneCBS.R:        data <- as.data.frame(cnrT)
R/segmentByPruneCBS.R:        data <- as.data.frame(cnr)

FUTURE: Use do.call(fcn, ...) - not do.call("fcn", ...)

When calling a function via do.call(), specify the function by itself and not by its name, e.g.

## GOOD
y <- do.call(backgroundCorrect, args=args)

## BAD
y <- do.call("backgroundCorrect", args=args)

The former will cause backgroundCorrect() to be identified as a global object by the globals such that it is properly exported when evaluated by a future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.