Learn R Programming

⚠️There's a newer version (2.1.0) of this package.Take me there.

nandb

An R package for performing number and brightness analysis as in Digman et al. 2008.

Installation

Platform Dependencies

Mac OS X

Mac OS X comes with a legacy Apple Java 6. Update your Java installation to a newer version provided by Oracle.

  1. Install Oracle JDK.

  2. Update R Java configuration by executing from the command line (you might have to run it as a super user by prepending sudo depending on your installation).

    R CMD javareconf
  3. Re-install rJava from sources in order to properly link to the non-system Java installation.

    install.packages("rJava", type="source")
  4. Then, to make everything work with Rstudio, run

    sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib

    (taken from http://stackoverflow.com/questions/30738974/rjava-load-error-in-rstudio-r-after-upgrading-to-osx-yosemite).

You can verify your configuration by running the following commands. This should return the Java version string corresponding to the one downloaded and installed in step 1.

library(rJava)
.jinit()
.jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
## [1] "1.8.0_112-b16" 

Thanks to @aoles for these instructions. Check out his great work on image analysis in R at https://github.com/aoles.

Linux

  1. Install the latest JDK. Be sure to install both 32-bit and 64-bit.

  2. On Ubuntu (similarly for other debian linux), you need to do:

    sudo apt-get update
    sudo apt-get install libssl-dev libtiff5-dev libfftw3-dev 
    sudo apt-get install libcurl4-openssl-dev libxml2-dev 
    sudo apt-get install default-jre default-jdk libboost-all-dev

Windows

  1. Install the latest JDK. Be sure to install both 32-bit and 64-bit.

  2. Go to https://cran.r-project.org/bin/windows/Rtools/ and install the latest version of Rtools.

All Platforms

Then, everyone, open R and run:

source("https://bioconductor.org/biocLite.R")
biocLite(c("EBImage", "BiocParallel"))
install.packages("nandb")

If you get a message saying Update all/some/none? [a/s/n]:, type a. If you get the chance to install some packages from source, it's safest to decline.

Problems

If you run into problems during your installation, it's most likely that your installation of rJava didn't work. Try running install.packages("rJava") and try to work through the errors there. If that still doesn't work, try googling "install rJava" for your operating system e.g. "install rJava Ubuntu". The second most likely culprit is EBImage so similarly have a google of "install EBImage". If you get these to work, then try the installation instructions again. If you still can't get it to work, feel free to contact me via the issues page associated with this repo.

Updates

To update the package, you just need to do the same thing:

source("https://bioconductor.org/biocLite.R")
biocLite(c("EBImage", "BiocParallel"))
install.packages("nandb")

Use

For the lowdown on how to use this package, you should read the package vignettes. Once you've installed the package, you can browse them using vignette(package = "nandb").

Copy Link

Version

Install

install.packages('nandb')

Monthly Downloads

254

Version

0.2.1

License

BSD_3_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Rory Nolan

Last Published

July 11th, 2017

Functions in nandb (0.2.1)

Brightness

Calculate brightness from image series.
BrightnessPlotFolder

Make brightness plots (images) for an entire folder.
ApplyOnPillars

Apply a function to each pillar of a 3-dimensional array.
ArrArrHexPlot

Plot the values in two arrays against each other.
ExpSmooth

Exponentially smooth a series of observations.
ExpSmoothPillars

Exponentially smooth pillars of a 3-dimensional array
BestTau

Find the best tau for exponential filtering detrend.
Bin2Tiff

Convert a binary image to tiff.
KmerPlot

A brightness image with a different colour for each kmer.
ListPillars

Turn a 3d array into a list of pillars
MatrixRasterPlot

Make a raster plot of a matrix.
NumberTimeSeries

Create a number time-series.
PillarsDF

Make each pillar of a 3D array into a column of a tibble
nandb

nandb: Number and brightness in R.
GroupClose

Group together close adjacent elements of a vector.
KmerArray

Get an image where each pixel represents a kmer.
PillarsListToArr

Make a list of pillars back into a 3D array.
KmerTIFFsFromBrightnessCSVs

Create kmer tiff files from brightness csvs
CollapseRanges

Collapse a big set of ranges into a smaller set.
CorrectForBleaching

Detrend an image series
KmersFromBrightnesses

Calculate numbers of kmers based on brightnesses
ReadImageData

Read image as array object.
KmersFromImage

Calculate numbers of kmers based on an image time-series
MedianFilterB

Smooth and median filters with options for handling NAs.
Number

Calculate number from image series.
WriteImageTxt

Read/write an image array to/from disk as text file(s).
WriteIntImage

Write an integer array to disk as a tiff image.
BrightnessTimeSeries

Create a Brightness time-series.
Closest

What's the closest value in a vector?
FixLUTError

Fix lookup table error when reading images.
ForceChannels

Fix an image that didn't recognise channels while reading
MeanIntensity

Calculate mean intensity from image series.
MeanPillars

Get the means/medians/variances of pillars of a 3d array
SpreadSpecific

Get the best spread of numbers in an interval.
Stack2DTifs

Put individual tif files into one tif stack.