Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kostask
    Junior Member
    • Sep 2015
    • 8

    extract_only_concordant_paired_reads_from_bam_file

    Hi everyone,

    I am trying to extract only concordant paired reads from my bam file using a command that I found in posts with similar subject:







    However the command that I use:

    samtools view -b -f 0x2 accepted_hits.bam -o accepted_hits_conc.bam

    results to the production of the accepted_hits_conc.bam file, which is much smaller than expected.

    Specifically the original accepted_hits.bam file has size 1.4 Gb while the accepted_hits_conc.bam has size only 141 Mb.

    Also by running samtools I get:

    samtools view -c accepted_hits.bam
    34745648

    samtools view -c accepted_hits_conc.bam
    3188162

    Now what troubles me is that the align_summary.txt returned by tophat2 reports:

    Left reads:
    Input : 18363154
    Mapped : 17461735 (95.1% of input)
    of these: 1424801 ( 8.2%) have multiple alignments (1497233 have >1)
    Right reads:
    Input : 18363154
    Mapped : 17283913 (94.1% of input)
    of these: 1424801 ( 8.2%) have multiple alignments (1485742 have >1)
    94.6% overall read mapping rate.

    Aligned pairs: 16585377
    of these: 1424801 ( 8.6%) have multiple alignments
    3788640 (22.8%) are discordant alignments
    69.7% concordant pair alignment rate.

    If there are 16585377 aligned pairs from an input of 18363154 paired end reads and a 69.7% concordant pair alignment rate, why do I get so small output from samtools?

    Also I saw in other posts that using this approach is preferable to using the --no-discordant option of tophat2. But why is that?

    Shouldn't I get exactly the concordant paired reads as output, if I specify the --no-discordant and --no-mixed options in tophat2?
  • westerman
    Rick Westerman
    • Jun 2008
    • 1104

    #2
    Answering your first question about samtools. One thing you could try is to see exactly what flags you have. Try
    Code:
    samtools view accepted_hits.bam | cut -f 2 | sort | uniq -c
    That will, at least, tell you what you have in the file.

    Comment

    • kostask
      Junior Member
      • Sep 2015
      • 8

      #3
      Thank you westerman

      I saw exactly the flags and the corresponding reads for each one.

      Wouid it be correct if I wanted to extract reads with certain flags (specifically 67, 131, 115 and 179) to do so with:

      samtools view -b -f number_of_flag accepted_hits.bam -o flag_accepted_hits.bam

      and then merge them together with:

      samtools merge output_accepted_hits.bam flag1_accepted_hits.bam ...

      It may be a silly question but with the samtools merge, the reads merge or they concatenate into a single bam file?

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
        by SEQadmin2


        Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

        The systematic characterization of the human proteome has
        ...
        07-20-2026, 11:48 AM
      • SEQadmin2
        Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
        by SEQadmin2



        Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
        ...
        07-09-2026, 11:10 AM
      • SEQadmin2
        Cancer Drug Resistance: The Lingering Barrier to Rising Survival
        by SEQadmin2



        Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

        There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
        07-08-2026, 05:17 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, 07-24-2026, 12:17 PM
      0 responses
      29 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-23-2026, 11:41 AM
      0 responses
      21 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-20-2026, 11:10 AM
      0 responses
      211 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-13-2026, 10:26 AM
      0 responses
      78 views
      0 reactions
      Last Post SEQadmin2  
      Working...