Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Tally
    Member
    • Aug 2011
    • 12

    #16
    When importing sam to bam, I use 'view' rather than 'import' :

    @SQ header lines present in SAM file:
    samtools view –bS alignment.sam > alignment.bam

    @SQ header lines absent from SAM file:
    samtools view –bt reference.fasta.fai alignment.sam > alignment.bam

    Not sure if that will help at all but might be worth a try
    Good luck

    Comment

    • HeidiJTP
      Member
      • Nov 2011
      • 22

      #17
      Thanks for the suggestion Tally, I just reran everything and used the command view instead of import, but still no luck

      Comment

      • HeidiJTP
        Member
        • Nov 2011
        • 22

        #18
        I think there are two problems here:

        1) Display of NNNNs instead of sequence
        This seems to be related in part to the actual terminal window. I thought it was weird that the NNNs don't appear until exactly after I start scrolling across the terminal. If I resize the terminal before running the 'tview' command, the position where the NNNs begin also changes. It may not be important, as according to mpileup output the NNNs are only occurring in between aligned regions.

        2) Incomplete alignment
        My fault!!! Helps when you use the correct reference sequence...
        Last edited by HeidiJTP; 01-24-2012, 10:44 AM.

        Comment

        • sudeep
          Junior Member
          • Feb 2012
          • 2

          #19
          Originally posted by HeidiJTP View Post
          I think there are two problems here:

          1) Display of NNNNs instead of sequence
          This seems to be related in part to the actual terminal window. I thought it was weird that the NNNs don't appear until exactly after I start scrolling across the terminal. If I resize the terminal before running the 'tview' command, the position where the NNNs begin also changes. It may not be important, as according to mpileup output the NNNs are only occurring in between aligned regions.
          I am also facing this problem. Does anybody know what is the work around ?

          Comment

          • Crypticfortune
            Member
            • Jul 2011
            • 14

            #20
            Originally posted by sudeep View Post
            I am also facing this problem. Does anybody know what is the work around?
            To summarize, I think there's 3 main problems that trip up users:
            1. Forgot to specify the reference on the command line (eg. "samtools tview foo.bam" => "samtool tview foo.bam foo.fa")
            2. Fasta file has different names for sequences. This is painful to fix, but you'll have to either rewrite all the sequence names (e.g. ">chr1" lines in foo.fa) to match the bam file sequence names, or rewrite the sequence references in the SAM/BAM file. The former's probably easier, but definitely the "right" way to go is to use the same fasta files when building the alignment to begin with
            3. Corrupt fasta files? I can't confirm this, but I suspect samtools might choke on reading FASTA files with dos/windows CR/LF linebreak codes (shows up as ^M in unix terminals a lot). This would explain HeidiJTP and naluru's 80 character problem (as 80 characters per line is common). You can normalize your dos/windows ASCII files to unix with the dos2unix command (e.g. dos2unix foo.fa).


            Also, it may not be what you're looking for if you care about the reference outside of mapped areas, but as an alternative, Samscope infers and displays the reference from BAM data alone (MD + CIGAR tags) without relying on FASTA reference files.

            Comment

            • kristina.gagalova
              Junior Member
              • Apr 2016
              • 3

              #21
              I have solved this issue with renaming the fai (fasta index file). I had FileName.fa.fai and rename it FileName.fai. I think the program expects it like that.

              Comment

              Latest Articles

              Collapse

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 06-09-2026, 11:58 AM
              0 responses
              17 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-05-2026, 10:09 AM
              0 responses
              27 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-04-2026, 08:59 AM
              0 responses
              38 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 06-02-2026, 12:03 PM
              0 responses
              61 views
              0 reactions
              Last Post SEQadmin2  
              Working...