12. Coding solutions

12.1. QC

12.1.1. Code: FastQC

Create directory:

mkdir trimmed-fastqc

Run FastQC:

fastqc -o trimmed-fastqc trimmed/ancestor-R1.fastq.trimmed.gz trimmed/ancestor-R2.fastq.trimmed.gz trimmed/evolved-6-R1.fastq.trimmed.gz trimmed/evolved-6-R2.fastq.trimmed.gz

Open html webpages:

firefox trimmed-fastqc/\*.html

12.1.2. Code: SolexaQA++ trimming

Create directory for result-files:

mkdir trimmed

Run SolexaQA++:

./SolexaQA++ dynamictrim -p 0.01 -d trimmed/ data/ancestor-R1.fastq.gz

./SolexaQA++ dynamictrim -p 0.01 -d trimmed/ data/ancestor-R2.fastq.gz

./SolexaQA++ dynamictrim -p 0.01 -d trimmed/ data/evolved-6-R1.fastq.gz

./SolexaQA++ dynamictrim -p 0.01 -d trimmed/ data/evolved-6-R2.fastq.gz

12.1.3. Code: SolexaQA++ qc

Create directory for result-files:

mkdir trimmed-solexaqa/

Run SolexaQA++:

./SolexaQA++ analysis -d trimmed-solexaqa trimmed/ancestor-R1.fastq.trimmed.gz

./SolexaQA++ analysis -d trimmed-solexaqa trimmed/ancestor-R2.fastq.trimmed.gz

./SolexaQA++ analysis -d trimmed-solexaqa trimmed/evolved-6-R1.fastq.trimmed.gz

./SolexaQA++ analysis -d trimmed-solexaqa trimmed/evolved-6-R2.fastq.trimmed.gz

12.2. Assembly

12.2.1. Code: SPAdes assembly (trimmed data)

spades.py -o assembly/spades-150/ -k 21,33,55,77 --careful -1 trimmed/ancestor-R1.fastq.trimmed.gz -2 trimmed/ancestor-R2.fastq.trimmed.gz

12.2.2. Code: SPAdes assembly (original data)

spades.py -o assembly/spades-original/ -k 21,33,55,77 --careful -1 data/ancestor-R1.fastq.gz -2 data/ancestor-R2.fastq.gz

12.3. Mapping

12.3.1. Code: Bowtie2 indexing

Build the index:

bowtie2-build assembly/spades-final/scaffolds.fasta assembly/spades-final/scaffolds

12.3.2. Code: Bowtie2 mapping

Map to the genome. Use a max fragemnt length of 1000 bp:

bowtie2 -X 1000 -x assembly/spades-final/scaffolds -1 trimmed/evolved-6-R1.fastq.trimmed.gz -2 trimmed/evolved-6-R2.fastq.trimmed.gz -S mappings/evolved-6.sam

12.3.3. Code: BWA indexing

Index the genome assembly:

bwa index assembly/spades-final/scaffolds.fasta

12.3.4. Code: BWA mapping

Run bwa mem:

bwa mem assembly/spades-final/scaffolds.fasta trimmed/evolved-6-R1.fastq.trimmed.gz trimmed/evolved-6-R2.fastq.trimmed.gz > mappings/evolved-6.sam