GithubHelp home page GithubHelp logo

Comments (1)

cpauvert avatar cpauvert commented on June 24, 2024

from the example of the picking function:

clusters <- readRDS(system.file("clusters_tibble.RDS", package = "maldipickr"))
# Simulate OD600 values with uniform distribution
#  for each of the colonies we measured with
#  the Bruker MALDI Biotyper
set.seed(104)
metadata <- dplyr::transmute(clusters, name = name, OD600 = runif(n = nrow(clusters)))

# Pick the spectra based on the highest OD600 value per cluster
pick_spectra(clusters, metadata, "OD600")

gives correctly:

# A tibble: 6 × 8
  name         membership cluster_size   SNR peaks is_reference OD600 to_pick
  <chr>             <int>        <int> <dbl> <dbl> <lgl>        <dbl> <lgl>  
1 species1_G2           1            4  5.09    21 FALSE        0.364 FALSE  
2 species2_E11          2            2  5.54    22 FALSE        0.772 TRUE   
3 species2_E12          2            2  5.63    23 TRUE         0.735 FALSE  
4 species3_F7           1            4  4.89    26 FALSE        0.973 TRUE   
5 species3_F8           1            4  5.56    25 TRUE         0.740 FALSE  
6 species3_F9           1            4  5.40    25 FALSE        0.201 FALSE 

However, when the provided metadata cannot be merged,there is no warning but NA in the column:

altered_metadata <- dplyr::mutate(metadata, name = gsub("species","",name))
pick_spectra(clusters, altered_metadata, "OD600")
# A tibble: 6 × 8
  name         membership cluster_size   SNR peaks is_reference OD600 to_pick
  <chr>             <int>        <int> <dbl> <dbl> <lgl>        <dbl> <lgl>  
1 species1_G2           1            4  5.09    21 FALSE           NA TRUE   
2 species2_E11          2            2  5.54    22 FALSE           NA TRUE   
3 species2_E12          2            2  5.63    23 TRUE            NA FALSE  
4 species3_F7           1            4  4.89    26 FALSE           NA FALSE  
5 species3_F8           1            4  5.56    25 TRUE            NA FALSE  
6 species3_F9           1            4  5.40    25 FALSE           NA FALSE  

from maldipickr.

Related Issues (20)

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.