This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Use bowtie2 to assess the trinity assembly results, getting a strange results.

After using Trinity (V 2.1.1) to assembly, I want to assess the quality of it. Then, I use bowtie2, mapping the reads back to the transcriptome assembled by Trinity. First, I use the bowtie2-build to build the reference. The order is like this :

bowtie2-build Fa_trinity_out.Trinity.fasta ./Fa_transcriptome.fasta --threads 4

Fa_trinity_out.Trinity.fasta is the result of Trinity.

Then, use bowtie2 to align, the command is like this:

bowtie2 -p 10 -q --no-unal -k 20 -x Fa_transcriptome.fasta -1 ./Fa_1.clean.fq -2 ./Fa_2.clean.fq > Fa_bowtie2_stats.txt | samtools view -Sb -o 2_F3r_bowtie2.bam

During all these process, there is no error report, I get the final .bam file successfully. However, the .bam file is too small, just 63.Then,I try to use "samtools flagstat" to view the results, there is nothing, It's like this:

 0 + 0 in total (QC-passed reads + QC-failed reads) 
 0 + 0 secondary 
 0 + 0 supplementary 
 0 + 0 duplicates 
 0 + 0 mapped (N/A : N/A) 
 0 + 0 paired in sequencing 
 0 + 0 read1 
 0 + 0 read2 
 0 + 0 properly paired (N/A : N/A) 
 0 + 0 with itself and mate mapped 
 0 + 0 singletons (N/A : N/A) 
 0 + 0 with mate mapped to a different chr 
 0 + 0 with mate mapped to a different chr (mapQ>=5)

SO,I wonder is there any mistake in my commands that result in these? OR other reasons? Thank you!!!

rna-seq assembly

1 answer

Bowtie2, by default, outputs to stdout in SAM format, but you are redirecting stdout to a file: > Fa_bowtie2_stats.txt. Check if the file Fa_bowtie2_stats.txt is really a SAM file with:

samtools view Fa_bowtie2_stats.txt | head

Edit: sorry, to me more clear, what you need is to modify the mapping command to:

bowtie2 -p 10 -q --no-unal -k 20 -x Fa_transcriptome.fasta \
    -1 ./Fa_1.clean.fq -2 ./Fa_2.clean.fq \
  | samtools view -Sb -o 2_F3r_bowtie2.bam

If you want the stats redirected to a file, you need to redirect stderr (2>), not stdout (>):

bowtie2 -p 10 -q --no-unal -k 20 -x Fa_transcriptome.fasta \
    -1 ./Fa_1.clean.fq -2 ./Fa_2.clean.fq 2> Fa_bowtie2_stats.txt \
  | samtools view -Sb -o 2_F3r_bowtie2.bam
A00881:450:HK3HYDSXY:2:1101:16975:1016 163 TRINITY_DN148969_c0_g3_i1 560 255 150M = 605 195 CTGGGATATGCCACACAAGACAACCGAGAAGCACTGGCCGAGTACTCCCAAGAACACCAGTCAGCAATCAAACCGAAGGTCACCTTCCTCTCCAAGATTAAGTCCACAGTCGATCAAAACCACCAACTGGATGCACAAATCCCCGATTCC FFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,FFFFFFFFFFFFFFFFFF,FFFFFFFFFFFFFFFFFFFFFFFFF:FFF,FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:150 YS:i:0 YT:Z:CP

Thanks for your advice first! When I use this commands, the result is like this. So, is this abnormal?

I have edited my answer to provide clearer instructions.

Log in to answer this question.