HUB
Sign inSign up
samtools_bcftools logo

pegi3s/samtools_bcftools

By pegi3s

•Updated 5 months ago

SAMtools-BCFtools (http://www.htslib.org/) docker image.

Image
Machine learning & AI
Data science
2

50K+

pegi3s/samtools_bcftools repository overview

⁠This image belongs to a larger project called Bioinformatics Docker Images Project (http://pegi3s.github.io/dockerfiles⁠)

⁠(Please note that the original software licenses still apply)

This image facilitates the usage of SAMtools-BCFtools⁠, a suite of programs for interacting with high-throughput sequencing data.

To see SAMtools-BCFtools options, just run: docker run --rm pegi3s/samtools_bcftools samtools --help or docker run --rm pegi3s/samtools_bcftools bcftools --help.

⁠Using the SAMtools-BCFtools image in Linux

You should adapt and run the following command: docker run --rm -v /your/data/dir:/data pegi3s/samtools_bcftools <samtools_or_bcftools> <options>

In this command, you should replace:

  • /your/data/dir to point to the directory that contains the input files you want to analyze.
  • <samtools_or_bcftools> to the name of either SAMtools or BCFtools executable you want to use.
  • <options> with the specific options of the SAMtools or BCFtools application. These options will include the input/output files, which should be referenced under /data/.

⁠Examples

⁠Example 1: generate a high quality VCF file

For instance, if you want to generate a high quality VCF file from an input SAM file, you should run the following three steps:

  • docker run --rm -v /your/data/dir:/data pegi3s/samtools_bcftools samtools view -bS /data/aln-pe.sam > aln-pe.bam

  • docker run --rm -v /your/data/dir:/data pegi3s/samtools_bcftools bash -c "samtools mpileup -uf /data/chr19_KI270866v1_alt.fasta /data/aln-pe.bam | bcftools call -mv > /data/var.raw.vcf"

  • docker run --rm -v /your/data/dir:/data pegi3s/samtools_bcftools bash -c "bcftools filter -s LowQual -e '%QUAL<20 || DP>100' /data/var.raw.vcf > /data/var.flt.vcf"

To test the previous commands, the input SAM file used is available here⁠, and the input FASTA file is available here⁠.

⁠Example 2: create and plot statistics

In this example, SAMtools-stats⁠ and plot-bamstats⁠ are used to collect statistics from a BAM file (samtools stats) and creating a graphical representation (plot-bamstats). To see SAMtools-stats or plot-bamstats options, just run: docker run --rm pegi3s/samtools_bcftools samtools stats --help or docker run --rm pegi3s/samtools_bcftools plot-bamstats --help.

⁠Example 2, step 1: create the stats file

You should adapt and run the following command: docker run --rm -v /your/data/dir:/data pegi3s/samtools_bcftools sh -c "samtools stats /data/sortedbamfilename.bam > /data/sortedbamfilename.stats"

In this command, you should replace:

  • /your/data/dir to point to the directory that contains the bam files you want to analyze.
  • sortedbamfilename.bam to the name of the bam file you want to process.
  • sortedbamfilename.stats to the name of the output stats file.
⁠Example 2, step 2: plot the statistics

You should adapt and run the following command: docker run --rm -v /your/data/dir:/data pegi3s/samtools_bcftools sh -c "plot-bamstats -p /data/output_name /data/sortedbamfilename.stats"

In this command, you should replace:

  • /your/data/dir to point to the directory that contains the stats file generated by samtools stats.
  • output_name to a name for the output plots.
  • sortedbamfilename.stats to the name of the stats file generated by samtools stats.

To test the previous commands, the input BAM file is available here⁠. Replace sortedbamfilename.bam to the name of this filel to run the example commands.

Tag summary

Content type

Image

Digest

sha256:f5c772bc5…

Size

124 MB

Last updated

5 months ago

docker pull pegi3s/samtools_bcftools