Git Product home page Git Product logo

breakaway's People

Contributors

adw96 avatar ailurophilia avatar bryandmartin avatar kathrynbarger avatar mariaavc avatar nate-d-olson avatar paulinetrinh avatar svteichman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

breakaway's Issues

Unsupported input type to function "convert"

When passing through a phyloseq object for convert(input_data) of class:

[1] "otu_table"
attr(,"package")
[1] "phyloseq"

An error is produced:

Error in convert(input_data) :
  Unsupported input type to function `convert`. You passed in an object of class otu_table
Calls: summary -> <Anonymous> -> colSums -> is.data.frame -> convert

Breakaway fails on frequency table

Breakaway seems to fail on some of my samples which have less than 6 non-contiguous frequencies (with force=TRUE). I've included the frequency table in attachment. There is no warning/error message.
temp.txt

Code that I used

rich <- breakaway::breakaway(temp, print = FALSE, plot = FALSE, answers = TRUE, force=TRUE)

Doesn't import mvrnorm

objective_bayes_negbin needs mvrnorm from MASS, which is not imported.

Either write a mini-MVN random generator, or import MASS.

Clarification regarding blups in betta()

Quick question regarding betta() output, would it be correct to assume that betta$blups would be considered the "corrected" richness estimations?

i.e.

devtools::install_github("adw96/breakaway")
library(breakaway)
library(phyloseq)
data("GlobalPatterns")
ba <- breakaway(GlobalPatterns)
ss <- summary(ba) 
x_m <- model.matrix( ss$sestimate ~ ss$x_1 + Sample_Type)
bt <- betta(ss$estimate, ss$error, x_m)

bt$blups ==> richness estimates for GlobalPatterns corrected for Sample_Type and x_1
?

utWLRM and tWLRM

Possible issue with not skipping frequency counts that have value zero in the weighted linear regression model implementations. TODO: test and confirm

check_format(output_data) error

Error in check_format(output_data) :
Input data to check_format is of length 1 or 0.
Calls: summary ... FUN -> breakaway.default -> convert -> check_format

sensible axis limits for plotting alpha estimates

@bryandmartin Could you come up with some rules for deciding on the default axis limits for plot.alpha_estimates? I don't think it should need to contain the largest upper limit of the CIs. e.g., I think in this example it would be fine to have the lines extending off the top of the page. Thanks!

image

plot() function error

When using the breakaway plot function of alpha estimates the following ggplot2 error occurs:

Error: Aesthetics must be either length 1 or the same as the data (26): x, y, colour, shape

Breakaway test fails due to NA estimates

In test-alpha_estimates.R:

  
  ## this one
  expect_silent({y <- GlobalPatterns %>% 
    subset_samples(SampleType %in% c("Mock")) %>%
    tax_glom("Phylum") %>%
    breakaway})
  
  expect_is(y, "alpha_estimates")
  expect_is(summary(y), "tbl")
  expect_is(plot(y), "ggplot")
}

The y object has all NA estimates, so it breaks the plotting test. Temporarily replaced breakaway with sample_richness in the test.

Breakaway package : Calculation of diversity Indices

Hi,
I am studying the ammonia oxidizing archaeal diversity in long term fertilized paddy fields. Roche 454 was performed targeting the archaeal amoA gene and raw sequences were processed using Mothur.
Following that, I would like to calculate the diversity indices using breakaway package.

I have now the OTU table with me and would like to use it for calculation. I tried a few times to convert the table to frequency count table using the command build_frequency_count_tables(the_table), but was unable to do as I am not expert in R language. Below is a brief description how I processed.

I created a .csv of my OTU table with title OTU_table.csv and imported it in R and then used:

build_frequency_count_tables(the_table = "OTU_table")

but it showed

Error in FUN(newX[, i], ...) :
breakaway no longer supports file paths as inputs

On that note, if I can get some help on how can I proceed and calculate the indices it will be really appreciated. I am attaching the OTU table. It contains the OTU numbers in rows and treatments in columns. I have analyzed 5 treatments with three replicates each.
If you can kindly guide how should be the input format and also what will be the steps for calculation
it will be really helpful.

Thanks in advance.

Regards,

Sandipan

OTU_table .xlsx

Getting started

Hi
I started to play around with breakaway and when reading the Getting started document and in the section Estimating alpha diversity:

