in 1995 haemophilus influenza was the first free - living organism to have its genome completely sequenced , which took about a year to finish the 1.8  mb genome using conventional shotgun sanger sequencing . contrastingly , the development of high throughput next generation sequencing ( ngs ) platforms , with sequence outputs of now over 400,000  mb per day , has led to a rapid increase in the number of genomes available . this is highlighted by the ncbi short read archive ( sra ) passing the milestone of maintaining over 1 petabyte ( pb ) of whole genome sequencing ( wgs ) data at the end of 2014 ( figure 1(a ) ) , with metagenomic datasets currently contributing to 49 terabytes ( tb ) of this . moving from increasing sequence output , the subsequent development of benchtop sequencing platforms has enabled the transfer of ngs access from large sequencing centres to medium- and small - scale research settings . this combination of speed , capacity , and access to ngs platforms now holds great promise for public health microbiology [ 2 , 3 ] , as shown by recent studies on bacterial outbreaks and transmission dynamics [ 46 ] . development of wgs metagenomic methods is a logical extension of ngs within the clinical setting , ultimately moving from the analysis of individual pathogens within pure cultures to all organisms from a sample , providing pathogen identification and microbial community dynamics . the term metagenome was first coined in 1998 and was used to describe the collective genetic composition of soil microflora , although at this stage few genes were targeted to probe diversity among the taxa forming the microflora . current methods used to diagnose microbial pathogens within microbial rich sites ( such as the gut and respiratory tract ) or normally sterile sites ( such as blood or csf ) are largely based on conventional culturing of clinical samples . this consists of a battery of different growth media followed by identification , for example , by microscopy or maldi - tof , and then a complex series of susceptibility testing workflows are undertaken , including potential species typing . the whole process can take several days to weeks and even then can result in a culture - negative result . culture - independent methods can rapidly speed up this process to the timescale of hours through direct sequencing of the nucleic acids . while pcr assays have been designed to detect specific pathogens from clinical sample specimens [ 8 , 9 ] , it is the untargeted and open ended qualities of wgs metagenomics that make its application within the clinical setting advantageous , including areas such as obesity and diabetes [ 10 , 11 ] , as well as pathogen diagnostics . however , coupling shotgun metagenomics to clinical diagnostics also presents another set of challenges , and whilst these exist at both the wet- and dry - lab side , the main bottlenecks are within data analysis and the associated storage of raw and processed data . the computational problem of identifying pathogens within clinical metagenomics is typified by the idiom of searching for a needle in a haystack . sample sites can be highly complex , with potential pathogens surrounded by a complex background of commensal organisms at a range of abundances in addition to host nucleic acids . diagnostic metagenomics is one of the fastest growing fields within metagenomics , and numerous methods have been developed to help address this problem [ 1331 ] ( figure 1(b ) ) . these typically fall into sequence homology and to a lesser extent composition based approaches , and these have been increasing in number as the metagenomic data grows . focusing on sequence homology , which relies on comparison to a reference genome database , methods such as megan   use blast to bin unassembled reads or more recently employ fast short read mapping algorithms to decrease analysis times . other programs include metaphler   and sort - items , which are again based on blast . as an alternative to blast based methods , which can require significant computational time to search metagenomic sized datasets , recent faster methods have been based on kmer classifications such as kraken   and lmat . alternatively , the size of the comparison database can be reduced through use of smaller curated databases of gene markers , such as those employed by metaphian , although this provides a summary profile of the sample and does not use every read , potentially excluding useful information . future utility of metagenomics within the clinical setting will be dependent on the ability to detect multiple clinically relevant pathogens from a complex and host enriched background . here we have constructed a metagenomic analysis pipeline to answer the questions : are we able to use the metagenomic approach to detect a mixture of known human viral pathogens present at range of abundances and can we capture genomes at complete coverage within an unknown and complex biological model ? as part of the process of answering these questions , we describe here some of the challenges of analysing samples of unknown composition , such as the loss of sequence data through host and sample contamination . to bring the approach to the clinical laboratory all sequencing in this study was performed using benchtop technology to provide realistic sequencing depths , and the analysis pipeline was built using commodity hardware , reflecting typical infrastructure available to nondedicated sequencing centres with high throughput systems . a reagent containing a mixed population of 25 known viruses   was stored at 80c in 100  l aliquots . all aliquots were centrifuged at 3,000  g for 10 minutes and the supernatant was retained for generation of separate dna and rna libraries . the dna library used supernatant from one 100  l aliquot extracted using the purelink viral rna / dna kit ( life technologies - invitrogen ) according to manufacturer 's instructions , with the exception that 10  g of linear polyacrylamide ( lpa ) ( life technologies - invitrogen ) was used instead of the supplied carrier rna provided to aid with nucleic acid precipitation . samples were subsequently treated with 0.2  l rnase a ( epicentre ) by incubating at 37c for 15 minutes and 70c for 20 minutes . the repli - g single cell kit ( qiagen ) was used for amplification of dna following the manufacturer 's instructions for amplification of genomic dna from single cells with the exception that double the volume of dna input material was used and a 2-hour 30c incubation performed . for the rna library supernatant from one 100  l aliquot was extracted using a combination of the purelink viral rna / dna kit and zymo rna clean and concentrator kit . first the purelink kit was used for extraction as per the manufacturer 's instructions , with the addition of 5  g of lpa instead of the supplied carrier rna . after incubation at 56c , the sample was further purified using the zymo rna clean and concentrator kit as per the manufacturer 's instructions using 400  l of the purelink extract and eluted in 15  l of nuclease - free water . samples were subsequently treated with turbo dnase ( life technologies - ambion ) according to the recommended treatment protocol . reverse transcription and amplification were performed according to methods described previously , using the ovation rna - seq version 2 system ( nugen ) . amplified products were quantified using the qubit high sensitivity kit ( life technologies ) , samples were diluted to 0.2  ng/l , and dna and cdna libraries were prepared using the nextera xt library preparation kit ( illumina ) . faeces had been stored at 80c and thawed at room temperature for 1 hour before use . to homogenise the faeces , 2  ml of 1x pbs and 1  ml of 2% 2-mercaptoethanol were added to aid in dissolution of cells and samples were placed on a rotator for 2 hours . the homogenised faeces were transferred to a 50  ml falcon tube and centrifuged at 3,000  g for 10 minutes , with supernatant removed , and then 5  ml of fresh 1x pbs was added to resuspend the cells . centrifugation and washing were repeated and the pellet was resuspended in 5  ml of 1x pbs . the homogenate was filtered through a 100  m vacuum filter ( millipore ) and washed with an additional 1  ml of 1x pbs and filtered again to increase yield . the filtrate was further filtered through a 40  m vacuum filter ( millipore ) . cells were centrifuged at 3,000  g for 10 minutes and supernatant was removed and resuspended in 1  ml 1x pbs . selective lysis was performed using the molysis selective lysis kit ( molzym ) with modifications . briefly , to 1  ml of sample , 260  l of cm buffer was added and incubated at room temperature for 15 minutes . subsequently 250  l of db1 buffer and 10  l of moldnase b were added and incubated at room temperature for 15 minutes . the cells were spun at 12,000  g for 2 minutes and supernatant was removed . the pellet was resuspended in 100  l of a dnase i , prepared following manufacturers guidelines , and incubated at 37c for 30 minutes . cells were subsequently centrifuged at 12,000  g for 2 minutes , supernatant was removed , and the pellet was resuspended in 1  ml of rs buffer . the remaining pellet was extracted using the masterpure complete kit ( epicentre ) according to manufacturer 's instructions and eluted in 35  l of te buffer . the quality of extracted nucleic acids was determined by analysis on the tape station using the genomic dna screen tape kit ( agilent ) . samples were prepared in duplicate , and similar to the viral sample , libraries were generated with the nextera xt library preparation kit ( illumina ) according to the manufacturer 's instructions . prepared libraries were sized using a bioanalyser and the high sensitivity dna kit ( agilent ) and quantified using abi viaa7 and kapa illumina library quantification kit ( kapa biosystems ) . the dna and cdna libraries for the viral sample were sequenced using the miseq reagent kit v2 ( 300 cycles ) ( illumina ) and the duplicate porcine libraries using the miseq reagent kit v3 ( 600 cycles ) ( illumina ) , both according to manufacturer 's guidelines . all sequencing data has been deposited within the ebi ena , under the study accession number prjeb10064 ( samples ers804108-ers804111 ) . filtering of pe reads consisted of read inspection , trimming of adapter and poor quality bases , and finally removal of reads corresponding to host genomes . key quality control metrics were calculated using fastqc ( v0.11.2 ) , and trimmomatic ( v0.32 )   was used to remove potential adapter contamination and poor quality reads . the adaptor database used by trimmomatic was an in - house database of illumina adapters , primers , and index sequences , and trimming consisted of an initial head crop of the first 15  bp , followed by iterative removal of leading and trailing bp with phred qualities < 20 and throughout the read length with mean base phred qualities < 20 in 4  bp sliding windows . remaining sequences with lengths < 40  bp after trimming were discarded as well as orphan single end reads . fastq screen ( v0.4.4 ) ( babraham institute ) was used to map all reads to a panel of potential host genomes and all unmapped paired end reads output to new fastq files for downstream analysis . default parameters were used within fastq screen , with the exception of outputting reads that did not map to any host genome using the no hits parameter and using bowtie2 ( v2.0.2 ) as the aligner , with all mapping parameters hard set within the fastq screen program . the viral sample was mapped to three host genomes : human ( grch38 ) , cow ( bos taurus umd 3.1.1 ) , and chicken ( gallus gallus-4.0 ) , whilst the porcine sample was mapped to two host genomes : human ( grch38 ) and pig ( sus scrofa 10.2 ) . any potential remaining vector contamination was also quantified and removed using fastq screen and mapping against the ncbi univec database ( v8 ) . targeted detection of the 25 viruses within the viral sample was based on the metagenomic binning tool bbsplit ( v33 ) , which uses bbmap for mapping and is part of the bbtools software suite . an index of 25 respective viral genomes sequences was used as references , detailed in table s1 in supplementary material available online at http://dx.doi.org/10.1155/2015/292950 . default mapping parameters were used except for the following : minratio 0.56 , minhits 1 , and maxindel 16000 , which are equivalent to the default parameters within the bbmap . the ambig2 = split parameter was also used so that in cases where reads mapped to more than one bin , that is , more than one reference genome , these were copied into separate ambiguous bins and discarded . an in - house script was then used to parse the mapping output to generate a single mapping report file . ray meta   ( v2.3.1 ) was used to assemble all unmapped paired end reads from the targeted viral mapping stage . the mpi version of ray meta was compiled and a kmer length of 61 used based on the n50 length and number of contigs generated . recovery of abundance levels was achieved by reference - based mapping of the unmapped reads onto the assembled contigs using bwa mem ( v.0.7.5a - r405 )   and default parameters . contigs were classified by blastn using the ncbi nt database ( downloaded locally on 23 - 10 - 14 ) and subsequent blast hits filtered by a small shell script using the following criteria : percent identification  90% ; e - value 1.0  10 ; bit score of 50 . finally , classified contigs were assigned to taxa using the lowest common ancestor ( lca ) algorithm as implemented within krona tools ( v2.4 )   and using default parameters within the ktimportblast and ktclassifyblast perl scripts , generating an html formatted krona chart and tab formatted output , respectively . the average blast loge - value of the contigs was used to colour the taxa within krona . a custom database was built for kraken using refseq ( version 66 ) complete bacteria ( 3,471 genomes ) , virus ( 4,121 genomes ) , and archaea ( 307 ) genome sequences . an additional 141 viral genbank genomes were included to supplement viral targets used for other studies , making a total of 8,040 genomes for classification by kraken . default parameters were used to build the database and run the classifications , and the complete kraken database took 2 hours to build on a server with 12 cpus ( 2.7  ghz ) and 132  gb of ram , whilst classification of each sequencing dataset required 76  gb ram . genome coverage across select genome sequences was calculated by reference - based mapping using the above bbsplit ( v33 ) metagenomic binning tool , and the genomecov command within bedtools   to calculate per base genome coverage depths . as proof of concept and to test the bioinformatics pipeline assembled we have sequenced and analysed two metagenomic samples selected to provide different methodological challenges using the benchtop illumina miseq platform . the first dataset is a representative  knowns  mixed viral sample , containing a panel of 25 clinically relevant human viruses at a range of concentrations ( abundances ) as determined by qpcr and described previously   ( table 1 ) . the viral sample consisted of a mixture of dna and rna viruses , as well as multiple serotypes , including adenovirus types 2 and 41 and parainfluenza virus types 14 . the second dataset , a nonhuman model , was generated from porcine faeces to represent an  unknowns  sample and was expected to harbour a complex mixture of taxa at a range of abundances . the viral sample was split over two indexed libraries , as separate dna and rna libraries were generated to enable capture of the two viral types , which were pooled together after sequencing . the nonhuman model sample was sequenced as two technical replicates within a single miseq run . the technical replicates were found to be highly correlated based on genus abundance profiles using the subsequent taxonomic analysis ( pearson 's r = 0.99 ) and were therefore pooled and treated as a single dataset . in total 13.5  m 150  bp and 12.7  m 300  bp paired end ( pe ) reads were generated for the viral panel and nonhuman model datasets , corresponding to a sequence base yield of 4.1 gigabases ( gb ) and 7.6  gb , respectively . a bioinformatic pipeline was constructed to address the questions set out by this study and this was divided into two approaches ( figure 2 ) . approach used the composition of the viral dataset to bin sequence reads simultaneously by mapping to reference sequences of the expected 25 viruses in a targeted approach ( table 1 and table s1 ) , with the aim of identifying each of the viruses from the complex viral types present , as well as from multiple host backgrounds . to further probe the rest of the sample , highlighting potential contamination , the alternative  unknowns  approach was designed for the main purpose of fast taxonomic classification of the nonhuman model sample , to identify as many taxa as possible and reveal the extent to which the genome sequences were captured . the pipeline has three common stages , quality control , read trimming , and a host screen . this starts by using fastqc   to calculate general quality control ( qc ) metrics , such as per base qualities , followed by trimmomatic , which removes poor quality base calls and potential adapter sequences , and finally host removal by reference - based mapping using the bowtie2   aligner against a panel of expected host sequences , such as human or porcine . the metagenomic binning algorithm bbsplit   was used to simultaneously map reads to all 25 viruses , whilst ignoring ambiguous reads that map to multiple references . to enable as comprehensive as possible capture of the sample , this decreased the computational burden of the later blast search against the ncbi nonredundant nt database , reducing the number of queries from millions of reads to low thousands of contigs . as a targeted mapping approach was not possible for the nonhuman model dataset , a fast classification pipeline was built around a recent kmer classification method , kraken , and using a database of just over 8,000 genomes ( see section 2.5 ) . stages were implemented using the modular bioinformatics pipeline language , bpipe , which handles the initiation and overall tracking of each of the computational tasks , but with little overhead compared to other higher level pipeline tools such as galaxy or taverna [ 45 , 46 ] . the targeted mapping approach was used to determine if it was possible to computationally identify a complex sample of mixed virus types within one sequencing assay . although this is unrealistic in terms of the range of viral pathogens present within a sample and used prior knowledge of the viral targets , it provides a proof of concept that can be later developed . this approach took < 30  min following qc to complete mapping and reporting . table 1 shows the number of target viral reads detected . in total 20 of the 25 viruses were identified , and these showed great variance in their relative abundances , with detection of 8 viruses based on < 10,000 mapped reads , representing < 0.1% of the qc passed sequence data . interestingly , within the set of 5 undetectable viruses , 4 correlated with those that were also undetectable by qpcr ( ct > 37 ) , whilst the remaining virus , coronavirus 229e , had the highest recorded ct value of the dataset ( 36.48 ) . as part of this study an alternative metagenomic classification method was used based on kmer matches to a large bacterial and viral database , and to serve as a comparison , the virus dataset was next treated as an unknown sample and entered into this pipeline . overall the kmer - based method was highly similar to the mapping approach based on the number of reads classified to each virus ( pearson 's r = 0.98 ) , with 57.3% ( 6.5  m reads ) and 43.0% ( 4.8 m reads ) of the qc passed reads classified to the target viruses for the mapping and kmer approaches , respectively ( table 1 ) . the whole process took just over 1 hour to report the results , with the classification of the 11.3  m input reads only taking 23 minutes ( 122.30  mb / minute ) and the majority of the additional time spent loading the large database into memory plus reporting the results using krona tools . using this method 21 of the 25 viruses were detected ( table 1 ) , but as before several of these were based on a very low number of classified reads , with 9 detected viruses based on < 10,000 reads . whilst these low abundance levels likely represent the low concentrations of many viruses within the sample , as reflected by the mean ct value ( 31.39 ) ( table 1 ) , this highlights the challenge of distinguishing very low abundance levels from a potentially complex background . furthermore , it has recently been shown that introduction of bacterial contamination within metagenomic samples can have devastating effects on interpretation of the microbial diversity present in a sample , with contamination originating from sample preparation processes , including dna extraction kits , reagents , and even molecular grade water [ 4749 ] . in an attempt to classify the origin of the remaining sequences , all 4.8  m reads from the viral dataset that were left unclassified by the targeted mapping method were entered into a further assembly based classification pipeline ( figure 2 ) . this process took just over 7 hours to complete , generating 1,398 contigs 100 bases in length , with an n50 of 801 bases . however , the blast step only classified 372 of these contigs , corresponding to 31.3% ( 1.5  m ) of the unmapped reads , with the remaining 3.3  m reads unclassified despite use of the comprehensive ncbi nt database . over half of the reads mapping to the contigs were identified as the target viruses ( 0.9  m reads ) , likely reflecting sequence divergence from the references used in the initial targeted mapping stage . interestingly some of the classified nontarget taxa were viral pathogens associated with the hosts used to culture the viruses , such as the identification of bovine viral diarrhoea virus , probably originating from the use of bovine serum in viral cultivation . however , most of the nontarget taxa belonged to bacterial species ( 0.5  m reads ) , including the families enterobacteriaceae and pseudomonadaceae , such as escherichia coli ( figure 3 ) . whilst these nontarget classifications can be ignored for the purposes of this study , such species are clearly important in the public health setting . inclusion of appropriate no - template or no - virus / bacteria controls run in parallel with samples will likely be crucial to help define the expected level of background due to reagent contamination , sample cross - contamination , on - instrument contamination , and read misclassification . we next applied the kmer classification part of the pipeline to the nonhuman model dataset . classification of the 11.5  m qc passed reads by kraken took 1 hour and 17 minutes ( 66.60  mb / minute ) , and the total time to completion took < 2 hours . the increased time of this analysis was due to the greater read lengths used for the nonhuman model dataset , with 300  bp reads generated instead of 150  bp for the viral panel sequencing . in total 2.8  m reads ( 24.2% ) were classified ( figure 4(a ) ) , and these were spread across 1,617 species , although this dropped to 146 species if only those above 0.1% abundance levels were included . focusing on the bacterial diversity , 5 genera accounted for 70.1% of the classified reads , consisting of lactobacillus , bifidobacterium , streptococcus , blautia , and ruminococcus , all of which have been found to be highly abundant within other metagenomic studies based on porcine faecal material . by far the most abundant genus was lactobacillus , consisting of 23 species and 51.7% of identified reads before application of any abundance level cutoffs . a round of reference - based mapping was performed on this genus to determine the extent to which the species was captured in terms of genome coverage . as expected the highly abundant species , lactobacillus reuteri , achieved the greatest complete coverage ( 98.6% ) across the ~2  mb genome and at 234.7-fold depth ( figure 4(b ) and table 2 ) , with three other species achieving greater than 50% coverage . the remaining 19 species were of low abundances ( < 0.5% ) and consequently achieved minimal genome coverage ( < 5% ) , demonstrating the need for a greater sequence output should genome capture at this abundance level be required . following sequencing , the millions of short reads generated proceeded through several preprocessing steps and finally taxonomic classification , all of which result in a reduction in usable read numbers . to illustrate the progressive loss of sequencing reads and fluctuations in sizes of the sequence and intermediate data , table 3 shows the number of sequences within specific stages of the pipeline and the storage required for these . predicted read numbers for the two samples were based on the maximum output from the sequencing chemistry kits used . these can help guide the experimental design , including the desired number of sequencing reads to capture the microbial community expected within the sample . but as seen for the nonhuman model , where 50.9% of the predicted reads were obtained , effects such as low flow cell cluster density can result in lower than expected output . preprocessing is another source of sequence loss , resulting in 2.3  m reads ( 16.8% of raw reads ) and 1.2  m reads ( 9.6% of raw reads ) being discarded from the viral and nonhuman model datasets , respectively ( table 3 ) . ultimately , 53.4% of the viral dataset and 11.2% of the nonhuman model dataset reads were used in classification of the microbial diversity . either an increase in the number of reads generated or alternative library normalisation methods are required to provide better capture of the genome sequences within the metagenomic samples . for metagenomics to be transferred from the experimental research setting and to be used for discovery of emerging pathogens and variants through use in the clinical setting , new methods are required to manage and interpret the sequence data . a key aspect of any clinical assay is definition of sensitivity to detect a given pathogen . calculation of such a parameter within metagenomics is complicated by the fact that the pathogen of interest is not defined in advance , and the concentration of pathogen nucleic acid at which clinically relevant disease occurs may vary dramatically between different agents . it is not feasible to empirically define limits of detection using dilutions of every possible pathogen ; however the use of reference materials of clinical interest is a logical starting point . here we employed two clinically relevant sample types to demonstrate a proof of concept approach to identifying multiple viral types from a complex background of host and bacteria within a known sample and extended this out into an unknown sample , capturing the genomes of several bacterial species . our study demonstrates that it is now possible to build a diagnostic pipeline that takes raw sequence reads and provides a comprehensive bacterial and viral identification of clinically relevant samples within a few hours and on modest commodity hardware . as is common with the application of a new method , several challenges will need to be overcome , including the waste of sequencing reads corresponding to host nucleic acids , background contamination , and improved handling of the range in species abundances to facilitate better capture of microbial diversity .
availability of fast , high throughput and low cost whole genome sequencing holds great promise within public health microbiology , with applications ranging from outbreak detection and tracking transmission events to understanding the role played by microbial communities in health and disease . within clinical metagenomics , identifying microorganisms from a complex and host enriched background remains a central computational challenge . 
 as proof of principle , we sequenced two metagenomic samples , a known viral mixture of 25 human pathogens and an unknown complex biological model using benchtop technology . 
 the datasets were then analysed using a bioinformatic pipeline developed around recent fast classification methods . 
 a targeted approach was able to detect 20 of the viruses against a background of host contamination from multiple sources and bacterial contamination . 
 an alternative untargeted identification method was highly correlated with these classifications , and over 1,600 species were identified when applied to the complex biological model , including several species captured at over 50% genome coverage . in summary , this study demonstrates the great potential of applying metagenomics within the clinical laboratory setting and that this can be achieved using infrastructure available to nondedicated sequencing centres .