Header Leaderboard Ad

Collapse

how to extract unique hits from a sam file

Collapse

Announcement

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

  • how to extract unique hits from a sam file

    I aligned reads with bwa and I want to get a set of the reads that mapped uniquely to the genome.
    I understood from samtools faq that they suggest to look at 'reliable' rather than `unique' by :

    samtools view -bq 1 aln.bam > aln-reliable.bam

    http://sourceforge.net/apps/mediawik...?title=SAM_FAQ

    However, I am interested to get the subset of the uniquely mapped reads, in order to do some calculations on it.

    How can one do it?

  • #2
    Take a look to this thread.

    I'd suggest you follow bwa's FAQ advice and rely more in the MAPQ. Still, if you want to
    filter uniquely mapped:

    Code:
    $ samtools view bwa.bam | grep "XT:A:U"
    -drd

    Comment


    • #3
      Thanks a lot!

      Comment


      • #4
        Hi,
        I am also looking for such solution. But in my bam file, I don't see any
        Code:
        XT:A:U
        instead its a SOLEXA single read where I have converted export to sam format as below.



        Code:
        test_1:8:69:19633:9434       0       chr10   5423197 4       45M     *       0       0       CACACAACCCCCACACCAAACACACACCCCCCACACACAACAAAC      0.2B90+)*[email protected]@################################   XD:Z:6C11C15G4CACT2     SM:i:4
        test_1:8:56:11474:20981      0       chr10   7323903 6       45M     *       0       0       ATCAAGCGATCCTCCCACCTCATCCCCCTAAGTACCTGTGACTAA      [email protected];3;[email protected]@@@@[email protected]###########################   XD:Z:22G11G3G5C SM:i:6
        Any generic way of picking unique hits from sam file? Thanks.

        Comment


        • #5
          I am not an expert, but don't think you can extract this from the _export file. I think XT:A:U is specific to bwa (maybe also other aligners?).

          Maybe you would like to use the _sorted file from the Illumina pipeline:
          the desciption of the _sorted file- from CASAVA 1.7 manual p. 73:
          This output file is similar to s_N_export.txt, except it contains
          only entries for reads which pass purity filtering and have a
          unique alignment in the reference. These are sorted by order
          of their alignment position, which is meant to facilitate the
          extraction of ranges of reads for purposes of visualization or
          SNP calling.
          These files are only produced if the flag WITH_SORTED is
          used."

          Alternatively, you can take your reads and align them with bwa (or with other aligner that gives you this info).

          Comment


          • #6
            hello all,
            I have Illumina data, which I mapped through Bowtie2 and got a sam file.

            Now I need to extract the reads which are being shown uniquely one time.

            Kindly guide if something could be done for that.

            I have tried a bit of commands for the above, but failed to get those reads separated.

            Kindly guide ASAP.

            Comment


            • #7
              Originally posted by emp View Post
              hello all,
              I have Illumina data, which I mapped through Bowtie2 and got a sam file.

              Now I need to extract the reads which are being shown uniquely one time.

              Kindly guide if something could be done for that.

              I have tried a bit of commands for the above, but failed to get those reads separated.

              Kindly guide ASAP.
              How about just use bowtie with the -m 1 option set?

              Comment


              • #8
                hello Wallysb01,

                after searching a lot for Bowtie2 to get uniquely matched reads, I think bowtie 1 is the only way out.

                thanku for the same.

                Comment


                • #9
                  Unique alignments in bowtie2 have MAPQ>=2, so you can just filter the results by that.

                  Comment

                  Latest Articles

                  Collapse

                  • seqadmin
                    Improved Targeted Sequencing: A Comprehensive Guide to Amplicon Sequencing
                    by seqadmin



                    Amplicon sequencing is a targeted approach that allows researchers to investigate specific regions of the genome. This technique is routinely used in applications such as variant identification, clinical research, and infectious disease surveillance. The amplicon sequencing process begins by designing primers that flank the regions of interest. The DNA sequences are then amplified through PCR (typically multiplex PCR) to produce amplicons complementary to the targets. RNA targets...
                    03-21-2023, 01:49 PM
                  • 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

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by seqadmin, Yesterday, 11:44 AM
                  0 responses
                  8 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 03-24-2023, 02:45 PM
                  0 responses
                  18 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 03-22-2023, 12:26 PM
                  0 responses
                  18 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 03-17-2023, 12:32 PM
                  0 responses
                  19 views
                  0 likes
                  Last Post seqadmin  
                  Working...
                  X