Skip to main content
  • Research article
  • Open access
  • Published:

Artificial and natural duplicates in pyrosequencing reads of metagenomic data

Abstract

Background

Artificial duplicates from pyrosequencing reads may lead to incorrect interpretation of the abundance of species and genes in metagenomic studies. Duplicated reads were filtered out in many metagenomic projects. However, since the duplicated reads observed in a pyrosequencing run also include natural (non-artificial) duplicates, simply removing all duplicates may also cause underestimation of abundance associated with natural duplicates.

Results

We implemented a method for identification of exact and nearly identical duplicates from pyrosequencing reads. This method performs an all-against-all sequence comparison and clusters the duplicates into groups using an algorithm modified from our previous sequence clustering method cd-hit. This method can process a typical dataset in ~10 minutes; it also provides a consensus sequence for each group of duplicates. We applied this method to the underlying raw reads of 39 genomic projects and 10 metagenomic projects that utilized pyrosequencing technique. We compared the occurrences of the duplicates identified by our method and the natural duplicates made by independent simulations. We observed that the duplicates, including both artificial and natural duplicates, make up 4-44% of reads. The number of natural duplicates highly correlates with the samples' read density (number of reads divided by genome size). For high-complexity metagenomic samples lacking dominant species, natural duplicates only make up <1% of all duplicates. But for some other samples like transcriptomic samples, majority of the observed duplicates might be natural duplicates.

Conclusions

Our method is available from http://cd-hit.org as a downloadable program and a web server. It is important not only to identify the duplicates from metagenomic datasets but also to distinguish whether they are artificial or natural duplicates. We provide a tool to estimate the number of natural duplicates according to user-defined sample types, so users can decide whether to retain or remove duplicates in their projects.

Background

Metagenomics is a new field that studies the microbes under different environmental conditions such as ocean, soil, human distal gut, and many others [1–6]. Using culture-independent genomic sequencing technologies, metagenomics provides a more global and less biased view of an entire microbial community than the traditional isolated genomics. The earlier metagenomic studies were largely carried out with Sanger sequencing, but recently, more studies [7–9] were performed with the new breaking through next-generation sequencing technologies [10]. Today, the pyrosequencing by Roche's 454 life science serves as a dominant sequencing platform in metagenomics.

However, it is known that the 454 sequencers produce artificially duplicated reads, which might lead to misleading conclusions. Exact duplicates sometimes were removed before data analyses [7]. Recently, in the study by Gomez-Alvarez et al [11], nearly identical duplicates, the reads that begin at the same position but may vary in length or bear mismatches, were also classified as artifacts. Exact and nearly identical duplicates may make up 11~35% of the raw reads.

In metagenomics, the amount of reads is used as an abundance measure, so artificial duplicates will introduce overestimation of abundance of taxon, gene, and function. Duplicated reads observed in a pyrosequencing run include not only artificial duplicates but also natural duplicates - reads from the same origin that start at the same genomic position by chance. Therefore, simply removing all duplicates might also cause underestimation of abundance associated with naturally duplicated reads. The occurrence of natural duplicates can be very low for metagenomic samples lacking dominant species [11], or can be very high for other samples like transcriptomic samples (results in this study). So it is important not only to identify the duplicates, but also to distinguish whether they are artificial or natural duplicates.

Exactly identical sequences can be easily found, but identification of non-exact duplicates requires sophisticated algorithms to process the massive sequence comparisons between reads. In Gomez-Alvarez et al's study [11], the duplicates were identified by first clustering the reads at 90% sequence identity using cd-hit program [12–14] and then parsing the clustering results.

In this study, we first implemented a method for identification of exact and nearly identical duplicates from pyrosequencing reads. As the original developers of cd-hit, we reengineered cd-hit into a new program that can process the duplicates more effectively than the original program. This method can process a typical 454 dataset in ~10 minutes; it also provides a consensus sequence for each group of duplicates. Secondly, we validated this method using the underlying raw reads from a list of genome projects utilizing pyrosequencing technology. We compared the occurrences of the duplicates identified by our method and the natural duplicates made by independent simulations. Lastly, we studied duplicates for several metagenomic samples and estimated their natural duplicates under different situations.

