Raw next-generation-sequencing (NGS) data is often shipped in unaligned BAM format, whereas most mappers expect input data in FASTQ format. I’ve written a little bash script that does the preprocessing job for paired-end data: Convert raw reads to FASTQ with bam2fastq, trim adapters with cutadapt and perform quality control checks with FastQC.