Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • rodney
    Junior Member
    • Sep 2009
    • 1

    samtools tview reference sequence

    Does anyone else know how to get samtools tview to display the reference sequence at the top? I only see a string of N where I think the reference sequence should be.
    Attached Files
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    Originally posted by rodney View Post
    Does anyone else know how to get samtools tview to display the reference sequence at the top? I only see a string of N where I think the reference sequence should be.
    Add in the reference after the BAM file in the command line.

    Comment

    • Mansequencer
      Member
      • Jul 2010
      • 16

      #3
      Hi Rodney and Nilshomer,
      I have a similar problem. I do add my reference fasta file after the BAM file but all I see are the Ns. I dont even see the reads that have aligned.
      Any suggestions?
      Thanks guys.

      Comment

      • nilshomer
        Nils Homer
        • Nov 2008
        • 1283

        #4
        Originally posted by Mansequencer View Post
        Hi Rodney and Nilshomer,
        I have a similar problem. I do add my reference fasta file after the BAM file but all I see are the Ns. I dont even see the reads that have aligned.
        Any suggestions?
        Thanks guys.
        Please give us what you typed into your command line.

        Comment

        • Mansequencer
          Member
          • Jul 2010
          • 16

          #5
          Here is the command:
          samtools tview file.sort.bam reference.folded.fas

          Comment

          • nntao
            Junior Member
            • Jan 2010
            • 4

            #6
            samtools tview issue

            I have several issues with "samtools tview":
            g : goto position, allows me to type a number, but not going anywhere
            b : won't toggle

            anyone has similar problem, and solutions

            Comment

            • nilshomer
              Nils Homer
              • Nov 2008
              • 1283

              #7
              Originally posted by nntao View Post
              I have several issues with "samtools tview":
              g : goto position, allows me to type a number, but not going anywhere
              b : won't toggle

              anyone has similar problem, and solutions
              Enter the chromosome name and position (even if there is only one chromosome). For example "chr1:1000" (no quotes).

              Comment

              • naluru
                Member
                • Jul 2010
                • 16

                #8
                samtools tview

                Hello,

                I am having similar problem as mentioned here earlier. I have a string of N's in the reference genome, when I use the samtools tview command.Only the first 80 bases are present and remaining are all NNNNNN's. I tried using g option and tried different chromosome numbers. Still I have only N's.

                Any help will be highly appreciated.

                Here is the command I gave:

                samtools tview MH_0001alignedreadssorted.bam danRer6.fa

                Comment

                • epigen
                  Senior Member
                  • May 2010
                  • 101

                  #9
                  If your reference sequence is correct and indexed, as well as you BAM file, you should see the reference sequence where reads aligned. I noted that if there are no reads for a long stretch of bases, tview doesn't bother to show the reference, it shows only Ns. When I checked with another BAM file that had reads at that location, everything was OK. Before I thought the fasta file was currupted - which might very well be a reason for only seeing Ns.

                  Comment

                  • tonge
                    Junior Member
                    • Mar 2011
                    • 5

                    #10
                    Retracted message
                    Last edited by tonge; 04-19-2011, 08:47 AM. Reason: I found the correct answer, my mistake

                    Comment

                    • qtrinh
                      Member
                      • May 2008
                      • 20

                      #11
                      Did you use 'danRer6.fa' in your alignment step? I think the issue here is that the reference used in the alignment step is not the same as 'danRer6.fa'


                      Originally posted by naluru View Post
                      Hello,

                      I am having similar problem as mentioned here earlier. I have a string of N's in the reference genome, when I use the samtools tview command.Only the first 80 bases are present and remaining are all NNNNNN's. I tried using g option and tried different chromosome numbers. Still I have only N's.

                      Any help will be highly appreciated.

                      Here is the command I gave:

                      samtools tview MH_0001alignedreadssorted.bam danRer6.fa

                      Comment

                      • swbarnes2
                        Senior Member
                        • May 2008
                        • 910

                        #12
                        It's probably not a problem with tview, you can get the same issue in mpileup. Double-check that the names in your reference file are exactly the same as in your .sam file, or that there aren't any odd characters that might be confusing things.

                        Comment

                        • VeBeKay
                          Junior Member
                          • Jul 2010
                          • 5

                          #13
                          For me, it was a colon ":" in my chromosome name for the reference sequence. When I deleted the colon, the actual sequence showed up (before that it was only N's).

                          Comment

                          • Tally
                            Member
                            • Aug 2011
                            • 12

                            #14
                            Thank you VeBeKay!! That solved my problem perfectly :-) However I had to delete it in the reference AND rerun the alignment and subsequent steps, time-consuming but 100% effective.
                            I am surprised this was an issue, as the fasta reference was created using samtools faidx region command, which utilises a semi-colon to define the region. I tried faidx region extract with no semi-colon, and this does not give the correct output. Does anyone know of how to use faidx to extract regions to a multi-fasta which does not have semi-colons in the output files? It seems silly to require them for faidx yet malfunction over them in tview.

                            Comment

                            • HeidiJTP
                              Member
                              • Nov 2011
                              • 22

                              #15
                              I am also having this problem, where the first 80 bases are present, then mostly Ns except in a few positions where aligned reads appear. I am just running a test set to try to learn the process, so I took a reference sequence and fragmented it into 500 bp segments with 50 bp overlaps, then aligned the fragments (short_reads.fas) back to the reference.fas. Thus, the full reference should have fragments aligned to it. Here are the commands I used:

                              $ bwa index reference.fas
                              $ bwa aln reference.fas short_reads.fas >short_reads.sai
                              $ bwa samse reference.fas short_reads.sai short_reads.fas >short_reads.sam
                              $ samtools faidx reference.fas
                              $ samtools import reference.fas.fai short_reads.sam short_reads.bam
                              $ samtools sort short_reads.bam short_reads.srt
                              $ samtools index short_reads.srt.bam
                              $ samtools tview short_reads.srt.bam reference.fas

                              I made sure that there were no colons in any sequence titles, but I am not sure I have used all the commands correctly. I would really appreciate any help!

                              Comment

                              Latest Articles

                              Collapse

                              • SEQadmin2
                                From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                                by SEQadmin2


                                Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                                The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                                ...
                                Yesterday, 10:05 AM
                              • SEQadmin2
                                Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
                                by SEQadmin2


                                With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


                                Introduction

                                Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
                                05-22-2026, 06:42 AM
                              • SEQadmin2
                                Environmental Genomics in the Age of NGS: From Microbes to Conservation Strategies
                                by SEQadmin2

                                Studying ecosystems means dealing with complex, multi-species communities that are hard to observe at scale. This complexity, however, hides many important questions to be answered, from how biogeochemical cycles work and how climate change can affect species distribution to how conservation strategies can work best.


                                Genomics, particularly since the expansion of NGS, has transformed ecosystem ecology. By sequencing environmental DNA, we can now assess biodiversity without direct...
                                05-06-2026, 09:04 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, Yesterday, 12:03 PM
                              0 responses
                              17 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, Yesterday, 11:40 AM
                              0 responses
                              13 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 05-28-2026, 11:40 AM
                              0 responses
                              29 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 05-26-2026, 10:12 AM
                              0 responses
                              31 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...