Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KopfLab/lans2r
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.0
Choose a base ref
...
head repository: KopfLab/lans2r
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 11 commits
  • 26 files changed
  • 1 contributor

Commits on Jun 24, 2020

  1. update spelling

    sebkopf committed Jun 24, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    51c1ebc View commit details
  2. Copy the full SHA
    67a930b View commit details
  3. update documentation

    sebkopf committed Jun 24, 2020
    Copy the full SHA
    7f7545e View commit details
  4. Merge pull request #3 from KopfLab/dev

    update documentation
    sebkopf authored Jun 24, 2020
    Copy the full SHA
    0464310 View commit details

Commits on Feb 18, 2023

  1. Copy the full SHA
    83f7338 View commit details

Commits on Feb 19, 2023

  1. fix vignette link

    sebkopf committed Feb 19, 2023
    Copy the full SHA
    c88128e View commit details
  2. Copy the full SHA
    cc46b6c View commit details
  3. update documentation

    sebkopf committed Feb 19, 2023
    Copy the full SHA
    bc0f82e View commit details
  4. update cran comments

    sebkopf committed Feb 19, 2023
    Copy the full SHA
    5668f4f View commit details

Commits on Feb 20, 2023

  1. Copy the full SHA
    ed16b82 View commit details
  2. Merge pull request #5 from KopfLab/dev

    upgrade to version 1.2.0
    sebkopf authored Feb 20, 2023
    Copy the full SHA
    5dfc74e View commit details
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -11,4 +11,5 @@
^README\.Rmd$
^cran-comments\.md$
^logo\.png$
^_pkgdown.yml$
^_pkgdown.yml$
^CRAN-SUBMISSION$
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 1.2.0
Date: 2023-02-19 07:07:23 UTC
SHA: 5668f4ffee1632431b20f493eaec709b062b8a1a
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ Package: lans2r
Title: Work with Look at NanoSIMS Data in R
Description: R interface for working with nanometer scale secondary ion mass
spectrometry (NanoSIMS) data exported from Look at NanoSIMS.
Version: 1.1.0
Version: 1.2.0
Authors@R: person("Sebastian", "Kopf", email = "sebastian.kopf@colorado.edu",
role = c("aut", "cre"))
URL: https://github.com/KopfLab/lans2r
@@ -17,12 +17,12 @@ Imports:
rlang,
R.matlab
Suggests:
covr,
testthat,
rmarkdown,
knitr,
covr
rmarkdown
License: GPL-3 | file LICENSE
Encoding: UTF-8
LazyData: true
VignetteBuilder: knitr
RoxygenNote: 7.0.2
VignetteBuilder: knitr, rmarkdown
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -29,5 +29,5 @@ The following changes were made to comply with changes in package dependencies a

#### Visualization

- plot panelled ion maps with ROI outlines for any number of ions and analyses
- plot paneled ion maps with ROI outlines for any number of ions and analyses

8 changes: 4 additions & 4 deletions R/load_data.R
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
#' @param ... - vectors of additional information to attach to each analysis, each argument has to have the same length as the
#' 'analysis' parameter (or length 1)
#' @param base_dir - the directory where all the analysis folders are located (defaults to current directory)
#' @param ion_data_only - whether to import only ion data [TRUE by default], rather than any derived files (e.g. ratios calculated
#' @param ion_data_only - whether to import only ion data (\code{TRUE} by default), rather than any derived files (e.g. ratios calculated
#' within LANS). Recommend using \link{calculate_ratios} and \link{calculate_abundances} to process the raw ion counts in easy
#' format and good error propagation.
#' @param load_zstacks - whether to load the planes data (ion-z.dat files need to be exported from
@@ -27,7 +27,7 @@ load_LANS_summary <- function(analysis, ..., base_dir = ".", ion_data_only = TRU
mutate(analysis = i)
}) %>% bind_rows()

full_join(info, data, by = "analysis")
full_join(info, data, by = "analysis", multiple = "all")
}

#' Load LANS ion map data
@@ -39,7 +39,7 @@ load_LANS_summary <- function(analysis, ..., base_dir = ".", ion_data_only = TRU
#' @param ... - vectors of additional information to attach to each analysis, each argument has to have the same length as the
#' 'analysis' parameter (or length 1)
#' @param base_dir - the directory where all the analysis folders are located (defaults to current directory)
#' @param ion_data_only - whether to import only ion data [TRUE by default], rather than any derived files (e.g. ratios calculated
#' @param ion_data_only - whether to import only ion data (\code{TRUE} by default), rather than any derived files (e.g. ratios calculated
#' within LANS). Recommend using \link{calculate_ratios} and \link{calculate_abundances} to process the raw ion counts in easy
#' format and good error propagation.
#' @param quiet - whether to report information on the loaded data or not
@@ -56,7 +56,7 @@ load_LANS_maps <- function(analysis, ..., base_dir = ".", ion_data_only = TRUE,
mutate(analysis = i)
}) %>% bind_rows()

full_join(info, data, by = "analysis")
full_join(info, data, by = "analysis", multiple = "all")
}


