RAD-Seq de-novo data analysis
How to analyze RAD sequencing data without a reference genome for a population genomics study?
Analysis of RAD sequencing data without a reference genome
SNP calling from RAD sequencing data
Calculate population genomics statistics from RAD sequencing dataTime estimation: 8 hoursSupporting Materials:Published: Feb 14, 2017Last modification: Nov 3, 2023License: Tutorial Content is licensed under Creative Commons Attribution 4.0 International License. The GTN Framework is licensed under MITpurl PURL: https://gxy.io/GTN:T00128rating Rating: 4.5 (2 recent ratings, 2 all time)version Revision: 14
In the study of Hohenlohe et al. 2010, a genome scan of nucleotide diversity and differentiation in natural populations of threespine stickleback Gasterosteus aculeatus was conducted. Authors used Illumina-sequenced RAD tags to identify and type over 45,000 single nucleotide polymorphisms (SNPs) in each of 100 individuals from two oceanic and three freshwater populations.
We here proposed to re-analyze these data at least until the population genomics statistics calculation step using STACKS pipeline. Existing Gasterosteus aculeatus draft genome will not be used here so the analysis will be performed de novo. In a de novo RAD-seq data analysis, the reads are aligned one on each other to create stacks and then clustered to build loci. A reference approach can also be conducted (see ref_based tutorial, allowing to work on existing assembled loci).
In this tutorial, we will deal with:
We will look at the first run SRR034310 out of seven which includes 16 samples from 2 populations, 8 from Bear Paw (freshwater) and 8 from Rabbit Slough (oceanic). We will download the reads directly from SRA and the remaining data (i.e reference genome, population map file, and barcodes file) from Zenodo.
Hands-on: Data upload
Create a new history for this RAD-seq exercise. If you are not inspired, you can name it STACKS RAD: population genomics without reference genome for example…
Click the new-history icon at the top of the history panel.
If the new-history is missing:
- Click on the galaxy-gear icon (History options) on the top of the history panel
- Select the option Create New from the menu
- EBI SRA tool with the following parameters:
- Select the Run from the results of the search for
SRR034310(which will present you 1 Experiment (SRX015877) and 1 Run (SRR034310)).
- Click the link in the column FASTQ files (Galaxy) of the results table
- This will redirect to the Galaxy website and start the download.
- Upload remaining training data from Zenodo:
- Copy the link location
Click galaxy-upload Upload Data at the top of the tool panel
- Select galaxy-wf-edit Paste/Fetch Data
Paste the link(s) into the text field
- Close the window
Make sure your fasta files are of datatype
- Click on the galaxy-pencil pencil icon for the dataset to edit its attributes
- In the central panel, click on the galaxy-gear Convert tab on the top
- In the lower part galaxy-chart-select-data Datatypes, select
- tip: you can start typing the datatype into the field to filter the dropdown menu
- Click the Save button
The sequences are raw sequences from the sequencing machine, without any pretreatments. They need to be demultiplexed. To do so, we can use the Process Radtags tool from STACKS.
For demultiplexing, we use the Process Radtags tool from STACKS .
Hands-on: Demultiplexing reads
- Process Radtags tool to demultiplex the reads:
- “Single-end or paired-end reads files”:
- “singles-end reads infile(s)”:
- “Barcode file”:
- “Number of enzymes”:
- “Capture discarded reads to a file”:
- “Output format:”
- How many reads where on the original dataset?
- How many are kept?
- Can you try to explain the reason why we loose a lot of reads here?
- What kind of information does this result give concerning the upcoming data analysis and the barcodes design in general?
The informations can be found in the results log file:
- 8895289 total reads
- 8139531 retained reads
- There are no sequences filtered because of low quality. This is because radtags didn’t apply quality related filtering since the corresponding advanced option (Discard reads with low quality scores) has not been enabled. So here, all not retained sequences are removed because of an ambiguous barcode (
626265) or an ambiguous RAD-Tag (
129493). This means that some barcodes are not exactly what was specified on the barcode file and that sometimes, no SbfI restriction enzyme site was found. This can be due to some sequencing problems but here, this is also due to the addition, in the original sequencing library, of RAD-seq samples from another study. This strategy is often used to avoid having too much sequences beginning with the exact same nucleotide sequence which may cause Illumina related issues during sequencing and cluster analysis
- Sequencing quality is essential! Each time your sequencing quality decreases, you loose data and thus essential biological information!
In addition to the overall statistics the numbers of retained and removed reads are also given for each bar code sequence.
Next we will play around with the parameters a bit, to see the impact they have on the results.
- Process Radtags tool: Re-Run playing with parameters
- Section Advanced
- “Discard reads with low quality scores”:
- “score limit”:
20(for example; play with this)
- “Set the size of the sliding window as a fraction of the read length, between 0 and 1”:
0.30(for example; play with this)
This sliding window parameter allows notably the user to deal with the declining quality at the 3’ end of reads.
You can use the
Chartsfunctionality through the Visualize button reachable on the
Radtags logsfile you just generated.
If like me you don’t have payed attention to the organization of you file for the graphical representation you obtain a non optimal bars diagram with a not intelligent X-axis ordering. There is a lot of different manner to fix this. You can use a copy/paste “bidouille” or you can use Galaxy tools to manipulate the
radtags logsfile to generate a better graph. For example, you can use
Select lines that match an expressiontool to select rows then use the
Concatenate datasets tail-to-headtool to reorganize these lines in a new file. Then we generate a graphical display of the changes:
First we cut the interesting lines of each
result.log with Stacks: process radtags
- Select lines that match an expression applying
^R1.fq.gzon the log files and then
- Replace Text in entire line on the resulting data sets finding
R1.fq.gzand replacing with
Score20depending of the case
- Select lines that match an expression applying
File\tRetained Readson one of the log file to obtain you futur header
- Replace Text in entire line on the resulting data set finding
Fileand replacing with
#to have a best display
- Concatenate datasets tail-to-head on the resulting data sets stating from the header you just created
- Finally Convert delimiters to TAB on the resulting data set converting all Tabs to be sure having a well formatted tabular file at the end
Alternatively just copy/paste these lines on the Galaxy upload tool using Paste/fetch data section and modifying the File header by sample and filename by Score 10 / Score 20 and Lowquality for example… Before Starting the upload, you can select the
Convert spaces to tabsoption through the
Upload configurationwheel. If you did not pay attention to the order you can just sort the file using the first column.
You can use the
Charts functionality through the Visualize button to plot the data.
And you obtain a file like this one, ready to generate a beautiful and smart bar stacked!
# Retained Reads Low Quality Ambiguous Barcodes Ambiguous RAD-Tag Total
NoScoreLimit 8139531 0 626265 129493 8895289
Score10 7373160 766371 626265 129493 8895289
Score20 2980543 5158988 626265 129493 8895289
You can further test using a filter like
clean data, remove any read with an uncalled base and see that here, this has only little impact on the number of retained reads.
The demultiplexed sequences are raw sequences from the sequencing machine, without any pretreatments. They need to be controlled for their quality.
We propose to continue the tutorial using the dataset collection containing the demultiplexed reads obtained with Process Radtag execution made with a quality score of 10 and with the
Discard reads with low quality scores parameter set to Yes (so containing 7373160 retained reads).
Hands-on: Quality control
FastQC tool: Run FastQC on FastQ files to control the quality of the reads. Warning! Don’t forget you are working on data collections….Question
- What is the read length?
The read length is 32 bp
MultiQC tool: Run MultiQC on FastQC results to better see quality information over samples.
SNP calling from radtags
Stacks: De novo map Galaxy tool. This program will run ustacks, cstacks, and sstacks on the members of the population, accounting for the alignments of each read.
Information on denovo_map.pl and its parameters can be found online: https://creskolab.uoregon.edu/stacks/comp/denovo_map.php.
Hands-on: Stacks: De novo map
First we will create a population map file with the following contents:
sample_CCCC 1 sample_CCAA 1 sample_CCTT 1 sample_CCGG 1 sample_CACA 1 sample_CAAC 1 sample_CATG 1 sample_CAGT 1 sample_CTCT 2 sample_CTAG 2 sample_CTTC 2 sample_CTGA 2 sample_GGGG 2 sample_GGAA 2 sample_GGTT 2 sample_GGCC 2
- Click galaxy-upload Upload Data at the top of the tool panel
- Select galaxy-wf-edit Paste/Fetch Data at the bottom
- Paste the file contents into the text field
- Press Start and Close the window
- Stacks: De novo map tool: with the following parameters:
- “Select your usage”:
- “Files containing an individual sample from a population”:
The demultiplexed reads (collection)
- “Specify a population map”:
the population map you just created
- Section Assembly options
- “Minimum number of identical raw reads required to create a stack”:
- “Number of mismatches allowed between loci when building the catalog”:
- “Remove, or break up, highly repetitive RAD-Tags in the ustacks program”:
Once Stacks has completed running, investigate the output files:
catalog.(snps, alleles and tags).
If you are using a file presenting population information and individual name in a different manner than expected by STACKS, you can use Galaxy tools like
Replace Text(for example to replace
Rabbit Sloughby a population number like
Add column(for example to add
Cut columns from a table(to put the new
sample_column af the first place) and finally
\1) to generate it…
Calculate population genomics statistics
Hands-on: Calculate population genomics statistics
- Stacks: populations tool with the following parameters:
- Section Data filtering options
- “Minimum percentage of individuals in a population required to process a locus for that population”:
- Section Output options (VCF and Structure) and enabling SNP and haplotype-based F statistics calculation.
- “Output results in Variant Call Format (VCF)”:
- “Output results in Structure Format”:
- “Enable SNP and haplotype-based F statistics”:
- Now look at the output in the file
SNP and Haplotype-based F statistics with Stacks: populations ...on your history. There are a large number of statistics calculated at each SNP, so use Galaxy tools like filter, cut, and sort to focus on some.Question
- What is the maximum value of FST’ at any SNP? Don’t hesitate to look at the STACKS manual to find where this parameter is
- What is the meaning of this FST’ value compared a a classical FST one? Once again, the STACKS manual can help you ;)
- How many SNPs reach this FST’ value?
- FST’ is a haplotype measure of FST that is scaled to the theoretical maximum FST value at this locus. Depending on how many haplotypes there are, it may not be possible to reach an FST of 1, so this method will scale the value to 1
You can now for example filter this dataset to only keep FST’=1 loci for further analysis…
In this tutorial, we have analyzed real RAD sequencing data to extract useful information, such as which loci are candidate regarding the genetic differentiation between freshwater and oceanic Stickelback populations. To answer these questions, we analyzed RAD sequence datasets using a de novo RAD-seq data analysis approach. This approach can be sum up with the following scheme: