Structural Variant (SV) calling with SVdetect 2022
- 1 Overview
- 2 Learning objectives:
- 3 Calling SV with SVdetect:
- 3.1 Prepare your directories
- 3.2 Map data using bowtie2
- 3.3 Install SVDetect
- 3.3.1 conda installation
- 3.3.1.1 We can now activate our new environment
- 3.3.1.2 Using the "which -a" command shows us we actually have access to multiple different cpan executables. Friday's class will discuss more about how you can end up with multiple executable files named the same thing stored in different directories, and how the command line will treat them
- 3.3.1.3 Install Perl modules required for SVDetect. (I do not know why the words do and for are appearing in bold, they are not meant as some kind of hint).
- 3.3.1.4 relaunch cpan
- 3.3.1.5 On the cpan prompt
- 3.3.1.6 Install Perl modules required for SVDetect. (I do not know why the words do and for are appearing in bold, they are not meant as some kind of hint).
- 3.3.1 conda installation
- 3.4 Analyze read mapping distribution
- 3.5 Running SVDetect
- 3.5.1 Using nano, create the file svdetect.conf with this text
- 3.5.2 OR take advantage of this one liner which captures the line listed above, pulls the 2 numbers to a pair of variables, and then replaces unknown1 and unknown2 with the correct values in the existing file
- 3.5.3 Commands to run SNVDetect
Overview
Most approaches for predicting structural variants require you to have paired-end or mate-pair reads. They use the distribution of distances separating these reads to find outliers and also look at pairs with incorrect orientations. As mentioned during several of the presentations, many researchers choose to ignore these types of mutations and combined with the increased difficulty of accurately identifying them, the community is less settled on the "best" way to analyze them. Here we present a tutorial on a somewhat older program SVDetect. SVDetect is a type of program that makes use of configuration files rather than command line options (something you may encounter with other programs in your own work).
Other possible tools:
BreakDancer - hard to install prerequisites on TACC. Requires installing libgd and the notoriously difficult GD Perl module.
PEMer - hard to install prerequisites on TACC. Requires "ROOT" package.
Good discussion of some of the issues of predicting structural variation:
Comparison of many different SV tools
Learning objectives:
Identify structural variants in a new data set.
Work with a new type of program that uses configuration files rather than entering all information on a single command at the command line. This is very similar to the queue system TACC uses making this a good introduction.
Calling SV with SVdetect:
Here we'll look an E. coli genome re-sequencing sample where a key mutation producing a new structural variant was responsible for a new phenotype involving citrate, something the Barrick lab has studied.
Prepare your directories
suggested directory set up. Note the copy command must be run while on the head node, not an idev node
cds
cp -r $BI/gva_course/structural_variation/data GVA_sv_tutorial
cd GVA_sv_tutorial
This is Illumina mate-paired data (having a larger insert size than paired-end data) from genome re-sequencing of an E. coli clone.
File Name | Description | Sample |
|---|---|---|
| Paired-end Illumina, First of mate-pair, FASTQ format | Re-sequenced E. coli genome |
| Paired-end Illumina, Second of mate-pair, FASTQ format | Re-sequenced E. coli genome |
| Reference Genome in FASTA format | E. coli B strain REL606 |
NC_012967.1.lengths | Simple tab delimtered file based on the size of the reference needed for SVDetect so you don't have to create it yourself |
|
Map data using bowtie2
First we need to (surprise!) map the data. This will hopefully reinforce the bowtie2 tutorial you just completed.
Do not run on head node
Use hostname to verify you are still on the idev node.
If not, and you need help getting a new idev node, see this tutorial.
conda activate GVA-bowtie2-mapping
bowtie2-build NC_012967.1.fasta NC_012967.1
bowtie2 -t -p 64 -X 5000 --rf -x NC_012967.1 -1 61FTVAAXX_2_1.fastq -2 61FTVAAXX_2_2.fastq -S 61FTVAAXX.samPossibly unfamiliar options:
--rftells bowtie2 that your read pairs are in the "reverse-forward" orientation of a mate-pair library-X 5000tells bowtie2 to not mark read pairs as discordant unless their insert size is greater than 5000 bases.
You may notice that these commands complete pretty quickly. Always remember speed is not necessarily representative of how taxing something is for TACC's head node, and always try to be a good TACC citizen and do as much as you can on idev nodes or as job submissions
Install SVDetect
This will be the most complicated installation yet. In addition to needing to install several different programs in the same conda installation command, we will need to install perl modules through cpan. Unfortunately, the cpan network can not be accessed through the compute nodes, so you must log out of your idev session using the logout command before continuing. If you are unsure if you are in an idev session remember you can use the hostname command to check.
conda installation
Like we saw in our samtools installation, we will need to install several programs at the same time to make sure they are all going to work with each other. In addition, we are going to create a new environment for working with SVDetect as some of the dependencies of SVDetect clash with those of samtools.
conda create --name GVA-SV -c bioconda -c conda-forge -c imperial-college-research-computing _libgcc_mutex perl libgcc-ng svdetect
We can now activate our new environment
conda activate GVA-SVcpan module installations
Again, make sure you are NOT on an idev node for working with cpan
If you attempt to launch cpan, you likely get a message similar to the following:
/home1/0004/train402/miniconda3/envs/svdetect/bin/perl: symbol lookup error: /home1/apps/bioperl/1.007002/lib/perl5/x86_64-linux-thread-multi/auto/version/vxs/vxs.so: undefined symbol: Perl_xs_apiversion_bootcheckUsing the "which -a" command shows us we actually have access to multiple different cpan executables. Friday's class will discuss more about how you can end up with multiple executable files named the same thing stored in different directories, and how the command line will treat them
which -a cpan~/miniconda3/envs/SVDetect/bin/cpan
/usr/bin/cpan
While just typing cpan the first location was used and we saw it didn't work as we had hoped. We can explicitly launch the 2nd location by using the full path to the executable file on the prompt
/usr/bin/cpanIn the following block note that each elipse will include large blocks of scrolling text as different modules are downloaded and installed. The process will take several minutes in total, just be ready to execute the next command when you get the cpan prompt back.