Merging Sequencing Runs

If you have multiple sequencing runs, you’ll want to merge your reads into one single set of data for analysis.

We need an alignment contig, the fastq files, and a modified version of the script. - cp final_contigs_300.fasta ~/projects/rana_rapture/fastq/ - Get ~/scripts/ or ~/scripts/

Make bam lists from Newest Sequence Data

Create a bamlist of the A and B .fastq files.

  • ls *RA* | sed "s/\.fastq//g" > bamlistA
  • ls *RB* | sed "s/\.fastq//g" > bamlistB
  • paste bamlist? > bamlist

Create the index for bwa to work from alignment (if not already completed) - bwa index -a is final_contigs_300.fasta

Aligning before Merge

Time: (~3-4 hours)

Because we are merging files, we need to do the filtering and merge BEFORE we remove dups… so need to modify the script. The 01a version essentially just stops before running the remove duplicates step.

Run the script:

  • sh bamlist final_contigs_300.fasta

NOTE: (If already aligned)

If you’ve already aligned previously, you can use the 01b script to pick up the sorted bamfiles and just filter, then use that output for the merge. (use script: Notice you don’t need the contig alignment here.

  • sh bamlist.flt

If there are node failures, you’ll need to use du -hs to verify.

  • du -hs *flt2.bam | sort -hs | head -n50