BTW, you can use the above to look sample size variability as well. If you have very different numbers of reads across samples, this can introduce additional variability. Let’s look at the distribution of reads in the current dataset.

The code in the documentation is:

ns <- unlist(lapply(frequencytablelist, function(x) sum(x[,2])))

Maybe I am missing something, but this is just summing up the frequencies; shouldn't it be

ns <- unlist(lapply(frequencytablelist, function(x) sum(x[,1]*x[,2])))

to get the number of reads per sample?

Many thanks for developing such great methods!!!
Antonio

testthat

  • taxa_are_rows = FALSE
  • nof1
  • minibreak
  • minibreak_nof1
  • make taxglom an object so you only have to do it once

Cutoff warning with breakaway

Hello Amy,

I was doing the tutorial seen here with breakaway as well as applying it to own data.
In both cases, the breakaway command gives me the following warning

In cutoff_wrap(my_data, requested = cutoff) :
  ignoring requested cutoff; it's too low

Consequently, when I try to plot the breakaway object, I get the follow error
Error: Aesthetics must be either length 1 or the same as the data (11): x, y, colour, shape

I can still run betta() on the breakaway object but plotting directly seems to not work?
Help??

Best,
Nur

Questions regarding singletons

Hey folks,
I'm just gearing up to finally give Breakaway a go (woo) and am looking for some clarification. I understand it's important to not discard singletons for proper diversity estimation, as per the q2-breakaway tutorial:

We recommend using a FeatureTable that has been generated from deblur/vsearch or dada2 in R with pool = TRUE to make sure that singletons have not been completely filtered out

I understand denoising pooled reads is more sensitive to rare ASVs and should be used but it comes at quite the computation cost so I'm just wondering if this has been tested and is in fact necessary in the case of paired-end reads. I ask because running DADA2 on paired-end reads still produces singletons since it removes singletons before merging and post-merge singletons are still possible and are not removed as they are considered true ASVs. Would these be adequate for breakaway's estimation models?
edit: What about 'psuedo-pooling' option of DADA2, might be a good compromise as well?

Also worth mentioning, q2-deblur's default parameters also removes rare features so it might be worth clarifying to manually adjust those parameters in future tutorials?

--p-min-reads INTEGER Retain only features appearing at least
min_reads times across all samples in the
resulting feature table. [default: 10]
--p-min-size INTEGER In each sample, discard all features with an
abundance less than min_size. [default: 2]

Thanks!

breakaway::betta for repeated measures

Hi Amy,

It is great to see the continued development the breakaway package!

The vignettes are extremely helpful and informative. Extending breakaway to better sync with phyloseq and a post/tutorial about when microbial diversity estimation is and isn't possible (i.e. given issues with calling rare ASV/OTUs) would be very informative (saw your recent post on the dada2 repo).

I write to ask if breakaway::betta can be used (or extended) to account for correlated sampling such as that arising from a two arm longitudinal experimental design? We have several ongoing studies where we have an interest in modeling the trajectory of diversity indices/estimators over time and ideally would like to account for the inexhaustive sampling. Our inferences are largely focused on the fixed effects.

Thank you in advance for any thoughts.

residual analysis with betta()

Question regarding betta() function. From what I understand, we use that to "test for heterogeneity of total diversity (observed plus unobserved) across multiple sites" and can correct for various covariates that may impact the diversity.
Is it possible to perform residual analysis with the parameter estimates generated by betta()?

