Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yjz0916@163.com
    Junior Member
    • May 2017
    • 3

    #1

    Problem about samtools sort and tview, Who can help me?

    Hello everyboday, I am a newbie, my sam file size is about 45,786 kB, however after I use the samtools sort command, the .bai file produced is just only 1 kb, I wander it is right. In addition, after I use the samtools tview command, the result show a line N and nothing. I don't know where the problem is, who can help me?
  • aprice67
    Member
    • Nov 2012
    • 49

    #2
    Samtools sort will produce a sorted bam file and a .bam.bai file to go with it.

    For example,
    samtools sort bam_unsorted.bam > myBam_sorted.bam

    That will make: myBam_sorted.bam and myBam_sorted.bam.bai, and the .bam.bai file will be small.

    Also consider if you want to sort by position or by name, many things require by name, especially when working with paired end data, you'd need to include the -n option in samtools sort for that.

    Good luck.

    Comment

    • yjz0916@163.com
      Junior Member
      • May 2017
      • 3

      #3
      Originally posted by aprice67 View Post
      Samtools sort will produce a sorted bam file and a .bam.bai file to go with it.

      For example,
      samtools sort bam_unsorted.bam > myBam_sorted.bam

      That will make: myBam_sorted.bam and myBam_sorted.bam.bai, and the .bam.bai file will be small.

      Also consider if you want to sort by position or by name, many things require by name, especially when working with paired end data, you'd need to include the -n option in samtools sort for that.

      Good luck.

      To: aprice67
      thank you for your reply.
      Yes, I have soted my bam file, thne made samtools index and got bai file, the bai file is just 1kb.
      after then I use the command: samtools tview sorted.bam reference.fas
      the result is as following, while not be the sequence. so I don't which step is wrong.
      Attached Files

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        It is normal for the .bai file to be small (compared to the bam file). It only contains index values that indicate where particular regions (chromosomes in this case) start in the bam files.

        Ends of chromosomes contain unsequenceable hetero-chromatin, which is represented by the N's that you are seeing. If you keep scrolling to the right or jump to a different location you should be able to see sequence/reads.

        I suggest that you give IGV a try as a graphical viewer with your reference/bam/bai files.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
          by SEQadmin2



          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
          ...
          10-14-2026, 09:55 AM
        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          09-28-2026, 10:25 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 10-22-2026, 11:13 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-22-2026, 10:48 AM
        0 responses
        20 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-15-2026, 10:52 AM
        0 responses
        38 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 10-14-2026, 05:39 AM
        0 responses
        44 views
        0 reactions
        Last Post SEQadmin2  
        Working...