TITLE: Assessing sequence quality in GalaxyTrakr
AUTHORS: Ruth Timme, Sai Laxmi Gubbala Venkata, Maria Balkey, Robyn Randolph, William Wolfgang, Errol Strain

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block"><span style = "font-weight:bold;">PURPOSE: </span><span>Step-by-step instructions for checking WGS sequence quality.  The MicroRunQC workflow, implimented in a custom Galaxy instance, will produce quality assessments for raw reads (illumina paired-end fastq files) and draft de novo assemblies, along with reporting the sequence type for each isoalte. This workflow will work on most microbial pathogens, so we advise laboratories to upload their entire MiSeq/NextSeq run through this workflow.   </span></div><div class = "text-block"><span style = "font-weight:bold;">SCOPE: </span><span>This protocol covers the following tasks:</span></div><div class = "text-block">1. set up an account in GalaxyTrakr</div><div class = "text-block">2. Create a new history/workspace</div><div class = "text-block">3. Upload data</div><div class = "text-block">4. Execute the MicroRunQC workflow</div><div class = "text-block">5. Interpret the results</div></div>

[STEPS]
?. [Account set up]
Create a GalaxyTrakr account here: https://account.galaxytrakr.org/Account/Register
?. [Account set up]
Log into your GalaxyTrakr account: https://galaxytrakr.org
?. [Create a new history]
Create a new history. We recommend creating a new history for each new MiSeq Run and including the flow-cell ID and date in the history name. Save your MicroRunQC output here and any other relevant analyses, like serotyping, or AMR detection. After all the analysis output from this run is saved to your internal data network or computer, older history's should be purged/deleted so as not to occupy the limited storage space in your account. In some cases it may be useful to save, for a limited time, multiple histories or to run analyses concurrently in multiple histories. In these cases you need to pay attention to your % usage bar (shows % used of allocated storage space) in the upper right corner of the GalaxyTrakr page. If you need additional space you can contact galaxytrakrsupport@fda.hhs.gov and request additional storage.
?. [Create a new history]
Click on the + icon in the upper right History panel
?. [Create a new history]
Name your new History by clicking on the “Unnamed history”, type in desired name and hit enter.  We recommend including the run cell ID and the date the run was started.
?. [Upload data]
This section will describe the process for uploading raw fastq files into your active History panel. After the files have been uploaded they will stay in your account until they are deleted.
?. [Upload data]
Click on the upload/download icon on the top of the left web page to start an upload process.
							  .justify:after {
							    content: "";
							    display:inline-block;
							    width: 100%;
							  }
?. [Upload data]
Select "Type (set all):auto-detect." Choose local file button and navigate to the desired fastq files, then click "start" to upload files. These files should be paired (two per sample/isolate).
							  .justify:after {
							    content: "";
							    display:inline-block;
							    width: 100%;
							  }
							As the file uploads complete, each row will turn green. Samples in yellow are still in process.
?. [Upload data]
You have just upload a set of forward and reverse reads.  For further analysis these files need to be paired properly so the platform knows which R1 and R2 files go with each sample/isolate.  GalaxyTrakr does this by creating a List of Dataset Pairs.Within your newly created History panel, click the "check box," then select all the files you just uploaded by clicking "All" or by individually selecting the ones you want to pair.
?. [Upload data]
Click "For all selected" and choose "Build List of Dataset Pairs"
?. [Upload data]
A new window will open to help you pair the fastq files properly.  Note how your paired reads are named (_R1 and _R2 in the example above)Select Clear filters, then click Auto-pair.Alternatively, instead of autopairing you can click "choose filters" and  select the appropriate filter for the pairing:
?. [Upload data]
Paired reads will pair in the middle column and turn green.Name your dataset:  Example, "pairedSet--"Click Create list.
?. [Upload data]
This paired dataset will now be available for analysis in your history panel. You can run multiple analyses on the same dataset in a history rather than upload the same sequence data to a new history to perform additional analyses. This will help you use your allocated storage space efficiently.
?. [Run the MicroRunQC workflow]
Add the MicroRunQC workflow to your own "workflows" panel.  You only have to do this step once for each new workflow you need.
?. [Run the MicroRunQC workflow]
Navigate to the “Shared Data" drop down menu, choose workflows and from the MicroRunQC drop down menu select import.
?. [Run the MicroRunQC workflow]
To see the new workflow in your “Workflows” tools panel on the left, open the Workflow tab and check “show in tools panel” for the workflow of interest.
?. [Run the MicroRunQC workflow]
From the workflow menus select MicroRunQC
?. [Run the MicroRunQC workflow]
Select paired list dataset you created earlier.Click Run Workflow. This can take some time depending on the number of samples you are analyzing. If you choose to you can log out of GalaxyTrakr and log back in at a later time to see if the job is completed.
?. [Run the MicroRunQC workflow]
Upon completion of the pipeline all tiles in the history bar will be green.In the “Filter on Data” tile click on the “Eye” icon to view the output in the GalaxyTrakr window.
?. [Interpret the results]
Download and interpret the results:
?. [Interpret the results]
Click “Filter on data” and then the floppy disc icon. The tabular file can be opened in a text reader or converted to a format that can be opened on excel.
?. [Interpret the results]
The MicroRunQC output file includes the following metrics:  ABC1ParameterInputDescription2ContigsAssemblyNumber of contigs in the de-novo SKESA assembly. Contigs smaller than 200 base-pairs (bp) are not counted.&nbsp;3LengthAssemblyTotal length of all contigs &gt; 200bp. This should approximate the size of the genome for the target organism.4EstCovAssemblyMean coverage for contigs in the SKESA assembly.5N50AssemblySequence length of the shortest contig at 50% of the total genome length6MedianInsertReadDistance between forward and reverse reads. Calculated by mapping reads to SKESA assembly using bwa.7MeanLength_R1ReadMean length of forward read8MeanLength_R2ReadMean length of reverse read9MeanQ_R1ReadMean Q-score of forward read10MeanQ_R2ReadMean Q-score of reverse read11SchemeAssemblyPubMLST (pubmlst.org) database scheme (e.g. senterica for Salmonella enterica)12STAssemblySequence Type&nbsp;13LociAssemblygene (allele number) – for example aroC(118)**This output should be saved either to your LIMS or to a spreadsheet linked to the sequencing run and samples.
ABC1ParameterInputDescription2ContigsAssemblyNumber of contigs in the de-novo SKESA assembly. Contigs smaller than 200 base-pairs (bp) are not counted.&nbsp;3LengthAssemblyTotal length of all contigs &gt; 200bp. This should approximate the size of the genome for the target organism.4EstCovAssemblyMean coverage for contigs in the SKESA assembly.5N50AssemblySequence length of the shortest contig at 50% of the total genome length6MedianInsertReadDistance between forward and reverse reads. Calculated by mapping reads to SKESA assembly using bwa.7MeanLength_R1ReadMean length of forward read8MeanLength_R2ReadMean length of reverse read9MeanQ_R1ReadMean Q-score of forward read10MeanQ_R2ReadMean Q-score of reverse read11SchemeAssemblyPubMLST (pubmlst.org) database scheme (e.g. senterica for Salmonella enterica)12STAssemblySequence Type&nbsp;13LociAssemblygene (allele number) – for example aroC(118)
?. [Interpret the results]
Example output for 4 Listeria samples run through the MicroRunQC workflow:  ABCDEFGHIJKLMNOPQRS1File nameContigsLengthEstCovN50MedianInsertMeanLength_R1MeanLength_R2MeanQ_R1MeanQ_R2SchemeST2FSL-R9-834614287687487.8512255408147.6147.733.132.7lmonocytogenes389abcZ(52)bglA(1)cat(12)dapE(71)dat(2)ldh(1)lhkA(5)3FSL-R9-834811283217284.21464158388147.9147.933.232.9lmonocytogenes795abcZ(7)bglA(10)cat(18)dapE(6)dat(5)ldh(7)lhkA(1)4FSL-R9-835014288462964.2450082390147.2147.233.132.7lmonocytogenes37abcZ(5)bglA(7)cat(3)dapE(5)dat(1)ldh(8)lhkA(6)5FSL-R9-835212290252085.91460419390148.1148.233.132.8lmonocytogenes391abcZ(7)bglA(6)cat(62)dapE(28)dat(5)ldh(2)lhkA(1)
ABCDEFGHIJKLMNOPQRS1File nameContigsLengthEstCovN50MedianInsertMeanLength_R1MeanLength_R2MeanQ_R1MeanQ_R2SchemeST2FSL-R9-834614287687487.8512255408147.6147.733.132.7lmonocytogenes389abcZ(52)bglA(1)cat(12)dapE(71)dat(2)ldh(1)lhkA(5)3FSL-R9-834811283217284.21464158388147.9147.933.232.9lmonocytogenes795abcZ(7)bglA(10)cat(18)dapE(6)dat(5)ldh(7)lhkA(1)4FSL-R9-835014288462964.2450082390147.2147.233.132.7lmonocytogenes37abcZ(5)bglA(7)cat(3)dapE(5)dat(1)ldh(8)lhkA(6)5FSL-R9-835212290252085.91460419390148.1148.233.132.8lmonocytogenes391abcZ(7)bglA(6)cat(62)dapE(28)dat(5)ldh(2)lhkA(1)
?. [Interpret the results]
Quality control threshold guidelines for the GenomeTrakr surveillance network. These are also relevant for NARMS and VetLIRN contributors. *MicroRunQC users should follow threshold guidelines established by their respective surveillance coordinating body(s).  ABCDEFG1Quality&nbsp;metricSalmonellaListeriaE. coliShigellaCampylobacterVibrio para.2Average read&nbsp;quality&nbsp;Q score for R1 and R2&gt;=30&gt;=30&gt;=30&gt;=30&gt;=30&gt;=303Average coverage&gt;=30X&gt;=20X&gt;=40X&gt;=40X&gt;=20X&gt;=40X4De novo&nbsp;assembly: Seq. length (Mbp)~4.3-5.2~2.7-3.2~4.5-5.9~4.0-5.0~1.5-1.9~4.8-5.55De novo&nbsp;assembly: no. contigs&lt;=300&lt;=300&lt;=500&lt;=650&lt;=300&lt;=300
ABCDEFG1Quality&nbsp;metricSalmonellaListeriaE. coliShigellaCampylobacterVibrio para.2Average read&nbsp;quality&nbsp;Q score for R1 and R2&gt;=30&gt;=30&gt;=30&gt;=30&gt;=30&gt;=303Average coverage&gt;=30X&gt;=20X&gt;=40X&gt;=40X&gt;=20X&gt;=40X4De novo&nbsp;assembly: Seq. length (Mbp)~4.3-5.2~2.7-3.2~4.5-5.9~4.0-5.0~1.5-1.9~4.8-5.55De novo&nbsp;assembly: no. contigs&lt;=300&lt;=300&lt;=500&lt;=650&lt;=300&lt;=300