objective_bayes_negbin: `hist.points' not found

breakaway::objective_bayes_negbin(data = my_table[[i]], plot = F, print = F, answers = T)
Error in data.frame(w = w, n = n, NP.est.C = NP.est.n0 + w, tau = tau, :
object 'hist.points' not found

Did I get rid of something that was not, in fact, superfluous? Investigate!

function: build_frequency_count_tables

Hi Amy,
when running through the breakaway tutorial, I get stuck at the function "build_frequency_count_tables"

I get the following error message:
Error in build_frequency_count_tables(otu_data) :
could not find function "build_frequency_count_tables"

I have installed breakaway version 4.6.8.
Thank you and best regards,
Maren

Richness estimation for single samples

Hello Amy,
I am trying breakaway. I am trying to compare fungal and bacterial observed vs. rarefied and also modeled (see McMurdie and Holmes, 2014 PlosONE) richness, in a set of soil samples. I wasn't able to find richness estimation models for single samples in breakaway I noticed the git-hub page is still a working progress that is why I am asking you directly.
Thanks, Gian

betta() output "ssq_u"

Hi,
I have been playing around with the Breakaway package and I think I am slowly geting the grasp of it. However, I when it comes to the output of the beta() model, I can't get my head around the results$ssq_u value.
I assume is testing the heterogeinity of the groups; can I get a significant value from it? I am not sure how to interprete this.

Thank You,
Paula

simplify use of betta()

Use alpha_estimates class in betta:

Currently to run:

bt <- betta(summary(ba)$estimate,
summary(ba)$error,
DivNet::make_design_matrix(water, "SampleType"))
bt$table

ideally could run
betta(ba, water, "SampleType") to get the same output

Opened in adw96/stamps2018#23

chao_bunge with few species

a2 <- apples[-(1:20),]
sum(a2[,2])
chao_bunge(a2)
chao_bunge(a2, cutoff = 30)
chao_bunge(a2, cutoff = 300)

All of these have NA standard errors

alpha_estimates & phyloseq

It would be great to have the names of the samples embedded in the alpha_estimates object if it is created from a phyloseq object. TODO(Amy)

Error in setting cutoff in wlrm

Hi, I noticed that in wlrm, setting cutoff for maximum frequency count to be a number greater than number of rows in dataset throws an error. Thanks!

Error in alpha_estimate(estimate = diversity, error = diversity_se, estimand = "richness", : object 'f0' not found

Hey awesome breakaway crew,

I m running breakaway on my own data and I ve come an error I can't really figure out.
running breakaway(ps2) returns

Error in alpha_estimate(estimate = diversity, error = diversity_se, estimand = "richness", :
object 'f0' not found
this doesn't happen if I use a preloaded dataset from phyloseq like Gobalpatterns .

this is my Phyloseq object
ps2

phyloseq-class experiment-level object
otu_table() OTU Table: [ 3013 taxa and 292 samples ]
sample_data() Sample Data: [ 292 samples by 43 sample variables ]
tax_table() Taxonomy Table: [ 3013 taxa by 8 taxonomic ranks ]
phy_tree() Phylogenetic Tree: [ 3013 tips and 2977 internal nodes ]

thanks for the help and greetings from Germany :)
Rima

make all richness estimates accept phyloseq objects...

..and have them output objects of class alpha_estimates

yy <- chao_bunge(GlobalPatterns)
zz <- wlrm_transformed(GlobalPatterns)
aa <- wlrm_untransformed(GlobalPatterns)
bb <- chao1(GlobalPatterns)
cc <- chao1_bc(GlobalPatterns)
dd <- good_turing(GlobalPatterns)

and then
plot(yy)
plot(zz)
...

should all work.

Assigned to @bryandmartin

breakaway_nof1 -- no models converged

breakaway_nof1 should always produce some estimate, and doesn't if no models converge. Perhaps have breakaway()-like pipeline that cycles through WLRM_ut and WLRM_t?

Error in uniroot(poisson_fn, c(1e-04, 1e+06)) : f.lower = f(lower) is NA

Running Atacama data and the following error is produced. Using breakaway_4.6.6

library(phyloseq)
library(breakaway)
library(RCurl)
x <- getURL("https://raw.githubusercontent.com/paulinetrinh/data/master/otu_table_atacama.txt")
a_table <- read.table(text =x,
                    skip = 0, 
                    header = F, 
                    row.names = NULL)[,-1]
colnames(a_table) <- colnames(read.csv(text = x, nrows=1, skip=1, sep = "\t"))[-1]
dim(a_table) #Should be 401 rows X 61 columns
a_ps <- phyloseq(otu_table(a_table, taxa_are_rows = TRUE)) 
a_breakaway <- breakaway(a_ps)

Link to documentation

It would be nice to have a link to the documentation for breakaway from the main GitHub Readme page. If it's there and I missed it, my apologies.

Import data correctly using data()

Utilize the structures data(apples) in order to avoid overwriting existing variables.

My apologies to anyone whose apples have been eaten by breakaway!

chao_bunge std errors

set.seed(1)
y <- rnbinom(10000, size=0.01, prob=0.01)
y %>% breakaway::make_frequency_count_table %>%
breakaway::chao_bunge

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.