Results and discussion

Program for identification of duplicates

We implemented a computer program called cdhit-454 to identify duplicated reads by reengineering our ultra-fast sequence clustering algorithm cd-hit [12–14]. The algorithm and other details of cdhit-454 are introduced in the Methods section. Briefly, we constrained cdhit-454 to find exact duplicates and nearly identical duplicates that start at the same position and are within the user-defined level of mismatches (insertions, deletions, and substitutions). We allow mismatches in order to tolerate sequencing errors. The default parameters of mismatches are based on the pyrosequencing error model derived in this study. We provide a tool in cdhit-454 to build a consensus sequence for each group of duplicates. The model used for consensus generation is also described in the Methods section. Cdhit-454 software and web server are available at http://cd-hit.org/.

Duplicated reads of genomic datasets

We tested and validated cdhit-454 with data from pyrosequencing-based genome projects where both the complete genomes and the underlying raw reads are available from NCBI at RefSeq and Short Read Archive (SRA). For a project with multiple sequencing runs, only the run with the most reads was selected. We identified 39 such genome projects on September 2009, with 15 from GS-20 and 24 from GS-FLX platform (including 1 GS-FLX Titanium). The details of the 39 projects, including their project identifiers, SRA accession numbers, genome sizes, GC contents, and other calculated results, are summarized in Table 1.

Table 1 Genome projects with full genomes from Refseq and pyrosequencing reads from Short Read Archive

For each genome project, we applied cdhit-454 on the raw reads to identify the duplicates, which include both artificial and natural duplicates. The number of natural duplicates was empirically estimated by applying cdhit-454 on simulated reads, which are fragments randomly cut from the complete genomes.

A simulated reads set and the experimental raw reads set in each genome project have the exactly the same number of sequences of exactly the same lengths. We generated 1000 sets of simulated reads for each genome project and selected 100 sets that are most similar to its corresponding raw reads in GC content. We further introduced sequencing errors (insertions, deletions, and substitutions) to the simulated reads according to the error model derived in this study (Table 2, 3). These processes made the simulated read sets as similar as possible to the real reads set, except that the former only contains natural duplicates. Using cdhit-454, we identified the duplicates for the 100 sets of simulated reads of each project and calculated the average duplicate ratio and the standard deviations. Figure 1 shows the ratio of all duplicates and the average natural duplicates for these 39 projects. The results and the standard deviations are also available in Table 1.

Figure 1
figure 1

Ratio of all duplicates and average natural duplicates to all reads from genome projects. X-axis is project identifier of datasets, which are ordered by decreasing read density (number of reads divided by genome size). Y-axis is the ratio of duplicated reads to all reads.

Table 2 pyrosequencing error rate of GS-20 platform
Table 3 pyrosequencing error rate of GS-GLX platform

As illustrated in Figure 1, the duplicates make up to 4-44% of reads. We observed that the ratio of natural duplicates, which ranges from 1-11%, highly correlates with the read density (number of reads divided by genome size) with a Pearson correlation factor of 0.99. The ratio of artificial duplicates (subtract natural duplicates from all duplicates) varies from 3-42%. On average, artificial duplicates make up 74% of all duplicates, and this percentage varies from 28% to 98% (first left and second right projects in Figure 1). Artificial duplicates happen randomly without observed correlation with the sample's GC content, genome size, or platform (GS-20 or GS-FLX).

Here, we define the sensitivity and specificity for the evaluation of duplicate identification. Within the simulated datasets, the reads that start at the same position are considered as true duplicates. The sensitivity of a method is the ratio of predicted true duplicates by this method to all true duplicates. The specificity is the ratio of predicted true duplicates to all predictions by this method. The averaged sensitivity and specificity for the 39 datasets are both ~98.0% using the default parameters of cdhit-454.

Pyrosequencing errors

