Header Leaderboard Ad

Collapse

gsnap produces more reads than fastq

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • gsnap produces more reads than fastq

    hello, i am running gsnap with rna seq data against a reference genome:

    gsnap -m 10 -B 5 -t 8 -A sam -d GENOME seqs.fastq > res.sam

    but strangely, the output sam file contains more reads than the original fastq files:

    $ cat seqs.fastq | echo $((`wc -l`/4))
    3776979

    $ cat res.sam | grep -v '^ *@' | wc -l
    6009141



    and I don't understand what that means....

    thank you

  • #2
    I'm not familiar with gsnap but it seems like there could be a few factors, the most likely one being your grep command. When I try to find out how many alignments have been reported I use the command:
    Code:
    cut -f1 out.sam | sort | uniq | wc -l
    That way you don't count nonspecific alignments. That being said, your SAM file may contain multiple alignments for many reads. There should be a flag to control how many alignments per read are reported but if not there are ways around it. I hop this helps!

    Comment


    • #3
      Originally posted by twaddlac View Post
      I'm not familiar with gsnap but it seems like there could be a few factors, the most likely one being your grep command. When I try to find out how many alignments have been reported I use the command:
      Code:
      cut -f1 out.sam | sort | uniq | wc -l
      That way you don't count nonspecific alignments. That being said, your SAM file may contain multiple alignments for many reads. There should be a flag to control how many alignments per read are reported but if not there are ways around it. I hop this helps!
      Besides mapping to multiple locations, the sam file also has a header that can contain many lines and throw off your count.

      Comment


      • #4
        Originally posted by severin View Post
        Besides mapping to multiple locations, the sam file also has a header that can contain many lines and throw off your count.
        I forgot to mention, to omit the header lines you should do
        Code:
        grep -v '^@' out.sam | cut -f1 | sort | uniq | wc -l
        If you convert your SAM file to BAM you will:
        A) reduce the size of the file (BAM < SAM)
        B) view the alignment output without the headers
        Code:
        samtools view out.bam
        To convert the sam file to bam, just do
        Code:
        samtools view -bS out.sam > out.bam

        Comment


        • #5
          If a read is aligned to multiple location, it appears multiple times in the SAm file. Sort the file by read name, cut to the first coulmn (read name), pipe it through 'uniq', then count again.

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Targeted Sequencing: Choosing Between Hybridization Capture and Amplicon Sequencing
            by seqadmin




            Targeted sequencing is an effective way to sequence and analyze specific genomic regions of interest. This method enables researchers to focus their efforts on their desired targets, as opposed to other methods like whole genome sequencing that involve the sequencing of total DNA. Utilizing targeted sequencing is an attractive option for many researchers because it is often faster, more cost-effective, and only generates applicable data. While there are many approaches...
            03-10-2023, 05:31 AM
          • seqadmin
            Expert Advice on Automating Your Library Preparations
            by seqadmin



            Using automation to prepare sequencing libraries isn’t a new concept, and most researchers are aware that there are numerous benefits to automating this process. However, many labs are still hesitant to switch to automation and often believe that it’s not suitable for their lab. To combat these concerns, we’ll cover some of the key advantages, review the most important considerations, and get real-world advice from automation experts to remove any lingering anxieties....
            02-21-2023, 02:14 PM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 03-17-2023, 12:32 PM
          0 responses
          7 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 03-15-2023, 12:42 PM
          0 responses
          17 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 03-09-2023, 10:17 AM
          0 responses
          66 views
          1 like
          Last Post seqadmin  
          Started by seqadmin, 03-03-2023, 12:03 PM
          0 responses
          64 views
          0 likes
          Last Post seqadmin  
          Working...
          X