Question: Unmapped reads in BLAT output ( psl file )
gravatar for syrup16g_TO
5.6 years ago by
syrup16g_TO40 wrote:


Please tell me about unmapped reads in BLAT run.

If reads are not mapped to reference sequence by BLAT, what is written in output psl file?

How do I extract unmapped reads?

Thank you very much.

blat alignment • 2.1k views
ADD COMMENTlink modified 5.6 years ago by Prakki Rama2.4k • written 5.6 years ago by syrup16g_TO40
gravatar for Prakki Rama
5.6 years ago by
Prakki Rama2.4k
Prakki Rama2.4k wrote:

I think there is no straight forward option in BLAT to collect unmapped reads. May be you can try this.

  1. Collect your mapped reads using cut command first.

    cut -d "       " -f 10 output.psl | sort -u >mapped_header.txt ## 10 here is my mapped read column.
  2. Now collect all your all read headers.

    LC_ALL=C fgrep ':N:' sample.fastq >all_header.txt 

    I used this pattern ":N:" because it is present in all my headers. If your read also has similar pattern you can probably use this or use something common in all the reads like "@HISEQ" or "@HWI" etc

  3. Now collect those headers which are unmapped using following command.

    awk 'NR==FNR{a[$0];next}!($0 in a)' mapped_header.txt all_header.txt >unmapped.txt
  4. Now grep those reads from the original fastq file.

    LC_ALL=C grep -A 3 -F -f unmapped.txt sample.fastq >unmapped.fastq

Since, we are searching for fixed strings, the LC_ALL grep would not take too much time.

ADD COMMENTlink modified 14 days ago by RamRS25k • written 5.6 years ago by Prakki Rama2.4k
Please log in to add an answer.


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