The original 454 publication reported an error rate at ~4% [15]. But later studies yielded much higher accuracy. For example, Huse et al. concluded an error rate at ~0.5% for GS20 system [16]. Quinlan et al. provided a similar error rate at about ~0.4% [17].

Accurate estimation of the pyrosequencing error rate is very important for this study, because we use the error rate to optimize the parameters for cdhit-454 program to identify the duplicated reads with sequencing errors. The error model is also used to guide the generation of sequencing errors in the simulated datasets in above analysis. Therefore, we re-evaluated the pyrosequencing error rate using the data from Table 1.

We used Megablast [18] with the default parameters to align the raw reads back to the corresponding reference genomes. Only the reads with at least 90% of the length aligned were selected to calculate the error rates. Other reads were treated as from contamination material, and therefore discarded. The error rates and fractions by error types (insertion, deletion, and substitution) for all projects are shown in Table 2 for GS-20 and Table 3 for GS-FLX.

We found that the error rate (number of errors divided by total bases) for pyrosequencing is from 0.4% to 0.5%. About 75% of the reads have no error; and about another 20% of the reads have ≤ 2% errors. If the sequencing error rate is 2%, two reads may have up to 4% mismatches. We set the default mismatch cutoff at 4% for cdhit-454 so that about 95% of reads can be covered. We examined several mismatch cutoffs from 95% to 98% on the simulated datasets; the 96% cutoff gave the best sensitivity and specificity. The mismatch cutoff parameter in cdhit-454 is a user-configurable parameter. If the low-quality reads are already filtered out, a higher cutoff such as 98% may be used.

Duplicated reads of metagenomic datasets

We studied the pyrosequencing reads for 10 metagenomic datasets (Table 4) of different environments from NCBI SRA or from CAMERA metagenomic project http://camera.calit2.net. We identified their duplicates with cdhit-454 (Figure 2). The duplicates make up 5-23% of reads. As concluded earlier in this study, the quantity of natural duplicates of metagenomic samples depends on the read density of their individual species, and therefore can vary significantly. Since the exact species composition and genome sequences are unknown for metagenomic samples, we could not calculate the amount of natural duplicates as we did for the genome projects. So, we simulated the occurrence of natural duplicates under several hypothetical sample types.

Figure 2
figure 2

Ratio of all duplicates and natural duplicates under different hypothetical types for metagenomic samples. X-axis is the name or project identifier of metagenomic samples. For the real metagenomic dataset, the duplicates include both artificial and natural duplicates. For other hypothetical sample types, the duplicates are natural duplicates.

Table 4 Metagenomic datasets used in this study

Metagenomic samples are roughly grouped into low-, moderate-, and high-complexity samples, which represent samples dominated by a single near-clonal population, samples with more than one dominant species, and those lacking dominant populations respectively[19]. We constructed 6 hypothetical sample types: M-3 mb, M-100 kb, M-10 kb, H-3 mb, H-100 kb, and H-10 kb; here the name of a sample type starts with M or H (for moderate- or high-complexity) followed by the average genome size. Therefore, M-3 mb represents a moderate-complexity microbial sample with 3 MB genomes; and H-10 kb may represent a high-complexity small viral sample. We assumed that each hypothetical sample contained 100 different genomes of certain length. Given a set of reads, in order to calculate the natural duplicates under a high-complexity hypothetical sample type, we assigned these reads to the 100 genomes randomly at arbitrary positions on either strand. For a moderate-complexity type, 50% of the reads were randomly assigned to 3 dominant genomes, and other reads were randomly mapped to the remaining 97 low-abundance genomes. The natural duplicates were identified by comparing the mapping coordinates. We applied this method to the 10 metagenomic datasets to calculate the ratio of their natural duplicates under different hypothetical sample types (Figure 2 and Table 4).

From Figure 2, we can see that if these metagenomic samples match H-3 mb, M-3 mb, and H-100 kb, their natural duplicates only make up 0.2%, 1.5%, and 7.4% of all duplicates on average; so it is appropriate to filter out the duplicates. However, if a metagenomic sample matches other types, the number of anticipated natural duplicates may be similar or even larger than the artificial duplicates.

