Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

Throughout the course we have focused on samll data sets, a limited number of samples, and in some cases even purposefully capped the total number of reads you have access to. This has been done for the purpose of time and letting you see the results tick by rather than simply having you come in for 30 minutes, submit a job, and wait an hour (or 6) before it starts running,  and have it take another 10 hours to run. The reality is while you will sometimes work with a test sample or a small pilot project, Big Data in Biology means LOTS of data and lots of data means needing to not just identify variants in 1 sample, but to identify commonality across different systems. here we introduce you to bedtools. A program designed to make comparisons across differnt file types generaterated from different samples or using different parameters of a given pipeline.

Objectives

  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 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 and copy the respective VCF files to it, renaming them so that we know where they came from:

If 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

Use 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: 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.

load bedtools
module load bedtools
Finding common mutations.
bedtools intersect -a bowtie2.vcf -b bwa.vcf > common_bowtie2_bwa.vcf
Finding mutations that are unique for each mapper.
bedtools subtract -a bowtie2.vcf -b common_bowtie2_bwa.vcf > unique_bowtie2.vcf
bedtools subtract -a bwa.vcf -b common_bowtie2_bwa.vcf > unique_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.

cds
mkdir mapping
cd mapping
cp -r $BI/gva_course/mapping/bowtie .
cp -r $BI/gva_course/mapping/bwa . 
cp -r $BI/gva_course/mapping/bowtie2 .
  • No labels