Skip to content
This repository was archived by the owner on Nov 28, 2020. It is now read-only.

Calculate Coverage :: Bedtools

agaszmurlo edited this page Aug 30, 2018 · 3 revisions

How to calculate coverage (strand specific) using bedtools

  1. Pull Bedtools Docker image
docker pull biocontainers/bedtools
  1. In your data folder create calc_cov.sh. Clone from GitHub and copy to your data folder.
git clone git@gist.github.com:3d9585ae1247ae54d41e7377f8ff49a6.git
cd 3d9585ae1247ae54d41e7377f8ff49a6
cp calc_cov.sh /data/samples/sequila-rna/data/dane
cd /data/samples/sequila-rna/data/dane
chmod 777 calc_cov.sh
ls

calc_cov.sh  fastq  hisat  star  star1  star_bardzo_ograniczone  star_mniej_ograniczone  star_najbardziej_ograniczone 
  1. Run calc_cov.sh
./calc_cov.sh
Calculating coverage for star_najbardziej_ograniczone/sample_01Aligned.sortedByCoord.out.bam.
Output: coverage/star_najbardziej_ograniczone/sample_01Aligned.sortedByCoord.out.bed. Time taken: 16 s.
Calculating coverage for star_najbardziej_ograniczone/sample_02Aligned.sortedByCoord.out.bam.
Output: coverage/star_najbardziej_ograniczone/sample_02Aligned.sortedByCoord.out.bed. Time taken: 12 s.
Calculating coverage for star_najbardziej_ograniczone/sample_03Aligned.sortedByCoord.out.bam.
Output: coverage/star_najbardziej_ograniczone/sample_03Aligned.sortedByCoord.out.bed. Time taken: 13 s.
Calculating coverage for star_najbardziej_ograniczone/sample_04Aligned.sortedByCoord.out.bam.
Output: coverage/star_najbardziej_ograniczone/sample_04Aligned.sortedByCoord.out.bed. Time taken: 14 s.
Calculating coverage for star_najbardziej_ograniczone/sample_05Aligned.sortedByCoord.out.bam.
Output: coverage/star_najbardziej_ograniczone/sample_05Aligned.sortedByCoord.out.bed. Time taken: 13 s.
Calculating coverage for star_najbardziej_ograniczone/sample_06Aligned.sortedByCoord.out.bam.
Output: coverage/star_najbardziej_ograniczone/sample_06Aligned.sortedByCoord.out.bed. Time taken: 11 s.
Calculating coverage for star_najbardziej_ograniczone/sample_07Aligned.sortedByCoord.out.bam.
Output: coverage/star_najbardziej_ograniczone/sample_07Aligned.sortedByCoord.out.bed. Time taken: 12 s.
...
  1. Results are in coverage directory
aszmurlo@cdh00:/data/samples/sequila-rna/data/dane> head coverage/star/sample_01Aligned.sortedByCoord.out.bed
22      0       10678908        0       +
22      0       10678908        0       -
22      10678908        10678968        5       +
22      10678908        10678968        5       -
22      10678968        10872376        0       +
22      10678968        10872376        0       -
22      10872376        10872436        20      +
22      10872376        10872436        20      -
22      10872436        10959132        0       +
22      10872436        10959132        0       -

Clone this wiki locally