Here, we want to discuss a particular type of samples - metatranscriptomic samples. Similar to metagenomics, metatranscriptomics is a field that studies the microbial gene expression via sequencing of the total RNAs extracted directly from environments. Recent metatranscriptomic studies [8, 20, 21] were performed with pyrosequencing. Since most microbial transcript sequences are only 102~104 bases in length and one transcript can have many copies in a cell, so the read density of metatranscriptomic samples is several orders of magnitude higher than the read density of metagenomic samples. It is expected that metatranscriptomic samples have high occurrence of natural duplicates. For example, 61% of reads in the mRNA samples from [21] are found as duplicates by cdhit-454; it is reasonable to believe most of them are natural duplicates and therefore should be kept for abundance analysis.

Conclusions

In this study, we present an effective method to identify exact and nearly identical duplicated sequences from pyrosequencing reads. But since the identified duplicates contain natural duplicates, it is important to estimate the proportion of natural duplicates. In the cdhit-454 package, we provide a tool to estimate the number of natural duplicates under any hypothetical sample type defined by users, so users can decide whether to retain or remove duplicates in their projects.

Methods

Algorithm of cdhit-454

In cdhit-454, we use the original clustering algorithm of cd-hit [12–14]. Briefly, reads are first sorted in decreasing length. The longest one becomes the seed of the first cluster. Then, each remaining sequence is compared to the seeds of all existing clusters. If the similarities with existing seeds meet pre-defined criteria, it is grouped into the most similar cluster. Otherwise, a new cluster is defined with the sequence as the seed. The pre-defined criteria includes: (1) they start at the same position; (2) their lengths can be different, but shorter one must be fully aligned with the longer one (the seed); (3) they can only have 4% mismatches (insertion, deletion, and substitution); and (4) only 1 base is allowed per insertion or deletion. Here, (3) and (4) are set according to the pyrosequencing error rate derived in this study (Result and discussion) and can be adjusted by users.

Generate consensus

We provide a program to build a consensus sequence for each group of duplicates. This tool takes the output of cdhit-454 and original FASTA or FASTQ file. It builds a multiple sequence alignment for each group of duplicates with program ClustalW[22], then generate consensus based on following model:

If a FASTA file is used, the most frequent symbol in each column of the alignment is used as the consensus, and then symbols representing gaps are removed from the consensus sequence. If a FASTQ file is used, the quality score for each base is converted into its error probability to improve the consensus generation.

In a column of a multiple alignment, the count for gaps is calculated as the real count, while the counts for letters {'A','C','G','T'} are "corrected" by the error probabilities, with contribution from letter 'N' which is not counted for itself. Suppose there are M letters in one position of a M-sequence alignment: b(i)∈ {'A', 'C', 'G', 'T'}, i = 1, ..., M , with quality scores s i and error probabilities p i , where,

The count c(α) for α∈ {'A', 'C', 'G', 'T'} is calculated as,

where δ(x, y) is a function that takes value one when x equals to y, and take zero otherwise. Namely, if the b i is α, a fraction count of 1-p i is added for letter α, and a fraction count of p i is equally distributed on the other letters among {'A', 'C', 'G', 'T'}, which reflects the nature of the error probability.

Then for each column, if there is a dominant letter or gap with frequency equal to or greater than 0.5, this dominant symbol is used in that column in the consensus, otherwise letter 'N' is used, and then symbols representing gaps are removed from the consensus sequence.

Estimate natural duplicates in hypothetical metagenomic samples

We provide a program to estimate the number of natural duplicates under any hypothetical sample type. A user provides the number of reads and the size and abundance of genomes in a hypothetical sample. Our tool gives the number of simulated natural duplicates.

