This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Align paired and unpaired reads simultaneously using Bowtie2?

I have a MeatG library, which was sequenced by two times. The first time, we got unpaired reads (i.e., unpaired.fastq); while we got interlaced forward and reverse paired-end reads (i.e., interlaced-paired.fastq) for the 2nd time. Since they are from the same library, I assembled them together and got the assembled scaffolds. Now I would like to align both of them (unpaired and interlaced paired reads) simultaneously to the assembled contigs using Bowtie2 version 2.3.4.1 to get one .sam file. Can Bowtie2 do this? Any suggestions are appreciated!

I tried the following two scripts, the results for both were same. So for the first script, only the paired reads are mapped.

bowtie2 -q --phred33 --end-to-end --sensitive -p 12 -I 0 -X 2000 --no-unal -x bowtie2-db/CBIW --interleaved interlaced-paired.fastq -U unpaired.fastq | samtools view -Sb - > output.bam

bowtie2 -q --phred33 --end-to-end --sensitive -p 12 -I 0 -X 2000 --no-unal -x bowtie2-db/CBIW --interleaved interlaced-paired.fastq | samtools view -Sb - > output.bam

See the align result:

Building a SMALL index

35388893 reads; of these:

  35388893 (100.00%) were paired; of these:

11580370 (32.72%) aligned concordantly 0 times

23621928 (66.75%) aligned concordantly exactly 1 time

186595 (0.53%) aligned concordantly >1 times

11580370 pairs aligned concordantly 0 times; of these:

    101972 (0.88%) aligned discordantly 1 time

    11478398 pairs aligned 0 times concordantly or discordantly; of these:

        22956796 mates make up the pairs; of these:

            22513992 (98.07%) aligned 0 times

            432094 (1.88%) aligned exactly 1 time

            10710 (0.05%) aligned >1 times

68.19% overall alignment rate
alignment

I have forward reads that didn't require any trimming except for adapter sequence. but the reverse read file required trimming so i trimmed from 131bp to 100bp. now idk if i can align these forward 131bp and reverse 100bp reads on my reference usin bowtie2 ?

2 answers

I don't think Bowtie2 can map paired- and single-end reads simultaneously, but you can merge both mappings with samtools. BWA can map map a mix of interleaved paired reads and single reads, if you concatenate both files and keep single reads at the end.

Use samtools sort to sort each bam by position, then samtools merge to merge the sorted bams into one.

If having a sorted bam is not important, you can just use samtools cat.

Thanks. I followed your suggestions using samtools sort and merge. It works well.

Bowtie2 can map paired- and single-end reads simultaneously:

Like this:

bowtie2 -x btInd -1 13_trimmed_R1.fastq.gz -2 13_trimmed_R2.fastq.gz -U 13_unpaired_1.fastq.gz,13_unpaired_2.fastq.gz -p 12 | samtools sort -@ 12 -T temp -o 13trimmed_sorted.bam

Works for me. (bowtie2 version 2.3.2)

Like this:

bowtie2 -x btInd -1 13_trimmed_R1.fastq.gz -2 13_trimmed_R2.fastq.gz -U 13_unpaired_1.fastq.gz,13_unpaired_2.fastq.gz  -p 12 | samtools sort -@ 12 -T temp -o 13trimmed_sorted.bam

Works for me. (bowtie2 version 2.3.2)

I can confirm this works well:

bowtie2 -x $idx -1 test_1.fq -2 test_2.fq -U test_single.fq

20000 reads; of these:
  10000 (50.00%) were paired; of these:
    1362 (13.62%) aligned concordantly 0 times
    5857 (58.57%) aligned concordantly exactly 1 time
    2781 (27.81%) aligned concordantly >1 times
    ----
    1362 pairs aligned concordantly 0 times; of these:
      76 (5.58%) aligned discordantly 1 time
    ----
    1286 pairs aligned 0 times concordantly or discordantly; of these:
      2572 mates make up the pairs; of these:
        2156 (83.83%) aligned 0 times
        244 (9.49%) aligned exactly 1 time
        172 (6.69%) aligned >1 times
  10000 (50.00%) were unpaired; of these:
    1285 (12.85%) aligned 0 times
    5798 (57.98%) aligned exactly 1 time
    2917 (29.17%) aligned >1 times
88.53% overall alignment rate

Log in to answer this question.