8 changes: 4 additions & 4 deletions R/plotting.R
Original file line number Diff line number Diff line change
@@ -76,14 +76,14 @@ extract_roi_boundaries <- function(data) {
# calculate border
suppressMessages(
data %>% filter(ROI > 0) %>%
group_by(ROI, add = TRUE) %>%
group_by(ROI, .add = TRUE) %>%
filter(variable == .data$variable[1]) %>% # calculate for just one variable, for speed
mutate(roi_border = is_on_border(.data$x.px, .data$y.px)) %>%
ungroup() %>%
filter(.data$roi_border) %>%
select(-.data$variable) %>%
inner_join(data %>% group_by(.data$ROI, .data$variable, add = TRUE) %>%
select(.data$variable) %>% distinct()) %>%
select(-"variable") %>%
inner_join(data %>% group_by(.data$ROI, .data$variable, .add = TRUE) %>%
select("variable") %>% distinct(), multiple = "all") %>%
arrange(.data$x.px, .data$y.px) # merge variables back in
)
}
35 changes: 20 additions & 15 deletions R/read_data_files.R
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ read_roi_data <- function(dat_folder, ion_data_only = TRUE, load_zstacks = TRUE,
if (load_zstacks) {
zstack_data <-
lapply(zstack_files, read_roi_ion_zstack_data_file) %>% bind_rows() %>%
left_join(roi_data %>% select(-plane, -value, -sigma), by = c("ROI", "data_type", "variable"))
left_join(roi_data %>% select(-"plane", -"value", -"sigma"), by = c("ROI", "data_type", "variable"))
} else {
zstack_data <- tibble()
}
@@ -89,17 +89,17 @@ read_roi_ion_data_file <- function (file) {
sigma = iso.errN(.data$MEANi)
) %>% # recalculating it to be more precise
select(
.data$plane,
ROI = .data$`# i`,
.data$data_type,
.data$variable,
value = .data$MEANi,
.data$sigma,
coord_x = .data$Xi,
coord_y = .data$Yi,
size = .data$SIZEi,
pixels = .data$PIXELSi,
LW_ratio = .data$LWratio
"plane",
ROI = "# i",
"data_type",
"variable",
value = "MEANi",
"sigma",
coord_x = "Xi",
coord_y = "Yi",
size = "SIZEi",
pixels = "PIXELSi",
LW_ratio = "LWratio"
) %>% as_tibble()
}