References

  1. Rusch DB, Halpern AL, Sutton G, Heidelberg KB, Williamson S, Yooseph S, Wu D, Eisen JA, Hoffman JM, Remington K, et al.: The Sorcerer II Global Ocean Sampling Expedition: Northwest Atlantic through Eastern Tropical Pacific. PLoS Biol 2007, 5(3):e77. 10.1371/journal.pbio.0050077

    Article  PubMed  PubMed Central  Google Scholar 

  2. Venter JC, Remington K, Heidelberg JF, Halpern AL, Rusch D, Eisen JA, Wu D, Paulsen I, Nelson KE, Nelson W, et al.: Environmental genome shotgun sequencing of the Sargasso Sea. Science 2004, 304(5667):66–74. 10.1126/science.1093857

    Article  CAS  PubMed  Google Scholar 

  3. Tringe SG, von Mering C, Kobayashi A, Salamov AA, Chen K, Chang HW, Podar M, Short JM, Mathur EJ, Detter JC, et al.: Comparative metagenomics of microbial communities. Science 2005, 308(5721):554–557. 10.1126/science.1107851

    Article  CAS  PubMed  Google Scholar 

  4. Gill SR, Pop M, Deboy RT, Eckburg PB, Turnbaugh PJ, Samuel BS, Gordon JI, Relman DA, Fraser-Liggett CM, Nelson KE: Metagenomic analysis of the human distal gut microbiome. Science 2006, 312(5778):1355–1359. 10.1126/science.1124234

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  5. Tyson GW, Chapman J, Hugenholtz P, Allen EE, Ram RJ, Richardson PM, Solovyev VV, Rubin EM, Rokhsar DS, Banfield JF: Community structure and metabolism through reconstruction of microbial genomes from the environment. Nature 2004, 428(6978):37–43. 10.1038/nature02340

    Article  CAS  PubMed  Google Scholar 

  6. DeLong EF, Preston CM, Mincer T, Rich V, Hallam SJ, Frigaard NU, Martinez A, Sullivan MB, Edwards R, Brito BR, et al.: Community genomics among stratified microbial assemblages in the ocean's interior. Science 2006, 311(5760):496–503. 10.1126/science.1120250

    Article  CAS  PubMed  Google Scholar 

  7. Dinsdale EA, Edwards RA, Hall D, Angly F, Breitbart M, Brulc JM, Furlan M, Desnues C, Haynes M, Li L, et al.: Functional metagenomic profiling of nine biomes. Nature 2008, 452(7187):629–632. 10.1038/nature06810

    Article  CAS  PubMed  Google Scholar 

  8. Frias-Lopez J, Shi Y, Tyson GW, Coleman ML, Schuster SC, Chisholm SW, Delong EF: Microbial community gene expression in ocean surface waters. Proc Natl Acad Sci USA 2008, 105(10):3805–3810. 10.1073/pnas.0708897105

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  9. Turnbaugh PJ, Hamady M, Yatsunenko T, Cantarel BL, Duncan A, Ley RE, Sogin ML, Jones WJ, Roe BA, Affourtit JP, et al.: A core gut microbiome in obese and lean twins. Nature 2009, 457(7228):480–484. 10.1038/nature07540

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  10. Shendure J, Ji H: Next-generation DNA sequencing. Nat Biotechnol 2008, 26(10):1135–1145. 10.1038/nbt1486

    Article  CAS  PubMed  Google Scholar 

  11. Gomez-Alvarez V, Teal TK, Schmidt TM: Systematic artifacts in metagenomes from complex microbial communities. Isme J 2009, 3(11):1314–1317. 10.1038/ismej.2009.72

    Article  PubMed  Google Scholar 

  12. Li W, Jaroszewski L, Godzik A: Clustering of highly homologous sequences to reduce the size of large protein databases. Bioinformatics 2001, 17(3):282–283. 10.1093/bioinformatics/17.3.282

    Article  CAS  PubMed  Google Scholar 

  13. Li W, Jaroszewski L, Godzik A: Tolerating some redundancy significantly speeds up clustering of large protein databases. Bioinformatics 2002, 18(1):77–82. 10.1093/bioinformatics/18.1.77

    Article  CAS  PubMed  Google Scholar 

  14. Li W, Godzik A: Cd-hit: a fast program for clustering and comparing large sets of protein or nucleotide sequences. Bioinformatics 2006, 22(13):1658–1659. 10.1093/bioinformatics/btl158

    Article  CAS  PubMed  Google Scholar 

  15. Margulies M, Egholm M, Altman WE, Attiya S, Bader JS, Bemben LA, Berka J, Braverman MS, Chen YJ, Chen Z, et al.: Genome sequencing in microfabricated high-density picolitre reactors. Nature 2005, 437(7057):376–380.

    CAS  PubMed  PubMed Central  Google Scholar 

  16. Huse SM, Huber JA, Morrison HG, Sogin ML, Welch DM: Accuracy and quality of massively parallel DNA pyrosequencing. Genome Biol 2007, 8(7):R143. 10.1186/gb-2007-8-7-r143

    Article  PubMed  PubMed Central  Google Scholar 

  17. Quinlan AR, Stewart DA, Stromberg MP, Marth GT: Pyrobayes: an improved base caller for SNP discovery in pyrosequences. Nat Methods 2008, 5(2):179–181. 10.1038/nmeth.1172

    Article  CAS  PubMed  Google Scholar 

  18. Zhang Z, Schwartz S, Wagner L, Miller W: A greedy algorithm for aligning DNA sequences. J Comput Biol 2000, 7(1–2):203–214. 10.1089/10665270050081478

    Article  CAS  PubMed  Google Scholar 

  19. Mavromatis K, Ivanova N, Barry K, Shapiro H, Goltsman E, McHardy AC, Rigoutsos I, Salamov A, Korzeniewski F, Land M, et al.: Use of simulated data sets to evaluate the fidelity of metagenomic processing methods. Nat Methods 2007, 4(6):495–500. 10.1038/nmeth1043

    Article  CAS  PubMed  Google Scholar 

  20. Poretsky RS, Hewson I, Sun S, Allen AE, Zehr JP, Moran MA: Comparative day/night metatranscriptomic analysis of microbial communities in the North Pacific subtropical gyre. Environ Microbiol 2009, 11(6):1358–1375. 10.1111/j.1462-2920.2008.01863.x

    Article  CAS  PubMed  Google Scholar 

  21. Gilbert JA, Field D, Huang Y, Edwards R, Li W, Gilna P, Joint I: Detection of large numbers of novel sequences in the metatranscriptomes of complex marine microbial communities. PLoS ONE 2008, 3(8):e3042. 10.1371/journal.pone.0003042

    Article  PubMed  PubMed Central  Google Scholar 

  22. Thompson JD, Higgins DG, Gibson TJ: CLUSTAL W: improving the sensitivity of progressive multiple sequence alignment through sequence weighting, position-specific gap penalties and weight matrix choice. Nucleic Acids Res 1994, 22(22):4673–4680. 10.1093/nar/22.22.4673

    Article  CAS  PubMed  PubMed Central  Google Scholar 

