Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Become familiar with how to use bedtools
  2. Understand when and how bedtools is useful

 

Comparing the results of different mappers using bedtools

Often you want to compare the results of variant calling on different samples or using different pipelines. Bedtools is a suite of utility programs that work on a variety of file formats, one of which is conveniently VCF format. It provides many ways of slicing, dicing, and comparing the information in VCF files. For example, we can use it to find out In this tutorial we will use it on .vcf files generated with samtools after mapping with each of 3 different read mappers (bowtie2, bwa and bowtie) to determine what predictions are the same and which are different from the variant calling on reads mapped with different programs if you generated VCF files for each one. Set up a new output directory . You could do this with your own personally generated data from the SRR030257 fastq files we used in the mapping tutorials. For now, create a new directory named BDIB_bedtools on scratch and copy the respective VCF files to it , renaming them so that we know where they came fromfrom $BI/gva_course/bedtools/:

Code Block
languagebash
titleIf you have done any of the optional other mapping tutorials, consider the following comparisons. Remember the use of cp -i (or cp -n on some newer linux versions) is useful to make sure you don't overwrite any existing files.
mkdir comparison
 
#direcoties need renaming or copying from below####
cp -i samtools_bowtie2/SRR030257.vcf comparison/bowtie2.vcf
cp -i samtools_bwa/SRR030257.vcf comparison/bwa.vcf
cp -i samtools_bowtie/SRR030257.vcf comparison/bowtie.vcf
cd comparison

...

By this point in the class you should know how to do this. Try to do it on your own and then check your work. If you were wrong, ask a question.
collapsetrue
mkdir $SCRATCH/BDIB_bedtools 
cd $SCRATCH/BDIB_bedtools
cp  -i $BI/gva_course/bedtools/*.vcf .

Remember the above command is simply 1 possible solution there are multiple ways you could have done this, most commonly recurrsively copying the entire directly, or copying all the files rather than just the vcd files. Useing the subcommands bedtools intersect and bedtools subtract we can find equal and different predictions between mappers. Try to figure out how to to do this on your own first.   Hint:

Expand
titleHint:

...

Remember that adding > output.vcf to the end of a command will pipe the output that is to the terminal into a file, so that you can save it.
Code Block
true
languagebash
titleload bedtoolscollapse
module load bedtools
Code Block
languagebash
titleFinding common mutations.
collapsetrue
bedtools intersect -a bowtie2.vcf -b bwa.vcf > common_bowtie2_bwa.vcf

...

#### may need to be added to the top

...

If you do not have the output from the Mapping tutorial, run these commands to copy over the output that would have been produced. Then, you can immediately start this tutorial! This will be used for the optional bedtools tutorial as well.

...