These workflows are part of a set designed to work for RAD-seq data on the Galaxy platform, using the tools from the Stacks program.
Galaxy Australia: https://usegalaxy.org.au/
- demultiplexed reads in fastq format, may be output from the QC workflow. Files are in a collection.
- population map in text format
- reference genome in fasta format
Steps and outputs
BWA MEM 2:
- The reads are mapped to the reference genome; output in BAM format
- The collection of bam files is named something like Map with BWA-MEM on collection 5 (mapped reads in BAM format)
- Each of the bam files in the collection is named something like sample_CAAC
Samtools stats before filtering:
- These bam files are sent to Samtools stats to get statistics; these are then sent to MultiQC to provide a nice output. This is tagged as "bam stats before filtering" in the Galaxy history.
- The "General Statistics" show how many reads were mapped - if there is a low mapping rate, it may be worth re-checking or repeating QC on the raw reads, or considering a different reference genome, or using a de novo approach. To see if many reads have been soft-clipped by Bwa mem (which may affect how well gstacks can work), look at the "Alignment Metrics" section, and the row with "Mapped bases (Cigar)". Hover over the dots to see sample names especially towards the left of the row - these have the least mapped reads.
- This step filters out certain reads from the bam files. The default settings are to exclude reads if they are unmapped, if the alignment is not primary or is supplementary, if the read fails platform/vendor quality checks, and if the read is a PCR or optical duplicate.
- The output bams are tagged with "filtered bams" in the Galaxy history.
Samtools stats after filtering:
- Filtered bams are sent again to samtools stats, and statistics to MultiQC, with the report tagged as "bam stats after filtering" in the Galaxy history.
- Filtered bams and a population map are sent to gstacks. The outputs are:
- Catalog of loci in fasta format
- Variant calls in VCF format
- Note: some bam files cause errors here with gstacks. For example, the log file may say "Error, all records discard with file SampleXYZ.FASTQ.bam, Aborted". If this occurs, check the bam stats (as described above). Some of the options are to re-do QC on the raw reads, change settings for mapping reads in BWA MEM, and/or delete this sample/s from the population map and proceed to gstacks. The sample can still remain in the list of bam files but gstacks will only consider what is listed in the pop map.
- gstacks outputs and a population map are snet to the "populations" module. The outputs are:
- Locus consensus sequences in fasta format
- Snp calls, in VCF format
- Haplotypes, in VCF format
- Summary statistics
|4||Samtools stats: BAM stats before filtering||toolshed.g2.bx.psu.edu/repos/devteam/samtools_stats/samtools_stats/2.0.3|
|5||Samtools view: filters out unmapped and non-primary mapped reads (see flags)||toolshed.g2.bx.psu.edu/repos/iuc/samtools_view/samtools_view/1.13+galaxy2|
|6||MultiQC: BAM stats before filtering||toolshed.g2.bx.psu.edu/repos/iuc/multiqc/multiqc/1.11+galaxy0|
|8||Samtools stats: BAM stats after filtering||toolshed.g2.bx.psu.edu/repos/devteam/samtools_stats/samtools_stats/2.0.3|
|10||MultiQC: BAM stats after filtering||toolshed.g2.bx.psu.edu/repos/iuc/multiqc/multiqc/1.11+galaxy0|