Download references

Acknowledgements

This study was supported by Award Number R01RR025030 to WL from the National Center for Research Resources (NCRR). The content is solely the responsibility of the authors and does not necessarily represent the official views of the NCRR or the National Institutes of Health. SS was supported by the Gordon and Betty Moore Foundation through the CAMERA project.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Weizhong Li.

Additional information

Authors' contributions

BN designed and carried out the study, analyzed the results and wrote the manuscript. LF implemented the method and wrote the manuscript. SS prepared the datasets and analyzed the results. WL conceived of the study, implemented the method and wrote the manuscript. All authors read and approved the final manuscript.

Authors’ original submitted files for images

Below are the links to the authors’ original submitted files for images.

Authors’ original file for figure 1

Authors’ original file for figure 2

Rights and permissions

Open Access This article is published under license to BioMed Central Ltd. This is an Open Access article is distributed under the terms of the Creative Commons Attribution License ( https://creativecommons.org/licenses/by/2.0 ), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Reprints and permissions

About this article

Cite this article

Niu, B., Fu, L., Sun, S. et al. Artificial and natural duplicates in pyrosequencing reads of metagenomic data. BMC Bioinformatics 11, 187 (2010). https://doi.org/10.1186/1471-2105-11-187

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/1471-2105-11-187

Keywords