Sign inSign up

jysgro/bowtie2

By jysgro

•Updated almost 3 years ago

Next Gen sequencing map aligner.

Image
Data science
0

323

jysgro/bowtie2 repository overview

Based on the "live demo" on the interactive console at the sandbox.bio⁠ site in the Sequence alignment with bowtie2⁠ episode.

The example files are installed as part of the bowtie2 installation and can be found a path: /opt/bowtie2-2.5.1-linux-x86_64/example/

The following command could be used to use on a local computer:

docker run -it --rm jysgro/bowtie2:sam115_bcf118

NOTE: Macintosh Silicon Chip (e.g. M1 chip") need to first pull the image specifying that it is an Intel (amd64) image. (But the macOS Rosetta2 will convert the chip when it is run.)

docker pull --platform linux/amd64 jysgro/bowtie2:sam115_bcf118

This image would work on an HTCondor server. The submit file could start with:

universe =  Docker
docker_image = jysgro/bowtie2:sam115_bcf118

The "container" Universe could also be used instead.

The Docker image jysgro/bowtie2:sam115_bcf118⁠ was created from image staphb/bowtie2:2.5.1⁠ to add the missing bcftools software. The following Dockerfile was used:

FROM staphb/bowtie2:2.5.1
RUN apt-get update && apt-get install -y  git nano wget
RUN wget https://github.com/samtools/bcftools/releases/download/1.18/bcftools-1.18.tar.bz2 && \
    tar xvf bcftools-1.18.tar.bz2 && \
    rm bcftools-1.18.tar.bz2 && \
    cd bcftools-1.18 && \
    ./configure --prefix=/usr/local && \
    make && \
    make install && \
    rm *.o && \
    export PATH=/usr/local/bin:$PATH 
# Clean-up files not needed from previous installation
RUN cd /samtools* && \
    rm *.o

⁠SCRIPT to run as example on an HTCondor scheduler system.

Script to run, e.g. wihtin a file called bt2.sh

#!/bin/bash

# Follow example at:
# https://sandbox.bio/tutorials?id=bowtie2-intro&step=0
# To make it work on CHTC

# Copy example locally to make commands clearer
cp -r /opt/bowtie2-2.5.1-linux-x86_64/example/ ${PWD}
# Now move all dirs from within ./example into ${PWD}
mv example/* ${PWD}

# Define HOME
export HOME=${PWD}
# Define index location and core name
export REF=./index/lambda_virus
# Define location of reference genome
export REF_FASTA=./reference/lambda_virus.fa

# Align single-end reads
bowtie2 -x $REF -U reads/reads_1.fq -S eg1.sam

# Align paired-end reads
bowtie2 -x $REF -1 reads/reads_1.fq -2 reads/reads_2.fq -S eg2.sam

# Align the long reads to the reference genome using local alignment
bowtie2 --local -x $REF -U reads/longreads.fq -S eg3.sam

# Downstream tools
# Use samtools to explore alignments

# Samtools: convert SAM to BAM
samtools view eg2.sam -o eg2.bam

# Samtools: sort
samtools sort eg2.sam -o eg2.sorted.bam

# Generate variant calls in the VCF format
bcftools mpileup -f $REF_FASTA eg2.sorted.bam | \
bcftools call -m -v -Ob -o eg2.bcf -

# Add: convert bcf file to uncompressed vcf
bcftools convert  eg2.bcf -Ov -o eg2.vcf

echo DONE

The file bt2.sub below could then be used to submit the job within an HTCondor Linux system with command condor_submit

universe =  Docker
# docker_image  = staphb/bowtie2:2.5.1
# My version contains bcftools
docker_image = jysgro/bowtie2:sam115_bcf118

executable =  bt2.sh
transfer_input_files = bt2.sh

should_transfer_files   = YES
when_to_transfer_output = ON_EXIT

request_memory = 20GB
request_disk = 20GB
request_cpus = 1

jobName = bt2_sam_bcf
batch_name = m2GB_d2GB_1cpu
log = $(batch_name)_$(jobName)_$(Process).condorlog
error = $(batch_name)_$(jobName)_$(Process).condorerr
output = $(batch_name)_$(jobName)_$(Process).condorout

queue 1

Tag summary

Content type

Image

Digest

sha256:ff76502a4…

Size

289.3 MB

Last updated

almost 3 years ago

docker pull jysgro/bowtie2:sam115_bcf118