Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • HTSeq not working with Bowtie2 .SAM

    Hi all,

    I am having a weird problem with my Bowtie2 .SAM output for use with HTseq to count reads that correspond to genes in a .gff file.

    Usually, I can just feed my Bowtie1 .SAM into HTseq using the following command:

    htseq-count -m union -s no -t gene -i ID -o myOutput.sam myInput.sam organism.gff


    However, after switching to Bowtie2 and running the same command, I get gigabytes of this:


    Warning: Read HWI-ST1234:350WK3ACXX:6:1101:1780:2126/1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
    Warning: Read HWI-ST1234:350WK3ACXX:6:1101:1780:2126/2 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
    Warning: Read HWI-ST1234:350WK3ACXX:6:1101:1671:2238/1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
    Warning: Read HWI-ST1234:350WK3ACXX:6:1101:1671:2238/2 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
    Warning: Read HWI-ST1234:350WK3ACXX:6:1101:2011:2134/1 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)
    Warning: Read HWI-ST1234:350WK3ACXX:6:1101:2011:2134/2 claims to have an aligned mate which could not be found. (Is the SAM file properly sorted?)


    According to other forums, this usually happens when the SAM isn't sorted by read ID, so that htseq can't find the two halves of a paired-end read. However, I tried sorting my SAM in multiple ways, such as:

    sort -k1 myfile.sam > myfile_sorted.sam


    I still get the same error! Any help or suggestions are greatly appreciated

  • #2
    If any of those reads are multimapped, then using the command line sort command will not do what you want. Use samtools sort -n

    Comment


    • #3
      @dpryan,

      Thanks for the reply, but can you please explain your answer? How does the samtools sort command differ than unix sort?

      Also, since Bowtie2 produces a SAM file by default, to use SAMtools sort, do I have to first convert to BAM, then sort, then convert back to SAM?

      Thanks...

      Comment


      • #4
        The problem is the /1 and /2 in your read names. The SAM specification indicates that the names of paired reads be identical. SAM identifies read 1 or read 2 by the FLAG bits. Remove the /1 & /2 from the names in your SAM files and repeat your analysis.

        Comment


        • #5
          @kmcarr

          Wonderful, I trimmed the /1 and /2 off my reads and made sure the mates were next to each other after sorting, and HTSEQ runs fine without the previous error messages.

          Quick question...
          After processing a few thousands reads, HTSEQ reports the following error:

          Warning: Malformed SAM line: MRNM != '*' although flag bit &0x0008 set
          Warning: Malformed SAM line: RNAME != '*' although flag bit &0x0004 set

          This is from raw Bowtie2 output; the only modifications were my /1 and /2 trimming and sorting.

          Anyone have an idea where these errors are coming from??

          Thanks!

          Comment


          • #6
            RNAME and MRNM are the name of the chromosome (or scaffold or whatever) to which the current read and its mate (for MRNM) map. Since the flags indicate that the reads are unmapped, it's just complaining that there's stuff here instead of an *, meaning "Not available". I don't recall ever seeing that with bowtie2, only bwa. You can normally ignore such warnings.

            Comment


            • #7
              @dpryan,

              Thanks for all your help. My analysis is working well now

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Best Practices for Single-Cell Sequencing Analysis
                by seqadmin



                While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
                06-06-2024, 07:15 AM
              • seqadmin
                Latest Developments in Precision Medicine
                by seqadmin



                Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

                Somatic Genomics
                “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
                05-24-2024, 01:16 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, Today, 07:49 AM
              0 responses
              12 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, Yesterday, 07:23 AM
              0 responses
              14 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 06-17-2024, 06:54 AM
              0 responses
              16 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 06-14-2024, 07:24 AM
              0 responses
              24 views
              0 likes
              Last Post seqadmin  
              Working...
              X