@@ -111,15 +111,15 @@ read_roi_ion_zstack_data_file <- function (file) {
ion <- sub("^([0-9A-Z]+)\\-z.dat$", "\\1", basename(file))
read.table(file, header = FALSE, skip = 3, comment.char = "", sep = "\t") %>%
tidyr::gather(var, value, -V1) %>%
rename(plane = .data$V1) %>%
rename(plane = "V1") %>%
group_by(.data$plane) %>%
mutate(
data_type = "ion_count",
variable = ion,
ROI = rep(seq(1, n()/2), each = 2),
col = sub("V(\\d+)", "\\1", var) %>% as.numeric,
var = ifelse(col %% 2 == 0, "value", "sigma")) %>%
select(-.data$col) %>%
select(-"col") %>%
ungroup() %>%
tidyr::spread(var, value) %>%
mutate(plane = as.character(.data$plane), # to fit with 'all' plane
@@ -186,7 +186,12 @@ read_full_ion_data_file <- function (file) {
ion <- sub("^(.+)\\.mat$", "\\1", basename(file))
mat <- R.matlab::readMat(file)
rois <- mat$CELLS %>% reshape2::melt() %>%
as_tibble() %>% rename (ROI = value)
as_tibble() %>% rename(ROI = "value")
# NOTE: could replace reshape2::melt with this but not clear it'd be faster
# tibble::as_tibble() %>%
# tibble::rowid_to_column(var = "Var1") %>%
# tidyr::pivot_longer(cols = -Var1, names_to = "Var2", values_to = "ROI") %>%
# dplyr::mutate(Var2 = as.integer(gsub("V", "", Var2)))
mat$IM %>%
# melt is significnatly faster than gather for this kind of matrix calculation
reshape2::melt() %>% as_tibble() %>%
4 changes: 2 additions & 2 deletions R/transformations.R
Original file line number Diff line number Diff line change
@@ -14,13 +14,13 @@ spread_data <- function(data, values = TRUE, errors = TRUE) {
# spread data into wide format
if (values)
val_df <- data %>%
select(-sigma, -data_type) %>%
select(-"sigma", -"data_type") %>%
tidyr::spread(variable, value)

if (errors)
err_df <- data %>%
mutate(variable = paste(variable, "sigma")) %>%
select(-value, -data_type) %>%
select(-"value", -"data_type") %>%
tidyr::spread(variable, sigma)

# combine
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ knitr::opts_chunk$set(

## Overview

The Look@NanoSIMS (short LANS) Matlab module written by Lubos Polerecky (*Polerecky L., Adam B., Milucka J., Musat N., Vagner T. and Kuypers M. M. M. (2012) Look@NanoSIMS - a tool for the analysis of nanoSIMS data in environmental microbiology. Environ. Microbiol. 14, 1009–1023.*) makes it easy to process NanoSIMS data and draw regions of interest (ROIs). The **lans2r** package provides a convenient interface to import ion maps and ROI data generated by LANS for processing and plotting in R/RMarkdown. Additionally, it can process NanoSIMS tuning (HMR) files.
The Look@NanoSIMS (short LANS) Matlab module written by Lubos Polerecky (*Polerecky L., Adam B., Milucka J., Musat N., Vagner T. and Kuypers M. M. M. (2012) Look@NanoSIMS - a tool for the analysis of nanoSIMS data in environmental microbiology. Environmental Microbiology 14, 1009–1023.*) makes it easy to process NanoSIMS data and draw regions of interest (ROIs). The **lans2r** package provides a convenient interface to import ion maps and ROI data generated by LANS for processing and plotting in R/RMarkdown. Additionally, it can process NanoSIMS tuning (HMR) files.

## Installation

@@ -43,7 +43,7 @@ Once installed, load the package with:
library(lans2r)
```

A concise overview demonstrating the functionality of the **lans2r** package is provided in the [main vignette](https://www.kopflab.org/lans2r/articles/lans2r.html) for the package, which can also be accessed from within R by calling `vignette("lans2r")`. Additional vignettes provide details on extended functionality and can be accessed easily by browsing the package vignettes from within R calling `browseVignettes("lans2r")`. For details on individual funcation, please consult the package help (e.g. `?load_LANS_summary`).
A concise overview demonstrating the functionality of the **lans2r** package is provided in the [main vignette](https://lans2r.kopflab.org/articles/lans2r.html) for the package, which can also be accessed from within R by calling `vignette("lans2r")`. Additional vignettes provide details on extended functionality and can be accessed easily by browsing the package vignettes from within R calling `browseVignettes("lans2r")`. For details on individual functions, please consult the package help (e.g. `?load_LANS_summary`).

## Example

20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@

# lans2r

[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/lans2r)](https://cran.r-project.org/package=lans2r)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/lans2r)](https://cran.r-project.org/package=lans2r)
[![Build
Status](https://travis-ci.org/KopfLab/lans2r.svg?branch=master)](https://travis-ci.org/KopfLab/lans2r)
[![AppVeyor Build
@@ -16,12 +16,12 @@ Status](https://ci.appveyor.com/api/projects/status/github/KopfLab/lans2r?branch
The <Look@NanoSIMS> (short LANS) Matlab module written by Lubos
Polerecky (*Polerecky L., Adam B., Milucka J., Musat N., Vagner T. and
Kuypers M. M. M. (2012) <Look@NanoSIMS> - a tool for the analysis of
nanoSIMS data in environmental microbiology. Environ. Microbiol. 14,
1009–1023.*) makes it easy to process NanoSIMS data and draw regions of
interest (ROIs). The **lans2r** package provides a convenient interface
to import ion maps and ROI data generated by LANS for processing and
plotting in R/RMarkdown. Additionally, it can process NanoSIMS tuning
(HMR) files.
nanoSIMS data in environmental microbiology. Environmental Microbiology
14, 1009–1023.*) makes it easy to process NanoSIMS data and draw regions
of interest (ROIs). The **lans2r** package provides a convenient
interface to import ion maps and ROI data generated by LANS for
processing and plotting in R/RMarkdown. Additionally, it can process
NanoSIMS tuning (HMR) files.

## Installation

@@ -43,13 +43,13 @@ library(lans2r)

A concise overview demonstrating the functionality of the **lans2r**
package is provided in the [main
vignette](https://www.kopflab.org/lans2r/articles/lans2r.html) for the
vignette](https://lans2r.kopflab.org/articles/lans2r.html) for the
package, which can also be accessed from within R by calling
`vignette("lans2r")`. Additional vignettes provide details on extended
functionality and can be accessed easily by browsing the package
vignettes from within R calling `browseVignettes("lans2r")`. For details
on individual funcation, please consult the package help (e.g.
`?load_LANS_summary`).
on individual functions, please consult the package help
(e.g. `?load_LANS_summary`).

## Example

6 changes: 2 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Update of existing CRAN package to address problems that have arisen from recent R version and depencency updates. Thank you for considering the new version for release.
Update of existing CRAN package to address syntax warnings that have arisen from recent updates in the tidyselect and dplyr dependencies. Thank you for considering the new version for release.

## Test environments

* Local OS X install, R 3.6.3
* Ubuntu 16.04 (on travis-ci), R 3.6.3, R 4.0.0
* Windows Server 2012 R2 x64 (on AppVeyor), R 4.0.2
* Local OS X install, R 4.2.2
* Win-builder (devel and release)

## R CMD check results
4 changes: 2 additions & 2 deletions man/calculate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/calculate_abundances.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/calculate_ratios.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/calculate_sums.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/lans2r-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions man/load_HMR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading