scieee AI-readable full text Open interactive document viewer

Flujo de Trabajo para el Análisis Exhaustivo de Metagenomas

Perez-Wohlfeil, Esteban

Abstract

El desarrollo de nuevas tecnologías de adquisición de datos ha propiciado una enorme disponibilidad de información en casi todos los campos existentes de la investigación científica, permitiendo a la vez una especialización que resulta en desarrollos software particulares. Con motivo de facilitar al usuario final la obtención de resultados a partir de sus datos, un nuevo paradigma de computación ha surgido con fuerza: los flujos de trabajo automáticos para procesar la información, que han conseguido imponerse gracias al soporte que proporcionan para ensamblar un sistema de procesamiento completo y robusto. La bioinformática es un claro ejemplo donde muchas instituciones ofrecen servicios específicos de procesamiento que, en general, necesitan combinarse para obtener un resultado global. Los ‘gestores de flujos de trabajo’ como Galaxy [1], Swift [2] o Taverna [3] se utilizan para el análisis de datos (entre otros) obtenidos por las nuevas tecnologías de secuenciación del ADN, como Next Generation Sequencing [4], las cuales producen ingentes cantidades de datos en el campos de la genómica, y en particular, metagenómica. La metagenómica estudia las especies presentes en una muestra no cultivada, directamente recolectada del entorno, y los estudios de interés tratan de observar variaciones en la composición de las muestras con objeto de identificar diferencias significativas que correlacionen con características (fenotipo)de los individuos a los que pertenecen las muestras; lo que incluye el análisis funcional de las especies presentes en un metagenoma para comprender las consecuencias derivadas de éstas. Analizar genomas completos ya resulta una tarea importante computacionalmente, por lo que analizar metagenomas en los que no solo está presente el genoma de una especie sino de las varias que conviven en la muestra, resulta una tarea hercúlea. Por ello, el análisis metagenómico requiere algoritmos eficientes capaces de procesar estos datos de forma efectiva y eficiente, en tiempo razonable. Algunas de las dificultades que deben salvarse son (1) el proceso de comparación de muestras contra bases de datos patrón, (2) la asignación (m apping ) de lecturas (r eads ) a genomas mediante estimadores de parecido, (3) los datos procesados suelen ser pesados y necesitan formas de acceso funcionales, (4) la particularidad de cada muestra requiere programas específicos y nuevos para su análisis; (5) la representación visual de resultados ndimensionales para la comprensión y (6) los procesos de verificación de calidad y certidumbre de cada etapa. Para ello presentamos un flujo de trabajo completo pero adaptable, dividido en módulos acoplables y reutilizables mediante estructuras de datos definidas, lo que además permite fácil extensión y customización para satisfacer la demanda de nuevos experimentos.

Full text

       2   ESCUELATÉCNICASUPERIORDEINGENIERÍAINFORMÁTICA GRADUADOENINGENIERÍAINFORMÁTICA   FlujodeTrabajoparaelAnálisisExhaustivodeMetagenomas  ComputationalWorkflowfortheFineGrainedAnalysisof MetagenomicSamples    Realizadopor ESTEBANPÉREZWOHLFEIL Tutorizadopor OSWALDOTRELLESSALAZAR Departamento DEPARTAMENTODEARQUITECTURADECOMPUTADORES   UNIVERSIDADDEMÁLAGA MÁLAGA,Juniode2016    Fechadefensa: ElSecretariodelTribunal            3     4   RESUMEN El desarrollo de nuevas tecnologías de adquisición de datos ha propiciado una enorme             disponibilidad de información en casi todos los campos existentes de la investigación            científica, permitiendo a la vez una especialización que resulta en desarrollos software            particulares. Con motivo de facilitar al usuario final la obtención de resultados a partir de sus                datos, un nuevo paradigma de computación ha surgido con fuerza: los flujos de trabajo              automáticos para procesar la información, que han conseguido imponerse gracias al soporte            que proporcionan para ensamblar un sistema de procesamiento completo y robusto. La            bioinformática es un claro ejemplo donde muchas instituciones ofrecen servicios específicos           de procesamiento que, en general, necesitan combinarse para obtener un resultado global. Los             ‘gestores de flujos de trabajo’ como Galaxy [1], Swift [2] o Taverna [3] se utilizan para el                 análisis de datos (entre otros) obtenidos por las nuevas tecnologías de secuenciación del             ADN, como Next Generation Sequencing [4], las cuales producen ingentes cantidades de            datos en el campos de la genómica, y en particular, metagenómica. La metagenómica estudia              las especies presentes en una muestra no cultivada, directamente recolectada del entorno, y             los estudios de interés tratan de observar variaciones en la composición de las muestras con               objeto de identificar diferencias significativas que correlacionen con características (fenotipo)          de los individuos a los que pertenecen las muestras; lo que incluye el análisis funcional de las                 especies presentes en un metagenoma para comprender las consecuencias derivadas de éstas.            Analizar genomas completos ya resulta una tarea importante computacionalmente, por lo que            analizar metagenomas en los que no solo está presente el genoma de una especie sino de las                 varias que conviven en la muestra, resulta una tarea hercúlea. Por ello, el análisis              metagenómico requiere algoritmos eficientes capaces de procesar estos datos de forma           efectiva y eficiente, en tiempo razonable. Algunas de las dificultades que deben salvarse son              (1) el proceso de comparación de muestras contra bases de datos patrón, (2) la asignación               (mapping  ) de lecturas (reads  ) a genomas mediante estimadores de parecido, (3) los datos             procesados suelen ser pesados y necesitan formas de acceso funcionales, (4) la particularidad             de cada muestra requiere programas específicos y nuevos para su análisis; (5) la             representación visual de resultados ndimensionales para la comprensión y (6) los procesos de             verificación de calidad y certidumbre de cada etapa. Para ello presentamos un flujo de trabajo               completo pero adaptable, dividido en módulos acoplables y reutilizables mediante estructuras           de datos definidas, lo que además permite fácil extensión y customización para satisfacer la              demandadenuevosexperimentos. Palabrasclave:flujodetrabajo;análisisdemetagenomas;cienciadebigdata;asignaciónde lecturas;genómicacomparativa  5   ABSTRACT  The development of new data acquisition systems has promoted an enormous quantity of             available data in nearly all scientific fields, thus enabling a more specificoriented research             that is resulting in concrete software developments. In the aim of making it simpler for the                final user to obtain processed results from raw data, a new computational paradigm is arising:               the use of automated workflows for data processing. These have managed to take the lead               because of their potential to build complete and reliable processing systems. In particular, the              field of bioinformatics is a clear example where lots of worldwide institutions are offering              specific services that need to be combined to produce valuable results. Automated workflow             managers such as Galaxy, Swift or Taverna are constantly being used for data analysis,              especially since the development of new sequencing technologies such as Next Generation            Sequencingthatarecapableofproducingvastsamountsofgenomicandmetagenomicdata. Metagenomics aims to study the collection of species present at their original environment.             Within the metagenomics field, different types of studies can be carried out; among them,              comparative studies of the changes in the composition of samples in the aim of identifying               significant differences that correlate phenotype and the individuals, which includes functional           analysis of the present species to determine the derived consequences of their presence. While              genomics still offers computational difficulties, the science of metagenomics proposes a           multiple analysis of unknown species, and therefore requires efficient algorithms capable of            processing the enormous amounts of data in reasonable time. Some of the difficulties to be               faced are (1) the sequence comparison process with a reference database, (2) the process of               mapping reads to species (3) the large size of processed results requires functional storage to               allow posterior use in an efficient way, (4) the specificity of each sample demands new               processing methods, (5) representation and visualization of ndimensional aspects and (6)           qualitycontrolandverificationmethodstoensurethecorrectnessoftheprocess.  Therefore we present a complete workflow divided into software modules connected by open             and reusable datafiles, which, in conjunction, enables future extension and customization to            satisfythedemandofnewexperiments. Keywords:workflow;metagenomeanalysis;bigdatascience;readsmapping;comparative genomics  6   TABLEOFCONTENTS  Chapter1:Introduction......................................................................................... 9 Themainreasonsthatmotivatedthedevelopmentoftheproposedworkflow. 1.1Motivation................................................................................................... 9 1.2Projectobjectives........................................................................................ 11  Chapter2:Stateoftheart..................................................................................... 13 Background of the current stateoftheart methods that intent to address the           difficultiesposedbythefieldofmetagenomics. 2.1Introduction................................................................................................. 13 2.2Standalonetools.......................................................................................... 14 2.2.1MEGAN.............................................................................................. 14 2.2.2MetaPhlAn.......................................................................................... 16 2.2.3MOCAT............................................................................................... 18 2.3Webbasedtools.......................................................................................... 19 2.3.1MGRAST........................................................................................... 19 2.3.2EBIMetagenomics.............................................................................. 20  Chapter3:Analysisanddesign............................................................................. 23 Analysis of the requisites of the proposed method and formalization of these to             fullydefinethefunctionalityofthedevelopedworkflow. 3.1Analysisofgeneralaspects......................................................................... 23 3.2Pipelinedesignandspecifications.............................................................. 24 3.2.1Generalmappingpipeline................................................................... 24 3.2.2Specificfinegrainedpipeline............................................................. 27 3.3Specificationsoftheworkflowmanager..................................................... 29  Chapter4:Implementationandresults............................................................... 31 The system implementation is explained in detail, showing how each independent           module solves a particular problem. Results are shown and neatly explained,           illustratingtheadvantagesoftheusageoftheproposedmethod. 4.1Introduction................................................................................................. 31 4.2Implementationandresults......................................................................... 35 4.2.1Toolsforthemappingstep.................................................................. 35 4.2.1.1FormatREF........................................................................... 35 4.2.1.2MGRindex............................................................................ 36 4.2.1.3BlastToJoiner,GeckoToJoinerandReverseComplement.... 37 4.2.1.4TaxoMaker............................................................................ 39 4.2.1.5FastaFreqs,SearchSpaceandKLambda............................... 40 7   4.2.1.6FJoiner................................................................................... 41 4.2.1.7Gmap..................................................................................... 43 4.2.2Toolsforthefinegrainedlevelandfurtherprocessing....................... 47 4.2.2.1 QualityMapping................................................................... 47 4.2.2.2GeneParser............................................................................ 48 4.2.2.3CodingAbundances.............................................................. 49 4.2.2.4AnnotationalMapping.......................................................... 51 4.2.2.5GenomeProfileofAccumulatedReads............................... 53 4.2.2.6GenomeCutter,SpecificRegionsandSpecificReads......... 54 4.2.2.7CoverageIdentityMatrix..................................................... 55 4.2.3GalaxyImplementation....................................................................... 57 4.2.4Galaxy’stooldefinitionlanguage........................................................ 57  Chapter5:Usecasesvalidation............................................................................. 61 Verification of the correctness of the workflow is done via utilization of use cases,              discussingandcomparingtheresults. 5.1Leanandobesesamples.............................................................................. 61 5.1.1Datasetavailability.............................................................................. 61 5.1.2ComparisonwithMEGAN................................................................. 62 5.1.3Statisticalvalidation............................................................................ 63 5.2Sickandhealthyswinesamples.................................................................. 64 5.2.1Datasetavailability.............................................................................. 64 5.2.2ComparisonwithMEGAN................................................................. 65 5.2.3Statisticalvalidation............................................................................ 66  Chapter6:Conclusions.......................................................................................... 69 Conclusions of the software, future improvements and general comments of the           workdeveloped. 6.1Conclusionsofthedevelopedworkflow...................................................... 69 6.1.1.Conclusionesdeltrabajodesarrollado................................................ 70 6.2Furtherextensionsandimprovementsontheworkflow.............................. 71 6.3Acknowledgments........................................................................................ 71  Chapter7:Bibliography......................................................................................... 73  AppendixI:GuidedExerciseusingGalaxy.     8   CHAPTER1. INTRODUCTION 1.1.Motivation  TheuseofInternetinthescientificcommunityhaspromotedanenormousquantityof availabledatainalmostanyexistingfield,enablingamorespecificallyorientedresearch. Suchcircumstances,however,areresultinginanincreasingnumberofsoftwareprojects beingdevelopedforparticularscientificandprocessingtasksthatoncefinishedare abandonedsinceitbecomesextremelydifficultfortheaverageusertoruntheparticulartools onhis/herownandthereforegivesuprapidly.Asasideeffect,manyofthesedevelopedtools arebeingincludedasWebServices(inadvanceWS),facilitatingremoteanduniversalaccess andremovingthesomewhattediousstepofdownloadingandinstallingtoolsonlocal machines.However,theseincreasingnumberofofferedWSaretriggeringascenariowhere processingtoolsexistfornearlyeverything,butitisbecomingharderandhardertoreach them,andhasgottentoapointwheretheterm“WebServicesFragmentation”isgaining popularity.Inaddition,suchWSdispersioniscausingworktoberepeatedoverandoverby differentresearchteams,forsearchingforanalreadyexistingWScanbecomparedtolooking foraneedleinahaystack,andthusscientificteamsaredemandingforregistersitesto facilitatethesocalledWSdiscovery.Furthermore,independentWScanbecombinedto producenewdataprocessingnodesthatifnotavailablewouldhaveneedcompletelynew softwaredevelopments.This“combination”oftoolsandservicesarecalledWorkflows, definedas“theorchestratedandrepeatablepatternofbusinessactivityenabledbythe systematicorganizationofresourcesintoprocessesthattransformmaterials,provideservices orprocessinformation  ” .Workflowshavebeenusedsince1921byTheRailwayEngineer 1 journal(LawrenceSaunders;S.R.Blundstone,1921)butthetermwasnotusedinthesame senseastodaysinceFrederickTaylorandHenryGantt(knownforhispopularGanttcharts). AutomatedworkflowmanagerssuchasGalaxy,TavernaandMyExperiment[5](among others)wereborntoofferadefinitionlanguagetocombinetools,alongwiththeexecution componentsneededtocompletelyrunthepreviouslydefinedworkflows.Thewideuseof theseautomatedworkflowmanagersmainlymotivatedthedevelopmentofaseriesof independenttoolsandservices,thatputtogetherwouldcomposeafullpipelinewhich,in addition,couldbebuiltandregisteredandusedasaserviceviaautomatedworkflow managers.  Additional reasons that motivated the development of this workflow is the exponential            growth of available metagenomic (“beyond genomes”) data due to the improvements in the             1https://www.ftb.ca.gov/aboutFTB/Projects/ITSP/BPM_Glossary.pdf 9   Computing. In addition, the complete dependency of the BLAST suite to run the sequence              comparison steps (up to MEGAN 4 [19]) makes the software monolithic and slow, since there               are new methods to compute homology searches in less time and with almost the same results                (e.g. KRAKEN [20], CLARK [21] and GECKO [22]). Furthermore, MEGAN does not offer             support for lowabundant genomes and only considers as results of interest those that have a               large number of mapped reads, hence discarding any taxonomic result that is not directly              supported by large mapped readsabundance. A conceptual drawback of MEGAN is its lack             of modularpipeline design. MEGAN software only allows for fixed processing, i.e. it is not              possible to contrast results using different sources, it can not be expanded upon wish and               necessity, and more important, MEGAN’s individual capabilities can not be combined to            produceotherresultsandthereforecannotbereusedwithease.  2.2.2.MetaPhlAn  MetaPhlAn[23]isacomputationaltoolforprofilingthecompositionofmicrobial communitiesfrommetagenomicshotgunsequencingdata.MetaPhlAncanuseeitherBLAST orBowtie2[24]toperformasearchofthespecificmarkergenesagainstareferencedatabase. MetaPhlAnisafastmetagenomicabundanceestimationtoolwhichmapsreadstoa setofselectedmarkersequencesthatareuniqueforeachorganisminthedatabase.The markersequencesarecarefullyselectedsuchthatareadcanonlymatchtoonemarkerand canthereforebeassignedtoadistinctorganism.Togetherwiththesmallsizeofthemarker sequencedatabase,thismakesMetaPhlAnveryfastwhiletheaccuracyiscomparabletoother referencebasedmethods.However,sincethegenomesarereducedtoshortmarkersequences, thereisnopossibilitytodetectorevenquantifydifferencesbetweenthesequencedorganism andthereference.Organismsthatcontainmarkersequencesofdifferentreferencestrains(e.g. byhorizontalgenetransfer)showupintheresultsmultipletimesanditisnotpossibleto detectsuchcases.   16   Figure3:MetaPhlAn’sprocessingpipelineoverview.(1)Inputstagetakesametagenomeproducedby shotgunsequencing(e.g.454pyrosequencing,Illumina),(2)theoutputisatableshowingthereads abundanceperspeciesand(3),theendingvisualizationstagethatenablesuserstointeractandexport heatmapsandcladograms,amongothers.  IncontrasttoMEGAN,MetaPhlAnisnotdesignedtoworkwithpairedendreadsand thereforethesetypeofreadsshouldbeconcatenatedinonesinglefiletoworkwith. MetaPhlAnhasbeendevelopedunderUNIXenvironmentsinthePythonprogramming language,anditismostlyorientedtoitsuseonshell,thoughitalsoprovidesaGalaxy workflowinstancethatcanbedownloadedandinstalled. MetaPhlAnproducesatabulartextfilewiththereadsabundanceperspecies,along withaseriesofheatmapsandcladogramsthathelpdetectsignificantvariationbetween speciesandunderstandtheassignationofreadstotaxa,respectively.   Figure4:CladogramproducedbyMetaPhlAnshowingtheassignationofreadstogenomesbyspecies, phylumandfamily.Althoughthesetypeofgraphsallowtotakeafirstglanceatthetaxonomical results,itbecomeshardtopreciselydeterminetheabundancedifferencesamongphylum.  However, since MetaPhlAn only classifies a subset of reads that map to one of its               marker genes, its results are only estimations of the species that populate the sample and a                largeportionoftheDNAmaterialisunused,andthereforebecomesunusedinformation. In a field as effervescent as metagenomics, which is steadily expanding itself with new              experiments and knowledge extracting methods, it becomes necessary to enable a handy, easy             extension of the capabilities of the analysis software, thus avoiding developing functional            17   packages that will not be used due to new requested experiments. In this line, MetaPhlAn               offers a fully functional pipeline design which, in contrast with MEGAN, can be extrapolated              to reuse in newer software developments and integrated into larger webservers that offer             metagenomicsanalysis.  2.2.3.MOCAT  MOCAT [25] is a software pipeline for metagenomic sequence assembly and gene            prediction for taxonomic and functional abundance profiling. Since it is a gene prediction             tool, it searches for single copies of particular marked genes across different databases. The              automated generation and efficient annotation of nonredundant reference catalogs by          propagating precomputed assignments from 18 databases covering various functional         categoriesallowsforfastandcomprehensivefunctionalcharacterizationofmetagenomes.  The second version of MOCAT released supports Illumina single and pairedend           reads in raw FastQ format. MOCAT2 [26] generates taxonomic and functional profiles, as             wellasassemblereadsandpredictgenesinassembledsequences.  Figure5:MOCAT’sprocessingpipeline.Thetopboxinorangerepresentsthedatagathering stepfromtheenvironment,whichmustbedonepriortorunningtheworkflow.Inlightpurple,the MOCATpipelineshowsthatsomestepscanbebothskippedorransequentially,e.g.onlytheread 18   trimming,assemblyandgenepredictionstepsaremandatorytoproduceanestimationofthe taxonomicalresults.Ontheotherhand,readalignmentandremoval,alongwiththeassemblyrevision, areoptionalandshouldbedoneforqualityimprovementifdesired.  Sequencedrawreadsarequalitycontrolledbyremovinglowqualityreads,e.g.reads arealignedtothehumangenomeusingSOAP[27],andthenthesereadsareremovedsincein mostcasestheirpresenceisduetocontaminationofthesample.Thisaprioristepofaligning readscanbeusedasanestimationofthereadsabundances.Theremainingreadsare consideredtobeofhighquality,andareassembledintocontigswhicharelaterusedto performthegenepredictionstepusingProdigal[28]orMetaGeneMark[29].  MOCATisimplementedinPerl,andsincemanyofthetoolsusedinthepipelineare fromthirdpartydevelopers,itisrequiredtomanuallyobtaintheselicenses,forexamplein thecaseofMetaGeneMark.Furthermore,MOCATlacksasimpleinterfaceimplementationto helpusersruntheirexperiments,andisexecutedviacommandline,whichitmakesextremely hardforresearcherswhosefieldofknowledgeandapplicationisnotcomputersciences,e.g. biologistsandgeneticists.Inaddition,MOCATisanexampleofmetagenomicanalyser packagethatusesonlyportionsoftheoriginalmetagenomes(forexamplebylookingfor specifichighlyconservedgenes,i.e.genecalling)and/oragainstproteindatabasesbecause supposedlyonlycodingregionshaveafunctionalrole,andthatthereforenoncodingregions canbediscarded.Furthermore,suchprocedureremovesahighpercentageofdatatocompare andprocess,thusspeedinguptheanalysisprocessbutinexchangeoflosingDNAmaterial  2.3.Webbasedtools 2.3.1.MGRAST  ThemetagenomicsRASTserver[30](MGRAST)isaSEEDbasedenvironmentthat allowsuserstouploadmetagenomesforautomatedanalyses.MGRASTprovidesthe annotationofsequencefragments,theirphylogeneticclassification,functionalclassification ofsamples,andcomparisonbetweenmultiplemetagenomes.Inaddition,italsocomputesan initialmetabolicreconstructionforthemetagenomeandallowscomparisonofmetabolic reconstructionsofmetagenomesandgenomes.Twoapproachesareusedtoperformthe taxonomicalclassificationofreads:(1)MGRASTbuildsclustersofproteinsatagiven percentageofidentitylevelusingQIIME[31],andthenthelongestsequenceofeachcluster iscomparedusingidentityasfilterinadatabasesearchviasBLAT,animplementationofthe BLAT algorithm;(2)performinggenepredictionbysearchingforribosomalRNAsagainsta 11 nonredundantintegrationoftheSILVA[32],Greengenes[33]andRDP[34]databases. 11http://genome.ucsc.edu/cgibin/hgBlat 19   MGRASTalsousestheNCBItaxonomytoperformthetaxonomicalclassification,in similitudetoMEGAN.Thefunctionalprofilesareavailablethroughcomparisonwithdata sourcesthatprovidehierarchicalinformation.Abundanceprofilesarethemainoutputfor displayinginformationonthedatasets.TheMGRASTannotationpipelineusuallydoesnot provideasingleannotationforeachsubmittedfragmentofDNA.   Figure6:MGRAST’sprocessingpipelineshowsfromqualitycontrol(1,2,3and4)to taxonomicalclassificationviageneprediction(5and6)or/andRNAdetection(8,9).Thepipelinecan beexecutedusingoneortwoways:(1)toplayer,usinggenepredictionandproteinidentificationor (2)usingRNAdetection.Whilethefirstonelooksforannotatingreadsbyspecifichighlyconserved regions(genes)theotherlooksforannotationviatranscriptomesdetection.  However,dataprivacyisoneoftheconcernsofthescientistsusingthistool:firstly, theyareworriedaboutuploadingtheirunpublishedand/orconfidentialdatatoapublic websiteandsecondly,thepriorityofjobanalysissubmittedtosuchwebsitearesubjectedto theconfidentialityleveloftheinputdata(withlowerpriorityandthereforelongerwaiting timesforprivatedata)andsizeofthesubmitteddata.Forexample,forshotgunmetagenomes themedianwaitingexpectedtimeis7–10days,whereasforamplicondatasets,thepipeline usuallyclearsdatasetswithin24h,sincetheseareofsmallersizeingeneral. 2.3.2.EBIMETAGENOMICS  EBI Metagenomics [35] (EMG in advance) has been developed as a freetouse,            largescale analysis platform for metagenomic sequence data. The resource is capable of            processing sequenced metagenomic and metatranscriptomic reads, 16S rRNA amplicon data          and usersubmitted sequence assemblies. Regardless of the data source (metagenomic,          metatranscriptomic, amplicon or assembly), EMG provides a standardized analysis workflow,          capable of producing taxonomic diversity and functional annotations. As a result, analyses            20   can be compared both within and across projects at a broad level, and across different data                types(e.g.metagenomicversusmetatranscriptomic).  The EMG pipeline is a combination of existing tools that are widely used in quality               control, feature prediction and taxonomic and functional prediction, such as TIGRFAMs [36]            or BioPython [37]. Rather than developing an entirely new repository for metagenomic data,             EMG has partnered with the European Nucleotide Archive [38] to provide a permanent             metagenomics data archive and data sharing/publication service. ENA's existing infrastructure          and interfaces for data submission ensures that datasets are described with detail and             contextual data, and are made available to the scientific community for data mining purposes              andformetaanalysis.   21   Figure7:EMG’sprocessingpipelineshowtwoprocessingwaysafterthetraditionalquality controlsteps.Firstly,thequalitycontrolstepisperformedusingTrimmomatic[39].Twopossible processwaysareofferedbyEMG:(1)leftside,taxonomicreadsabundanceestimationbasedon16S rRNAsgenes,and(2)functionalassignmentbasedoncodingregions(CDS).  Once reads (of either metagenomic or amplicon origin) are uploaded, they are queued             for analysis on the pipeline. The waiting times depend mostly on size and if the uploaded data                 is correctly annotated, fulfilling with the standards, as one of the key points in EMG is the                 possibility of future users to run their own experiments with such data. The analysis pipeline               consists of quality control, ribosomal RNA (using rRNAselector [40]) and protein prediction            (via FragGeneScan [41]), function prediction (using InterProScan 5 [42]) and taxonomic           prediction steps, which uses QIIME. The EMG pipeline is implemented under a Python             frameworkthatmanagestheexecutionofstepsandjobswithinqueuesonaclustercomputer.    22   CHAPTER3. ANALYSISANDDESIGN  In this section we will determine which requisites should be fulfilled by the proposed              method. These include, among others, how should inputs be treated, the format of the output               files, which times are reasonable for particular tasks, how should the workflow be accessed              and executed, etc. Some aspects will be of obliged need due to the nature of the                metagenomics analysis itself. We will reflect below the top level requisites and leave low              level and detailed issues to be addressed later on the implementation chapter. In addition,              specificationswillbegiventoprovideafirstgrasponthecapabilitiesoftheproposedmethod.  3.1.Analysisofgeneralaspects  1. Platformusage: a. Mostbioinformaticssoftware(andingeneral,DataSciencerelated)is designedtobeusedunderUNIXenvironments.Thisisduetothepowerful nativeshell,theallaspectscustomization,andthatUNIXisnotonlymeantto beusedasaclientoperatingsystem(suchasWindowsorMac)butalsoasa developerplatform.Therefore,theproposedmethodwillbedevelopedtouse underUNIXoperatingsystems,suchasUbuntu orDebian . 12 13 2. Programminglanguage(s): a. Metagenomicsprocessingdemandshighmemoryusage(e.g.loadingwhole genomedatabasesintomemory,suchasdonebyKRAKEN)aswellasCPU time(e.g.aligninglargesequencescanbeupto foreachpairof(n)O2 sequencesdependingonthealgorithmused)andthereforerequirealowlevel programminglanguagethatenablesthedevelopertocorrectlymanagehow memoryisallocatedandreleased,andhowCPUcyclesarespent.Thus,theC programminglanguagehasbeenchosen,sinceitisalowlevellanguage almostasfastandeffectiveaswritingcodedirectlyonmachinecode. b. Plotting,graphsandchartswillbeproducedusingtheRprogramming language,sinceitoffersahighlevelabstraction,acompletesuiteofstatistical packagestosimplifycodingtasksandamodularorientedimplementation,in termsofdirectshellexecutionunderUNIXsystems. 3. Typeofmetagenomicanalysissoftware: a. Acrossallpossiblemetagenomicanalysiscategories(e.g.functional annotation,comparativemetagenomics,assembly,etc)wewillorientthe 12http://www.ubuntu.com/ 13https://www.debian.org/ 23   proposedmethodtowardsasequencesimilaritysearch,thatis,performa comparisonofallreadsagainstareferencedatabaseandmapthereadsbased onthepropertiesofthealignedfragments(e.g.similarityandlengthofthe match).Asmentionedbefore,thisisanexpensivecomputationalprocessand thereforerequirespackagestoacceleratethepreprocessing,comparison, parsingandmappingprocedures. 4. Resultsflexibility: a. Toenableusingdifferenthomologysearchalgorithmsandinordernottoforce usingaparticularone,allresultsproducedbysuchalgorithmswillbeparsedto aconcreteformat.SeetheImplementationchapterforthespecificformat. 5. Workflowdivision: a. Thewholeworkflowwillbedividedintwo: i. Ageneralmappingworkflowthatwillbeonchargeofmappingreads totaxa. ii. Aspecificworkflowforpostprocessingresultsatafinegrainedlevel.   3.2.Pipelinedesignandspecifications  Asstatedearlier,thesoftwarewillbedevelopedasaworkflow,i.e.apipelineof singlemodulesthattakeeitherrawdataorprocesseddatabyapreviousmoduleandproduce thenextlevelofprocesseddata.Thefollowinglistcontainsthedifferentmodulesthatwillbe included.LowerleveldefinitionsandproceduredetailsaregivenintheImplementation section.  3.2.1.Generalmappingpipeline  Userinputsofthegeneralmappingpipeline:  1. AcustomdatabaseofnucleotidesinFASTAformat,concatenatedinasinglefile. 2. AmetagenomeinFASTAformat.Ifworkingwithpairedendreads,theseshallbe concatenatedinasinglefile,thusconsideringthemasindependentreads, 3. Acuadrangularscoringmatrixforeachnucleotidebyrowsandcolumnstohandle scoringalignments.  Listedbelowarethemodulesthatwillcomposetheworkflowwithinputsandoutputs. Abriefdescriptionwillbegivenalongwithtwoseparatedlines,onelabeledwithIN  for Inputs  andOUT  forOutputs  .  24   1. SeqTrimNext[43]:Athirdpartytoolthatwillbeusedtotrimreadsproducedby 454pyrosequencing. IN: Theinputreadsfile. OUT: Thetrimmedreadsfile. 2. Trimmomatic:Anotherthirdpartyqualitycontroltoolthatwillbeusedtoprocess IlluminaHiSeq2000reads. IN: Theinputreadsfile. OUT: Thetrimmedreadsfile. 3. FormatREF:Amodulethatwilladdanidentifiertoeachsequenceofthedatabase usingspecialcharacterstodealwithdifferentFASTAheaders. IN: Theinputdatabase. OUT: Theformatteddatabase. 4. MGRindex:AtooltoproduceanindexforaFASTAfilecontaininguseful informationsuchasstartingpositions,lengthandmaskedresidues. IN: Readsfile. OUT: Twobinaryindexesthatcontainastructureperreadwiththereadparticular information,oneinthesameorderastheinputreadsfile,andtheotherinsortedorder toenablebinarysearch. 5. SearchSpace:Atooltocalculatethenumberofnucleotidesinafile. IN: Formattedinputdatabase. OUT: Atextfilecontainingthenumberofresidues. 6. FastaFreqs:Aprogramthatwillcalculatethefrequencypernucleotideofthe databasetosupportthecalculationofKarlinandLambdaparameters. IN: Theinputformatteddatabase. OUT: Afilecontainingthefrequenciesperresiduewiththesumofthefrequencies being1. 7. TaxoMaker:Aprogramthatproducesthetaxonomyfileofthedatabasealongwith otherinformation,suchasgenomeslengthandidentifier. IN: Formattedinputdatabase. OUT: Tabulatedtextfilecontainingdatapereachgenomeinthedatabase. 8. GECKO:AnexternalprogramtocomputehomologysearchesbetweentwoFASTA files. IN: Inputtrimmedmetagenome,Inputformatteddatabase OUT: Afragmentsbinaryfilewhichcontainsthealignmentsofeveryfragment reported. 9. ReverseComplement:AmodulethatproducesthereversecomplementofaFASTA file. IN: Formattedinputdatabase. OUT: Thesameinputdatabasebutwithitssequencesbeingcomplementedand reversed.Inaddition,sequenceswillbeinreverseorderaswell. 25    Figure8:Workflowdiagramdividedintwosubsystemsandapriorqualitycontrollayer.Thered enclosedareaisthegeneralmappingworkflow,whereasthegreenenclosedareaisthe specificgenomelevelworkflow.Thetopside,beigeenclosedareaisthepreprocessingstepwhich involvesqualitycontrolofmetagenomes.  AlthoughdevelopedasapipelineofCmodulestobecalledsequentiallyusingUNIX’ shell,itseemedthattheaverageuserwouldfindtroubleinrecurrentlyexecutingscriptsone afteranother,andthatsuchdoingcouldpotentiallyintroduceerrorsinthepipelineprocessing. Furthermore,evenattestingstages,thedevelopermyself,wouldcommiterrorsduetothe largenumberofmodulestobecalledinordertoanalysesinglemetagenomes.Suchreasons promotedtheuseofaworkflowmanager,andforthatgoal,itwasdecidedtobetheGalaxy workflowmanager,foritnotonlyallowedthemanagementofjobsandqueueswithinthe 32   workflow,butalsoenabledtorunthesoftwarebothinlocalmachinesandonlineinstances. Seethesection4.4.0.fordetailsontheGalaxyimplementation,whichisalreadyinstalled withtheworkflowitselfintheprovidedvirtualmachine.  InordertofitthepipelinerepresentationinA4sheetsandthereforeallowprintingthe document,thegeneralworkflowhasbeencutintwopiecesfromleft(startoftheworkflow) toright(endoftheworkflow).SeeFigure9andFigure10.   Figure9:Leftside(inputsandprocessingstart)ofthegeneralworkflow.Theworkflowcanvasshown istheillustrationoftheconnectionbetweenmodulesinputsandoutputs.Itbecomesclearerthat manuallycallingeachmodulecouldproducepotentialhumanintroducedbugs.  33    Figure10:Rightside(processingendandvisualizationoutputs)ofthegeneralworkflow. Starmarkedtooloutputsareproducedresultsthatwillbeconserveduponfinishingtheexecution.   On the other hand, the specific workflow (See Figure 11) does fit in a single A4 sheet.                 Whereas the general mapping workflow provides the tools needed to perform a basic             taxonomic classification of metagenomic samples from its very beginning (i.e. preprocessing           and homology search), the specific workflow is aimed at a posteriorfinegrained step. It is              run with the results from the general workflow and two additional files, namely the genome               for which to perform the specific execution in FASTA format and the annotation file from the                GenBankdatabase. 34    Figure11:Fulloverviewofthespecificworkflow,whichproducesresultsatagenomelevelusingthe outputfromthegeneralmappingprocess.Theleftlayeristhedatainputmodules,thecenterlayer comprisetheprocessingtools,whereasthelastlayeraremainlyoutputresultsandvisualizationplots.  4.2.Implementationandresults  Inthissectionwewillbrieflydiscussthemodulesthatcomposetheproposedmethod, pointingoutwhichissueswerefoundandhowtheywereaddressed.Inaddition,therunning timeandcomplexityintermsoftheinputwillbeprovided.Wewilldifferentiatebetweenthe generalprocessingtoolsthatinsomeaspectareresponsibleforthemapping,andthe postprocessingfinegrainedleveltoolsthatusethemappingfilestoproducefurtherresults.  4.2.1Toolsforthemappingstep 4.2.1.1.FormatREF  ThissmallprogramwasincludedtointernallyassignanIDtoeachgenomeinthe databasethroughouttheanalysisprocess.Thereasonbehindthisadditionisthedisagreement 35   ontheidentifiersusedinFASTAfilestouniquelyidentifygenomes.Althoughdatabasessuch asGenBankprovidewithGIid’sandaccessionnumbers,itisnotpossibletoknowiftheuser whichhasmadeacustomselectionofspecieshas(bychanceorwill)modifiedthesenumbers orifheisusinganoldsetofgenomeswithoutdatedreferences.Thereforeitseemed appropriatetoincludeasimplenumbertouniquelyidentifyagenome.  Theprogramitselfproducesacopyofthedatabaseaddinganumbertoeachgenome, whichdependsontheorderofthegenomesinthefile.TheFASTAheaderstartswitha“>” symbolandisfollowedbyanidentifierandoptionaldescriptions,uptoabreakline.The numberisaddedbetweentheopening“>”symbolandtherestoftheline,e.g:  PriortoFormatREF AfterFormatREF >NC_004307.2Bifidobacteriumlongum NCC2705chromosome >|k|NC_004307.2Bifidobacterium longumNCC2705chromosome Table1:ChangesappliedbyFormatREFaretheinclusionofasimpleidentifierthatwillavoiddealing withdifferenttypesofFASTAheaders.  The complexity of FormatREF is linear in the size of the input (the database) and               therefore is , for it sweeps the database through copying characters and writing them to  (n)O             anotherfile.  4.2.1.2.MGRindex  MetagenomestendtobelargeFASTAorFASTQfiles,ofnormallyhundredsand hundredsofmegabytes(ifnotmore).Alongtheexecutionoftheworkflow,itwillbeneeded toloadreadsand/orpropertiesaboutthem,e.g.thelengthofaparticularreadtocomputethe percentageofidentity,coverage,etc.Furthermore,linearlyscanningametagenomefileevery timeaparticularreadorfieldisneededwouldbeslow,redundantandabsolutelyintractable.  Tofulfillthisrequirement,twoindexesarecreated:onethatisnotsortedandservesto holdproperties;andasortedonetoallowlogarithmictimeaccessusingbinarysearch.The storedpropertiesbytheseindexesareshowninthetablebelow:  Field Description id Theidentifierthatcomesafterthe“>”FASTAheader startingsymbol. rNumber Readnumbercountingfrom0. 36   rLen Lengthofthereadinnucleotides. rLmasked Lengthofmaskednucleotides. nonACGT Numberoflettersthatarenotnucleotidese.g.the“N”is usedtorepresentanunknownnucleotide. pos Positionofthereadinthemetagenomefile. Lac Accumulatedlengthofallreadsthatappearpriorinthe file. Table2:Datathatwillbestoredinbothindexes.Thisinformationwillbeparticularlyusefulwhen translatingthecoordinatesoffragmentsofthesequencecomparisonsoftwareGECKO,whichyields suchcoordinatesasanaccumulatedsumofthelengthofallprevioussequences.  Thefieldsarestoredasabinarystructure.Inthecaseofthesortedindex,aQuickSort [41]algorithmisusedtosortin time.Therefore,whenareadidentifierisfound,a(nlogn)O binarysearchisperformedtoobtainthebinarystructurethatbelongstoit.TheMGRindex programtakesonebyoneallreadsandfirstlystoresthem(unsortedbinaryfile),whichtakes being thenumberofreads.Afterwards,suchfileissortedwithQuickSortandstored(n)O n  againinadifferentfile.Therefore,thecomplexityisthecompositionofthetwocomplexities independently,andmakeitupto whichisstilllinear.(nnlogn)O+    4.2.1.3.BlastToJoiner,GeckoToJoinerandReverseComplement  Forbothsequencecomparisonsoftware(GECKOandBLAST),theresultswillneed tobeparsedtoaformatthatisusablebytheworkflow.ThisisdoneusingGeckoToJoinerand BlastToJoiner,respectivelyofthesoftwareused.Thetwoarequicklinearparsersthatstore allrelevantinformationaboutthereportedfragments,suchasthematchinglength,the numberofidentitiesortheinsertedgaps.Alignments,however,arenotstoredsincetheyare nolongernecessarytoperformthemapping;onlytheirpropertiesareneededtodecidewhich arethebestcandidatesforeveryread. Theformatconsistsinatabbasedtextfilecomposedofaheaderwithoneormore 12tuples. t12 n,k(k,score,dentities,length,similarity,igaps,egaps,strand,rStart,rEnd,gStart,gEnd)=   i           Whereeachfieldcorrespondsto:   Field Description Fragmentnumber Foreveryread,thepositioninthelistofreportedfragments 37   Score Reportedscoreforthefragment Identities Numberofidentities Matchinglength Lengthofthematch %Similarity Thenumberofidentitiesdividedbythematchinglength iGaps Numberofopeninggaps eGaps Numberofextensiongaps Strand Strandofthefragmentrepresentedwith++or+ Startinread Startingpositionofthematchinthereadcoordinates Endinread Endingpositionofthematchinthereadcoordinates Startingenome Startingpositionofthematchinthegenomecoordinates Endingenome Endingpositionofthematchinthegenomecoordinates Table3:Fieldsoftheparsingformatthatisusedintheworkflow.Inordertouseanysequence comparisonsoftware,itwillbeneededtoprovideaparsertotheformatshownabove.  Multiplefragmentsindifferentgenomescanbereportedforthesameread.Therefore, onetomanyfragmentswillbeassociatedtoaheader,oneforeachuniquecombinationof read  andgenome,  alongwithlength  : >ReadID >Genomeaccessnumberandname Genomelength  Table4:Headerinformationthatrepresentsatuplereadgenome.Eachtupleisauniquecombination ofareadandagenomeandcanonlyappearonce.  AnRscriptisusedtoplottheaccumulateddistributionoffragmentsbypercentageof identityandcoverageinlog10scale.SeeFigure12.  Inaddition,inthecaseofusingGECKOasthesequencecomparisonsoftware,and thereforeGeckoToJoinerasparser,itbecomesnecessarytoproducethesortedandunsorted indexesforthereversecomplementofthedatabase,sincethecoordinatesoffragments locatedinthereversecomplementarysequencegivenbyGECKOneedtobetransformedtoa forwarddatabasesystem.Tocreatesuchindexes,firstwewillneedtocreatethereverse complementofthedatabaseandinreverseorder.TheprogramReverseComplementdoesthis byfirstlysweepingthedatabasefileandstoringthestartingpositionsofeachsequence(say )inavector.Thenthefilepointerispositionedoneachpositionstartinginthe andN Nth  downtothe ,loadingthesequenceintomemoryandwritingitinreverseorderwhile1st  complementingitatthesametime.Thusifthedatabaseisofsize ,afirstsweepisneeded,n 38   plusanothersweepforeverysequencetoloadintomemoryandalastonetowriteand complement,hencemakingthecomplexitytobe whichis .(n)O+n+n(3n)O  Figure12:This3Dplotshowstheaccumulatednumberoffragments(Zaxis)inlogarithmicscaleby percentageofidentity(Yaxis)andpercentageofcoverage(Xaxis).Spiked(x,y)pointsrepresent regionsthathaveahighernumberofreportedfragments.  BothGeckoToJoinerandBlastToJoinerruninlineartimedependingonthesizeofthe input.Theseprogramsarepreparedtorunextremelyfastsincetheinputfilescanbeofsizeup toseveralhundredgigabytes.Thecomplexityis forboth,being thenumberof(nlogn)O n  fragmentspresentinthecomparisonfile.Theuseoftheindexesdiscussedinsection4.2.1 enablethebinarysearchtoretrievereadpropertiesinlogarithmictime.  4.2.1.4.TaxoMaker  Theworkflowusesataxonomyfilethatmapsid’stogenomesandstoresthenames andlengthofthegenomesinthedatabase.Theseareusedforvisualreasons,i.e.showlabeled axisforgenomesinplotsorfiles,whichisalmostamusthavewhendealingwithlarge databases.Thelengthisusedtocalculatetheexpectedvalueofeachfragmentsinalaterstep intheworkflow.Thesetaxonomyfilesarealsousedtoincorporatecustomrelationships 39   betweenthegenomes,aswellascreatingphylumsofsimilargenomes,e.g.differentstrainsof MycoplasmaHyopneumoniaecouldbegroupedtogether.Seebelowanexampleoftaxonomy file:  SpecieLevel 1 SpecieLevel 2 Accesscode SpecieName 1 0 ref|NC_021831.1| Mycoplasmahyopneumoniae J 1 1 ref|NC_017509.1| Mycoplasmahyopneumoniae 168 2 0 ref|NC_015144.1| WeeksellavirosaDSM 16922 3 0 ref|NZ_DS264342.1| RuminococcusobeumATCC 29174Scfld0253 3 1 ref|NZ_DS264341.1| RuminococcusobeumATCC 29174Scfld0254 3 2 ref|NZ_DS264340.1| RuminococcusobeumATCC 29174Scfld0255 Table5:Exampleoftaxonomicaldescriptionfilewheretwospeciesareboundedtogetheras substrainsusingthesamenumberforSpecieLevel1,asecondspeciehasnosubstrainattachedanda thirdspeciecomposedofthreecontigs.  Thesefilescanbebuildwithanytexteditororspreadsheetsoftware.However,itcan becomeverytedioustobuildthesefileswhenworkingwithlargedatabaseswhereseveral genomesarepresent,andthereforethetoolTaxoMakerproducesthesetypeoffields automatically.Itrunsinlineartimesincetheprocedurefollowedistoparsethedatabasefile andaddnewentriestothetaxonomyfileforeachgenomefound.   4.2.1.5.FastaFreqs,SearchSpaceandKLambda  Thesetoolsaretreatedasonce,sincethethreeareexecutedtogetherandare completelydependant.Thegoalofthesetoolsistoextractaseriesofparametersneededto latercomputetheexpectedprobabilityofreportingaparticularfragmentgiventhelengthand propertiesofboththequerymetagenomeandthedatabase.FastaFreqsproducesafile containingthefrequenciesperresidue,andshouldbeusedonthedatabase,alongwith searchSpace,whichcomputesthetotalnumberofresiduesinthedatabase.Inparticular,the searchSpaceprogramisnomorethanacombinationofwellknownunixscripts: 40   grepv“>”database.fasta|wc Whichproducesthetotalnumberofresidueswhencomputingthedifferencebetween thethirdcolumn(numberofcharacters)andthefirstcolumn(numberofnewlines),thus removing\ncharacters.  TheKLambdatoolproducestheKandLambdaparameterasstudiedbyKarlinand Atschul[45]givenascoringmatrixofnucleotidesandthefrequenciesperresidue.These parametersarethenusedtocomputetheexpectedprobabilityofafragmentinthemapping moduletochoosethebestfragment.  4.1.2.6.Fjoiner  Metagenomesareunculturedsamples,andthebacteriapresentinsuchenvironmental communitiessufferfromhighevolutionarypressureduetoallinteractionsbetweenspecies, causingmostlysmallmutations,insertions,deletions,translocations,etc.Suchisthemain reasonbehindthedevelopmentofthetoolFjoiner,whichtriestoextendfragmentsby performingaNeedlemanWunschalignmentbetweenthosethatbelongtothesamereadand genome.Alignedfragmentsthatsurpassidentityandcoveragethresholdsarekeptandstored. ThereforeFjoinerproduceslongerfragments,facilitatingthedecisionstepofthebest candidateforeveryread.GenomespresentinthedatabaseareloadedintoRAMtoaccelerate theprocess,sincesequenceretrievalfromfilesbecomessloweraslargerastheseare.Then thecomparisonfileisreadsequentiallyloadingallfragmentsbelongingtoatuple ReadGenome  .Everypairofcandidatefragmentsaretriedtobealignedusingacustom tworowsNeedlemanWunschalgorithm.Tablexshowsthepseudoalgorithm:  1.Loadgenomesintomemory 2.Quicksortgenomesbyaccessionnumber 3.Loadreadsindex 4.Foreveryreadinthecomparisonfile a.Sortall fragmentsbelongingtothereadbyreadk coordinates b.Foralltuplesofconsecutivefragments( whilef)fnn+1    kn− 1 >   i. If( distanceinbothgenomeandreadf)fnn+1  coordinatessatisfythethreshold 1.Loadthecompletereadusingbinarysearch 2.PerformNeedlemanWunschscoringmatrix between( and(.rf.r)fn1n+1 2 .gf.g)fn1n+1 2  3.Iftheobtainedalignmentsatisfiesminimum coverageandsimilaritythresholds: 41      Figure20:Optionscomparisonplot.TheXaxisarethegenomesbyspeciesandtheYaxisisreads abundance(topleft),averagepercentageofcoverage(topright),averagepercentageofidentity (bottomleft)andtheaveragelengthinnucleotides(bottomright).  Figure 20 shows an optionscomparison plot between the first best candidate           (changing color in the plot) for all genomes and the second candidate (blue line in all plots).                 For example, the topleft plot shows that only the genomes with ID 4 and 6 have significant                 distance in terms of mapping abundance respect to their second options, thus ensuring a better               mapping. It can be observed in the rest of the plots that their average coverage (topright),                average identities (bottomleft) and average length (bottomright) is superior in all cases to             thatoftheirsecondbestoptions.  The QualityMapper tool is linear on the size of the input, since its working principle is                sweeping the whole binary mapping file adding up the values that conform the different              statisticindicatorsshown.  4.2.2.2.GeneParser  Althoughthistooldoesnotusethemappingfile,itseemedmoreconvenienttoputit underthepostmappingtools,sinceitisofnousewithouttheseinfurthersteps.GeneParser wasdevelopedtoparseGenBank’sannotationfilestokeeponlytheneededfields,sincethese 48   typeoffilesoftentendtobelarge,andfordatabasesofconsiderablesizeitcanbecomealot ofunusedinformation,alongwiththedifficultiesofcomputinghumanreadablefilesthat havenotbeentranslatedtosimpletabularformats.InthelineofGeckoToJoinerand BlastToJoiner,GeneParserproducesatabulartextfilewithasmanyrowsasannotations containedinthefileretrievedfromGenBank.Thefollowingtableshowsanexampleofwhat fieldsarekeptandtheirmeaning.  Gene start Geneend Strand (reserved) Locustag Product 687 3158 f  MHO_RS00005 membraneprotein insertaseYidC Table6:Extractedfieldsandparsedformatforanannotationfile.Thegenestartandgeneend fieldrefertothestartingandendingcoordinatesofthegeneinthegenome.Thestrandshowsan‘f’for forward,and‘r’forreverse.Areservedfieldisleftunusedforfutureimplementations.Thelocustag fieldshowsthetaggiventothegene,whereastheproductfieldreferstothedescriptionofthegene anditsfunctionalprofile.  Table 6 shows an example of parsed annotation file containing one gene. More fields could be                added in case of desire for particular and more advanced experiments, such as functional annotation.               In particular, annotation files are used to obtain coding and noncoding readsabundance and             toperformotherexperimentssuchasdifferentialexpressionorannotatedsearches.  4.2.2.3.CodingAbundances  Thepresenceofspeciesinasamplecanbemeasuredusingthereadsabundance. However,thismeasuresmightnotbeenoughtoensurethecompositionofametagenome,and thereforemoreexperimentsarerequiredtobecarriedout.ThetoolCodingAbundances producesalistofabundancesofannotatedandunannotatedreads,alongwithafilepereach genomethatincludestheid’softhereadsassignedthatfallunderannotatedregions. Nonetheless,theconceptofannotatedreadisabitfuzzy:ReadsaresmallDNAsequences, andasinglereadmighthavebeenpartofagene,mightbethecompletegeneoralarger sequencethatincludesoneormoregenes,andatlast,itmighthavebeenthesocalledjunk DNA.Toaddressthistypeofsituation,mappedreadsaredividedinthefollowingcategories: (1) Matchedreads:Thosethatarenotannotated,notevenpartially. (2) Semiannotatedreads:Thosethatarepartiallyannotatedononesideor another. (3) Fullyannotatedreads:Thosethatarecompletelyinsideageneregion. (4) Extracoveredreads:Thosethatincludemorethanasinglegeneregion,and maycontainmore. Theproceduretoidentifythetypeofreadsfollowsthealgorithmdepictedbelow: 49    1.Sequentiallyopentheparsedannotationfiles. 2.Iftheparsedfileofannotationscontainsanyannotation: a.Loadannotationsintoafixedlengthbufferinmemory. b.Sweep the binary mapping file and extract the reads that          maptothegenomewhoseannotationfilebelongsto. c.Sequentially sweep the annotations contained in the       fixedbufferforeveryread. i.If a hit is found, mark the read and write it to            theoutput. 3.Iftherearemoreannotationfiles: a.Gotostep1. 4.Elsestop.  Figure21:PseudocodefortheCodingAbundancesprogram.Theusedapproachrunsincubictime, whichcouldbeslightlyreducedtoquadratictime.RAMbasedapproachedwouldefficientlyreduce computationtime,howevertheywouldbeunsuccessfulforlargedatabaseswithmanyannotations.  It might be noticed by the reader that the running complexity could be reduced. In               fact, the binary mapping file is swept through for every genome in the database, and the                buffer containing the annotation files is linearly traversed for every read mapped to the              genome. Therefore, given genomes, reads and a maximum of annotations per genome,   g n      k    the running complexity is around , which is cubic. However, the number of     (g n )O*3*k        genomes is usually very small compared to the number of reads and same for the number g          n      of annotations . Therefore in the average case and thus the algorithm is  k  g≪k≪n          tractable. A further modification to improve running times would be performing a binary             searchovertheannotationscontainedinthebuffer,thusreducingitto .(g n ogk)O*3*l  Thedifferentialexpressionexperimentisconductedonaparticulargenomebyonly consideringthereadsmappedtoannotatedregionsofthegenomeandcomparingabundance betweendifferentsamples(SeeFigure22)inthesamewayasRNAseqtranscriptome expressionanalysisisperformed. 50    Figure22:DNAseqdifferentialexpressionplot.Eachpointrepresentsanannotatedregionfora particulargenome.Inthexaxisandyaxis,thepercentageofreadsthataremappedtoeachannotated regiondividedbythetotalmappedreads.  4.2.2.4.Annotationalmapping  Inthesamelineasthetooldiscussedabove,theSpecificDistributionofMatchestool aimstoofferacomparisonbetweenthequalityofthemappedreads,thedistributionof fragmentsreportedforthemetagenome(thefirstisasubsetofthesecond)andthetypeof matchesthatsaidparticulargenomehas.Thereforethistoolrequires(1)thebinarymapping fileoftheexperiment,(2)thereporteddistributionoffragmentsbythesequencecomparison software(SeeFigure23)and(3)theannotationfileforthetargetgenome.  Thetoolproducesamatrixofthetypeofmatchesofsize where isthek003 × 1 k numberofrowsthatrepresentlength,and100thenumberofcolumns,thatrepresenta percentageandnormallythepercentageofidentityisused.Forexample,amatrixofsize impliesthattherearenoreadsoflengthlargerthan30bp.Sinceeverythreerows0 009 × 1  representonebasepair,row30willbeabasicmatchoflength10bp,row31willbea semiannotatedmatchoflength10bpandrow32willbeafullyannotatedreadoflength10 bp.Thenextthreerowsfollowthesameschemebutfor11bp.Thereforethetypeofmatch dependingontherowisextractedbyperformingthemodulusoperationandcomparingthe resttoeither0,1or2.  51   Figure23showsanexampleofannotationalmapping.Themainkeyofthisplotisto showthetypeofthematchedreadsforagenome(iftheseareannotatedornot)andto comparetheirproperties(identitiesandlength)withthefulldistributionoffragments.   Figure23:Annotationalmappingplot.TheXaxisisthepercentageofidentityofthematches.The Yaxisisthelengthofthematches.TheZaxisistheaccumulationoffragmentsinlog10scale.The specifictypeofmatchesareplottedinpurple,greenandyellowtoillustratethedifferenttypeof matches.  Thefollowingremarksshouldbetakenintoaccounttounderstandtheplot: 1. Inthebackground,the3Dgreydistributionisthedistributionoffragmentsbylength andpercentageofidentity. 2. Bycolors,andplottedontothegreydistribution,thetypeofmatchthatwasmappedto thegenome.Thetypeofmatchcanbeeitherunannotated(green),partiallyannotated (yellow)andfullyannotated(purple).  52   4.2.2.5.GenomeProfileofAccumulatedReads  Animportanttermingenomicsandalsointhemetagenomicsfieldisthecoverage. Wehavespokenaboutcoverageinreferenceofameasurethatisthepercentageofamatching fragmentdividedbythetotallengthofaread.However,thistermisknownasanindicatorof howmanyreadsorDNAsequencespopulateorcover  agenome.Inourcase,itisofinterest tocheckhowmanyreadsmaptoeachpositionofagenome,astodefineameasureof continuityalongagenome.Thehigherconcentrationofreadsalongthewholegenome,the better. Thebinarymappingfileisusedtofindallreadsmappedtoaparticulargenome,and theregionofthegenomewherethesereadsaremappedtoarestoredandaddedup.Intheend, aprofileoftheamountofaccumulatedreadsalongthegenomeisobtainedandplottedusing anRscript.SeeFigure24.However,bacterialgenomesareusuallyoflength1Mbpandupto severalmillions,andthereforeitbecomesdifficulttoplotmillionsandmillionsofpoints alongastraightlineinanimage.Forthismatter,theRscriptusesasmoothingwindowof parametrizedsize(saya1000bp)thatcomputestheaveragenumberofmappedreadsper 1000bp,andthusagenomeof1Mbpwouldonlyrequire pixels.Biggerwindows 103 106= 103 canbeusedtofitlargergenomes.Hencethecomplexityis sinceitisneededto(n)O+k sweepthebinarymappingfileonceandthelengthofthegenometoperformthesmoothing windowaverage.   Figure24:Thegenomeprofileofaccumulatedreadsshowshowmanynucleotidesaremappedtoeach partofthegenome.Theplotissmoothedusingaparametrizedslidingwindowofsize1000basepairs, whichmeanseachpositionistheaverageofnucleotidesofthesurrounding1000basepairs. 53     4.2.2.6.GenomeCutter,SpecificRegionsandSpecificReads  Wehaveproposedthequestion“Howmanyreadsmappedtoagenomeareneededto acceptorrejectthepresenceofaspeciesinasample?”earlierintheAnalysisandDesign section.Currentstateoftheartmetagenomicanalysissoftwaredonotofferanyprocedureto addressthisquestion.Thedevelopedworkflowoffersasetoftoolscapableofextracting thosereadsthataremappedtoregionsthatonlybelongtoonegenome,i.e.supportingwith strongevidencethataspeciesispresenteveninsituationswhereitsreadsabundanceislow.   Figure25:Exampleofspecificregionsdetectedinadatabasewith .Eachhorizontalline 4N=   representsagenome.Theydonotneedtobenecessarilyofthesamelength,theyareshowedinthe pictureinordertofacilitateitsunderstanding.Eachrectangle(butthedottedones)representsa fragmentsharedbetweenthegenomeofthelinewhereitispresentandthereferencegenome.The dottedrectanglesrepresentthespecificregionsofthereferencegenome,whereclearlythereareno fragmentsinanyofthegenomes.  IfwetakealookatFigure25wewillseethatthistypeofproblemneedsgenomevs. genomesequencecomparisons.Forthatmatter,thefirststepofthistoolisrunningGECKO toperformacomparisonbetweenthetargetgenomeandtherestofthedatabase,thusleading to comparisonsforadatabaseofsize .Theoutputofthecomparisonistakenand 1N−  N fedtotheSpecificRegionstool,whichwillextracttheregionsthatarefreeofmaps.The outputisproducedasalistofcoordinatesthatrepresentspecificregionstothetargetgenome. Then,theSpecificReadstoolusesthelistofregionsandthebinarymappingfileofthe experimenttocomputewhichreadsaremappedtothespecificregions.  GECKOisathirdpartysoftwareandthereforeitscomplexitywillnotbeanalyzed.In ordertorunthecomparisonwithGECKO,wewillneedfirsttoremovethetargetgenome fromthereferencedatabase,sinceifitisincludeditwillproduceafullalignmentand fragmentsateverypositioninthegenomedependingonthekmersize.Toavoidthis,the GenomeCutterprogramremovesaparticulartargetgenomefromthereferencedatabase.Its complexityisstraightlinearsinceitonlyrequirestocopyandwritesequencesfromonefile toanother,skippingthetargetedone. 54   TheSpecificRegionstoolloadsanarrayofbytesoflengthequaltothatofthe genome,whereeachbyterepresentseithermappedregionorfreeregion.Thiscouldbe improvedusing ofthememoryneededbyimplementingitatabitlevel,however,eventhe 4 1 humangenomecouldbefittedintoRAMusingthebyteprocedure(~3GB).Finally,a sweepthroughisperformedonthearray,filteringthoseregionsthataresmallerthanagiven length(e.g.30basepairs).Thustherunningtimeis being thenumberoffragments(2n)On producedbytheGECKOcomparison.TheSpecificReadstoolrunsonthelistofregionsand thebinarymappingfile.First,theregionsareloadedintoramandthenforeverymappedread tothegenomethearrayissweptthroughcheckingifareadispartiallyorcompletelyinside, similarlytothetoolSpecificDistributionofMatches.Thereforeit’srunningtimeis dependentonthesizeofthebinarymappingfileandthenumberofregions.However,the numberofspecificregionsisinverselyproportionaltothelengthofthedatabase,andthe numberofmappedreadsisdirectlyproportionaltothesizeofthedatabase(amongothers), thereforeitthenumberofspecificregionsishigh,thenumberofmappedreadsissmaller, makingitinaverageoflessercomplexitythanquadratic.  4.2.2.7.CoverageIdentityMatrix  Toprovideanothermeasureofqualityrelativelytothewholemappingdistribution, forexample,toshowpropertiesofallmappedreadsatonce,theCoverageidentitymatrix programwasdeveloped.Itproducesa tabulartextfilematrixwhere isthen×m×k n  percentageofidentity(from0to100), isthepercentageofcoverage(from0to100asm well)and istheaccumulationofmappedreads.SuchmatrixisreadbyanRscriptplotsak 3Ddistributionofthematrix(seeFigure26)applyinglogarithmicscaletothe matrixsincek theaccumulationofmappedreadscanbeextremelyhighindispersedpointsandratherlow onothers. 55    Figure26:3DPlotofthedistributionmatrixproducedbyCoverageIdentityMatrix.Onthexaxis,the percentageofidentityofthemappedreads.Ontheyaxis,thepercentageofcoverageofthemapped reads.Onthezaxis,theaccumulationofmappedreadsforagivenpointofpercentageofidentityand coverageinlogarithmicscale.Noticethatthedistributionissegmentedat60%identityand30% coverage.  Figure26showsthatthemostaccumulationoccursatthepoint100%identityand 100%coverage,whichimpliesthemappingmodulemappedmostreadswithgoodproperties. However,itcanalsobeseenthataconsiderableamountofmappedreadshadverylow coverage,henceonlyasmallpartofthereadwasmapped.Moreaccumulationtowardsthe backcornermeansabettermapping.  ThecomplexityofCoverageIdentityMatrixislinearonthesizeofthebinary mappingfile,foritsweepssuchfileandcountsthenumberofmappedreadsina twodimensionalvector.Onceitfinishessweeping,thevectoriswrittentodiskasa matrix,whichisconstantandthereforenotaccountedforthecomplexity.00 001 × 1  56   4.2.3.Galaxyimplementation  As mentioned in other sections of this manuscript, the whole workflow is available             under a Galaxy workflow manager implementation, which makes it simple to run experiments             without having to face the difficulties that arise from shellcalls that have many parameters              and that have to be run in particular order. Installing a Galaxy instance in a local machine                 might be tedious in some cases and, furthermore, if we only wish to try out we would need to                   remove all installed plugins after checking the software out. Therefore we have provided with              an Ubuntu virtual machine with all binaries installed along with the Galaxy instance to avoid               bothering the final user with installing tutorials and derived issues. It is recommend that the               virtual machine is run at least with 4GB of RAM, since metagenomics processing requires              stillaconsiderableamountofmemory. In addition, a Galaxy Guided Exercise is included in the documentation which shows             how to run the virtual machine, start the Galaxy Instance and also how to run different types                 ofexercises.  4.2.4.Galaxy’stooldefinitionlanguage  GalaxyusestheXML[46]languagefortooldefinition.Thisis,eachdevelopedbinary thatcomposetheworkflowmusthaveanXMLfilewhichuniquelydeterminestheinputsof thebinaryexecutable(alongwithinformationsuchastheformatoftheinputs,thelabelsand helpsthatwillbedisplayed,etc.),theoutputs(similarlytotheinputs)andthesystemcallto thebinaryexecutable.SeedetailsattheGalaxyToolConfig tutorial. 15  TheXMLfilesmustbefirstcreatedforeachtoolandthenaddedtothetoolregistry (namelytothetool_conf.xml.samplefile)underasectionthatincludesthenameofthe workflowandthepathstoall.xmltools.  <toolid="mgReadsIndex2"name="MGRindex"> <description>Createsindexesforthefastaccessoffasta files</description> <inputs> <paramname="input_fasta_file"type="data"format="fasta" label="Fastafile"help="Createanindexofafastafile"/> </inputs> <command>/home/galaxy/galaxy/tools/metagecko/binaries/mgReadsIndex2 $input_fasta_file$input_fasta_file;mv${input_fasta_file}.nonsorted $nosorted_index_output0;mv${input_fasta_file}.sorted 15https://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax 57   σ  H0:  MEGAN = σMG  σ  = σ H1:  MEGAN /  MG   Whichyieldedapvalueof0.69,whichimpliesthesuppositionthatstandard deviationsareunknownbutyetequalatanyregular .α   Contrastedhypothesisonthedifferenceofmeans: μ  H0:  MEGAN − μMG = 0 μ  = H1:  MEGAN − μMG / 0   The resulting pvalues was of 0.99 and therefore the null hypothesis was accepted at              any , concluding that the difference of means of the paired readabundance values was α              nearlyzero,andthusthereexistnosignificantdifferencebetweentheresults.  5.2.Sickandhealthyswinesamples 5.1.1.Datasetavailability  For the second comparison, we used two collections of metagenome samples from the             respiratory tract of healthy and diseased Sus scrofa taken from the swine slaughterhouse. The             samples had been sequenced using the 454pyrosequencing technology. The diseased samples           contains 678,500 reads whereas the healthy sample contains 581,383 reads. The analysis is             based on the understanding that the pigs are naturally infected, and therefore the point of               observing significant variation in particular bacteria between the diseased and healthy sample            suggest that such species are related to the condition of the swines. Unfortunately, the dataset               used in this comparison has not been made public at the time of writing the manuscript and                 remainsyetprivate. The raw samples’ read average length was 1,200 bp before trimming and filtering.             Filtering was performed using Replicates and trimming was performed using LUCY [48]. The             average length of the reads dropped from 1,200 bp to 500 bp in average, which is expected for                  the type of reads after removing adapters, lowcomplexity regions, etc. The reference database             was built using 50 custom genomes which are known to be related to the respiratory tract of                 swines. The included bacteria was comprised of mostly actinomycetales, bacteroidetes,          firmicutes, proteobacteria and mycoplasmataceae, and accounted for a total of 283 DNA            sequencesduetoscaffolds,contigsanddifferentstrains. 5.2.2.ComparisonwithMEGAN  64   Asstatedearlier,inordertoprovethattheresultsoftheproposedworkfloware consistentwiththoseofothermetagenomicanalysissoftwaresuites(intermsofabundancein thetaxonomicclassification),thefollowingtestwasperformedusingresultsfromBLASTN basedonmetagenomicsamplesfromtherespiratorytractofswines.Both,theworkflow(MG workflow)andMEGANwereexecutedusingthesameinputfromBLASTNandranwith defaultparameters. Oncomparisonofthesickandhealthymetagenomes(inadvance,M01andM02, respectively)basedonMEGAN,theabundanceplot(SeeFigure28)showssimilarresultsand tendencetoours.Readsabundanceweregroupedbystrainstoshowconcordance.However, whereasthemappingprocedureofametagenomeusingMEGANcanlastnearlyhalfanhour, theproposedworkflowtook1minuteand22.8secondstoanalyzethediseasedmetagenome and1minute15.178secondsforthehealthyonewhenBLASTthecomparisonhadbeendone withBLAST.RuntimeexecutionsweremeasuredusingastandardInteli5machinewith4GB ofRAM. Althoughsomesmalldissimilitudeappeartoexistbetweenthereadsabundance results,itisimportanttonoticethattheplotisshowingreadsabundanceinlogarithmicscale, andthereforeamplifyingthevariationsofsmallandlowabundantgenomes.Thisalso suggeststhat,asexpected,thedevelopedworkflowcanreportmoreevidenceintermsof lowabundantgenomesinpartduetothefragmentsextensionstepandtheadequate combinationoffilters.  65    Figure28:ReadsabundancecomparisonbetweenMEGANandtheproposedmethodperstrains.Top plotshowsthereadsabundanceforthediseasedmetagenome(M01)inlogarithmicscale.Bottomplot showsthereadsabundanceforthehealthymetagenome(M02)inlogarithmscale.  5.2.3.Statisticalvalidation  Acontrastonthedifferencesofmeanswasperformedassumingbothsamples belongedtoanormaldistribution,inordertodeterminewhetherornotthepropositionthat 66   bothresultscamefromthesamedistributioncouldbeacceptedornot.Forthispurpose,the readsabundancepergenomewereconsideredaspaireddatapointsinthecontrasted hypothesis.  ● Apriorihypothesisonthecontrastoftheequalityofstandarddeviationsforthe metagenomeM01: σ  H0:  MEGAN = σMG  σ  = σ H1:  MEGAN /  MG   Whichyieldedapvalueof0.51inthediseasedmetagenome,whichimpliesthe suppositionthatstandarddeviationsareunknownbutyetequalatanyregular .α   ● Apriorihypothesisonthecontrastoftheequalityofstandarddeviationsforthe metagenomeM02: σ  H0:  MEGAN = σMG  σ  = σ H1:  MEGAN /  MG   Apvalueof0.58wasobtainedinthehealthymetagenome,whichimpliesthe suppositionthatstandarddeviationsareunknownbutyetequalatanyregular .α   ● ContrastedhypothesisonthedifferenceofmeansforthemetagenomeM01: μ  H0:  MEGAN − μMG = 0 μ  = H1:  MEGAN − μMG / 0   The resulting pvalue of the M01 metagenome was of 0.29 and therefore the null              hypothesis was accepted at any standard , concluding that the difference of means of the      α          paired readabundance values was nearly zero, and thus there exist no significant difference             betweenthetaxonomicresults.   ● ContrastedhypothesisonthedifferenceofmeansforthemetagenomeM02: μ  H0:  MEGAN − μMG = 0 μ  = H1:  MEGAN − μMG / 0   The resulting pvalue of the M02 metagenome was of 0.23 and therefore the null              hypothesis was accepted at any standard , concluding that the difference of means of the      α          paired readabundance values was nearly zero, and thus there exist no significant difference             betweenthetaxonomicresults.  67      68    CHAPTER6. CONCLUSIONS 6.1.Conclusionsofthedevelopedworkflow  The proposed workflow is an example of simple lowcoupled modules that when put             together compose a complete processing method capable of producing fast and reliable results             in open environment with easytohandle formats. In the computational sense, our intention            was to provide an alternative platform for metagenomics analysis, which, in essence, could be              easily adapted and expanded to satisfy the growing demand of experiments that researchers             are proposing in this novel field, while maintaining a lowlevel programming strategy that             keptcomputationspeedasoneofthepriorities.  Furthermore, metagenomics is an effervescent field and there are still a number of             questions that need to be addressed before a stable version of a definitive data analysis               software becomes available. Currently, metagenomic analysis tools generally represent a          closed environment and offer few configuration options and limited extension possibilities. In            this sense, our aim was to develop a software framework to which other modules could be                added. An additional motivation to develop this software was the need for software sensitive              enough to detect the presence of lowabundance species. Our intent was to provide data in               standard and editable formats that facilitate further analysis with external software. The            proposed workflow software offers several notable advantages over the software currently           available in the market. Firstly, the use of GECKO enables this software to compute similarity               searches in the samples against a collection of genomes in a reasonable time. Providing              different mapping alternatives helps set up a sort of quality measures of the mapping process               basedonabundancedifferencesacrossmappingalternatives.  The proposed software is designed to provide evidence of the presence of            lowabundance species by finding particular specific regions of genomes with mapped reads.            These mapped reads provide strong evidence of the species present in samples. The methods              developed for assessing and evaluating the quality of mapping also improve accuracy and             reliability in terms of the identification of the species present in a sample. However, from our                perspective, the most important contribution of this workflow software is that it offers the              possibility of incorporating new modules to extend the analysis workflow by showing datafile             specifications, which enables finegrained metagenomic data analysis via a simple Galaxy           interfacewhichrunsexperimentsatthecostofafewclicks. 69   Inaddition,theproposedworkflowdepictedonthismanuscript,hasbeensubmittedto thehighlyrankedjournalBMCGenomics asaresearcharticle,andisundersecondround 17 inspectionatthetimeofwritingthisconclusions. 6.1.1.Conclusionesdeltrabajodesarrollado  Elmétododesarrolladoesunejemplodesimplesmóduloscuyopocoacoplamiento permitelacomposiciónenunsistemacompletodeprocesamientocapazdeproducir resultadosrápidayfiablementeenunentornoabiertoyconformatosdedatossencillosde manejar.Entérminoscomputacionales,nuestraintenciónfueladeproveerunaplataforma alternativaparaelanálisisdemetagenomas,lacual,enesencia,pudieraserfácilmente adaptadayexpandidaparasatisfacerlagrandemandadeexperimentosquelosinvestigadores sugierenenestecampotannovedoso,alaparquemanteniendounenfoquedeprogramación abajonivelcuyaprioridadprincipaleselreducidocostecomputacional.  Elcampodelametagenómicaestáenalzayaúnsiguenexistiendograncantidadde preguntasquedebeserrespondidasantesdequeunaversiónestándardepaquetedeanálisis demetagenómicaestédisponible.Actualmente,lasherramientasdeprocesamientode metagenomasestángeneralmentedesarrolladasbajounentornocerrado,ofreciendoporello pocasposibilidadesdeconfiguraciónyflexibilidad,alavezqueescasaampliación.Eneste sentido,hemospretendidodesarrollarunmarcodetrabajoalqueselepudieranañadirnuevos módulossindificultad.Ademásdeello,otramotivaciónhasidolanecesidadactualde softwaremásfino,capazdedetectarytratarespeciescuyaabundanciafuerabaja.Nuestra intenciónfue,además,proveerresultadosdemaneraestándaryabiertaparafacilitarun análisisposteriorconherramientasexternas.Elmétodopropuestoofrececiertasventajas sobreelsoftwareactualmenteexistente.Primariamente,elusodelpaqueteGECKOpermite computarcomparacióndesecuenciasentremuestrasmetagenómicasygenomaspatrónen tiemporazonable.Laflexibilidadenlasalternativasdelafasedemapping  nospermite extrapolarmedidasdecalidaddelprocesobasándonosenlasdiferenciasdeabundancias.  Elpaquetedesarrolladofuediseñadoconobjetodeproveerevidenciassobrela presenciadeespeciesconpocaabundanciabuscandozonasparticularesdegenomascon lecturasasignadas,pueséstasdansoportemásfuertesobrelapresenciadedichogenomas. Losmétodospropuestosparaevaluarlacalidaddelaasignacióntaxonómicapromueven mayorfiabilidadenlaidentificacióndeespecies.Sinembargo,desdenuestropuntodevista, lacontribuciónmásimportanteeslaposibilidaddeincorporarnuevosmódulosparaextender elflujodetrabajo,dadaslasespecificacionesdelosformatosdesalida,permitiendoasuvez unaexperienciaricadeprocesamientodedatosconsólounospocosclicksatravésdelgestor deflujosdetrabajoGalaxy. 17https://bmcgenomics.biomedcentral.com/ 70    Porúltimo,elflujodetrabajodesarrolladodescritoenestedocumentohasido presentadoalarevistadeimpactointernacionalBMCGenomicscomounartículode investigación,yseencuentraactualmente,alafechadeescrituradeestemanuscrito,bajola segundarondaderevisión.  6.2.Furtherextensionsandimprovements  AlthoughwetriedtosqueezethelimitedtimethatisdedicatedtotheEndofDegree Projecttofitallthemodulesandresultswewantedintheproposedworkflow,itwas unavoidabletoleavesomethingsoutofthepanorama.Nevertheless,itisourintention,for boththestudentandthetutor,tokeepworkingonthisplatform,developingprocessingtools thatanswerkeyquestionsinmetagenomics,facilitatingthestilldifficultprocessingstepsofa wholeexperiment,reducingcomputationalrequirementsinbothtimeandspace,providing withnoveltytoolstoassertnewprocessingstandards,etc.  Morespecifically,thereareafewthingsthatwedefinitelywishedtoimplement,but sadlyhadnottimeforit.Thefollowingproposalsfallundersuchcategory:  ● Aphylumtaxonomictreeviewthatenablesuserstoaddupreadsabundanceon differentspecieslevels. ● Acompletesetofdifferentmappingalternatives,suchasincludingtheLCA algorithm. ● Apreselectionsystemtosignificantlyreducethesizeofthereferencedatabaseto speedupcomputationtime. ● Amorecompletedfunctionalprofileofthespeciescontainedinthesamples,e.g. settingupmetabolicpathways.  6.3.Acknowledgements  Iwishtoexpressmysinceregratitudetomyadvisor,Prof.OswaldoTrelles,forthe invaluableopportunitythathegavemebyofferingmeaplaceinhisresearchteamandinthe Bioinformaticsworld,andforhavingfaithinmyabilitiesduringthedevelopmentofthis work.IalsowishtothankallofmycolleaguesattheBitlabteam,andspeciallytoÓscarfor allthesupportandprovidedguidance. Lastbutnottheleast,Iwishtothankmyfamilyforallwhattheyhavedoneforme throughtheyears,andtoAnnette,forwithoutherdaytodaysupportnoneofthiswouldhave beenpossible.  71      72   CHAPTER7. BIBLIOGRAPHY  1. EnisAfgan,DannonBaker,MariusvandenBeek,DanielBlankenberg,DaveBouvier, MartinČech,JohnChilton,DaveClements,NateCoraor,CarlEberhard,Björn Grüning,AysamGuerler,JenniferHillmanJackson,GregVonKuster,EricRasche, NicolaSoranzo,NiteshTuraga,JamesTaylor,AntonNekrutenko,andJeremy Goecks.TheGalaxyplatformforaccessible,reproducibleandcollaborative biomedicalanalyses:2016update.NucleicAcidsResearch  (2016)doi: 10.1093/nar/gkw343. 2. Wilde,Michael,etal."Swift:Alanguagefordistributedparallelscripting."Parallel Computing  37.9(2011):633652. 3. Wolstencroft,Katherine,etal."TheTavernaworkflowsuite:designingandexecuting workflowsofWebServicesonthedesktop,weborinthecloud."Nucleicacids research  (2013):gkt328. 4. Mardis,ElaineR."Theimpactofnextgenerationsequencingtechnologyongenetics." Trendsingenetics  24.3(2008):133141. 5. DeRoure,D.,Goble,C.andStevens,R.(2009):TheDesignandRealisationofthe myExperimentVirtualResearchEnvironmentforSocialSharingofWorkflows. FutureGenerationComputerSystems  25,pp.561567. 6. Benson,DennisA.,etal."GenBank."Nucleicacidsresearch  41.D1(2013):D36D42. 7. Kanehisa,Minoru,andSusumuGoto."KEGG:kyotoencyclopediaofgenesand genomes."Nucleicacidsresearch  28.1(2000):2730. 8. Mende,DanielR.;AlisonS.Waller;ShinichiSunagawa;AinoI.Järvelin;Michelle M.Chan;ManimozhiyanArumugam;JeroenRaes;PeerBork(20120223). "AssessmentofMetagenomicAssemblyUsingSimulatedNextGeneration SequencingData".PLoSONE  . 9. RichterichP.(1998):Estimationoferrorsin"raw"DNAsequences:avalidation study.GenomeRes  .8(3):251–259. 10. Huson,DanielH.,andNicoWeber."MicrobialcommunityanalysisusingMEGAN." Methodsinenzymology  531(2012):465485. 11. Altschul,S.F.,Gish,W.,Miller,W.,Myers,E.W.&Lipman,D.J.(1990)"Basiclocal alignmentsearchtool."J.Mol.Biol  .215:403410. 12. Gish,W.&States,D.J.(1993)"Identificationofproteincodingregionsbydatabase similaritysearch."NatureGenet  .3:266272. 13. MorgulisA.,CoulourisG.,RaytselisY.,MaddenT.L.,AgarwalaR.,&SchäfferA.A. (2008)"DatabaseindexingforproductionMegaBLASTsearches."Bioinformatics 15:17571764. 73 