Skip to contents

The rchime() function allows you to detect and remove chimeras from your data using a de novo approach or alternatively a reference model.

Our preferred way of doing this is to use the abundant sequences as our reference (de novo).

This function uses code from the vsearch tools.

Usage

rchime(
  data,
  reference = NULL,
  dereplicate = TRUE,
  verbose = TRUE,
  remove_chimeras = TRUE,
  rchime_options = NULL,
  table_names = list(sequence_name = "sequence_name", sequence = "sequence", abundance =
    "abundance", sample = "sample")
)

Arguments

data

a strollur dataset object or a data.frame containing your sequence data.

reference

a strollur dataset object or a data.frame containing reference sequence data.

dereplicate

logical. The dereplicate option allows you to remove chimeras by sample. When dereplicate=FALSE, if a sequence is flagged as chimeric in one sample, it is removed from all samples. Our experience suggests that this is a bit aggressive since we’ve seen rare sequences get flagged as chimeric when they’re the most abundant sequence in another sample. For a more conservative approach, we recommend using the default dereplicate=TRUE which will only remove sequences from the samples in which they are flagged as chimeric.

verbose

logical, allow console outputs. Default = TRUE.

remove_chimeras

Boolean, remove chimeras from dataset. Default = TRUE. Only used when data is a strollur object.

rchime_options

List, You can fine tune the vsearch specific options using the [rchime_options()] function. Default = NULL.

table_names,

named list used to indicate the names of the columns in the data.frame. Only used when data or reference are a data.frames.

Value

list() containing a chimera report, and vector of the chimeric sequence's names.

The strollur dataset object will also be updated. The sequences flagged as chimeric are removed and the chimera report is added.

References

Rognes T, Flouri T, Nichols B, Quince C, Mahé F. (2016) VSEARCH: a versatile open source tool for metagenomics. PeerJ 4:e2584. doi: 10.7717/peerj.2584

Edgar,R.C., Haas,B.J., Clemente,J.C., Quince,C. and Knight,R. (2011), UCHIME improves sensitivity and speed of chimera detection. Bioinformatics 27:2194.

See also

rchime_options() to set vsearch specific parameters.

Author

Sarah Westcott, swestcot@umich.edu

Examples


# Let's use a strollur object with 500 sequences

data <- strollur::load_dataset(
  rchime_example("strollur_multi_sample_small.rds")
)

chimera_report <- rchime(data)
#>  The de novo method runs with a single processor.
#> Added a chimera_report report.
#> → rchime removed `128` chimeras from your dataset.
#> → It took `0.520607233047485` seconds to detect and remove the chimeras.
data
#> multi_sample - 500 sequences:
#> 
#>             starts ends nbases ambigs polymers numns numseqs
#> Minimum:         1  250    250      0        3     0    1.00
#> 2.5%-tile:       1  252    252      0        4     0  168.18
#> 25%-tile:        1  252    252      0        4     0 1672.75
#> Median:          1  253    253      0        4     0 3344.50
#> 75%-tile:        1  253    253      0        5     0 5016.25
#> 97.5%-tile:      1  253    253      0        6     0 6520.82
#> Maximum:         1  255    255      0        6     0 6688.00
#> Mean:            1  252    252      0        4     0 3344.50
#> 
#> scrap_summary:
#>       type      trash_code unique total
#> 1 sequence rchime-chimeras     90   128
#> 
#> Number of unique seqs: 410 
#> Total number of seqs: 6688 
#> 
#> Total number of samples: 20 
#> Total number of custom reports: 1 
#>