Question: How To Make Two Mates Of Any Alignment To Be Adjacent
0
gravatar for yanhe83
5.3 years ago by
yanhe830
yanhe830 wrote:

I am dealing with some De novo RNA-seq data (paired-end). First, I assemblied the reads to contigs using Trinity. Then, I mapped the short reads to the contigs with BWA. In order to calculate the abundance of each transcript, I used RSEM software. However, this software requires the two mates of any alignment to be adjacent. Does anyone know how to do this? The problem has been disturbing me for several days. Thanks in advance.

alignment rna-seq • 3.1k views
ADD COMMENTlink modified 5.3 years ago by Devon Ryan88k • written 5.3 years ago by yanhe830

Have you read the "using an alternative aligner" part of the README and followed the link for the "convert-sam-for-rsem" page and script?

ADD REPLYlink written 5.3 years ago by Devon Ryan88k

Thanks for your relpy! Yes, I read the "using an alternative aligner" part of the README and followed the "rsem-sam-validator" and "convert-sam-for-rsem" page and script. After running "rsem-sam-validator" , I got the following message :"One of paired-end read HWUSI-EAS1588:2:1:5189:1816#CAGATC's alignment does not have two mates adjacent to each other! If you're running covert-sam-for-rsem now, this might mean the read contains duplicate alignments." Then, I run samtools sort -n for my bam file. After sorting, I run the "rsem-sam-validator"again, I got the same msg. So I was wondering the samtools sort can't make the mates adjacent. Any other ideas? Thanks!

ADD REPLYlink written 5.3 years ago by yanhe830

It's more likely that you have a chimeric read and the validator can't deal with that. Just samtools view something.bam | grep "HWUSI-EAS1588:2:1:5189:1816" and have a look at the reads. It's best to just have a look at the data when you run into problems.

ADD REPLYlink written 5.3 years ago by Devon Ryan88k

I don't know about RSEM, but you can sort so that mates are adjacent with samtools sort -n

ADD REPLYlink written 5.3 years ago by brentp22k

Thanks for your reply. I run samtools sort -n, but still got error message from RSEM saying that the two mates of alignment not adjacent. Any other ideas?

ADD REPLYlink written 5.3 years ago by yanhe830

To get pairs you could try:

samtools view -bf2 input.bam | samtools sort -n - output
ADD REPLYlink written 5.3 years ago by brentp22k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1600 users visited in the last hour