Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • #16
    I also came across the 'missing header' error. I found that that when converting BAM-> SAM, I had forgotten about printing the headers. This fixed it for me:


    BAM -> SAM:
    Note : -h print header for the SAM output
    Code:
    samtools view -h in.bam > out.sam

    SAM -> BAM (even SAM produced from BWA):

    Code:
    samtools view -bS in.sam > out.bam

    Comment


    • #17
      i have the same problem...

      this is from the man samtools:
      o Import SAM to BAM when @SQ lines are present in the header:

      samtools view -bS aln.sam > aln.bam

      If @SQ lines are absent:

      samtools faidx ref.fa
      samtools view -bt ref.fa.fai aln.sam > aln.bam

      where ref.fa.fai is generated automatically by the faidx command.

      However, i don't know which ref.fa to use.
      The sam i'm trying to convert to bam, sort and index was generated by a foreign seq searching program, readscan, which uses host and pathogen ref seqs and try to map to both of them.

      the actual sam file i'm trying to convert is "ambiguous.sam" which contains reads mapped to both ref seqs.

      can somebody please explain what is going on... what are @SQ lines, why does samtools need them to convert to bam and index the file, why am i expected to provide a ref.fa ....

      its really confusing

      tnx !

      Comment


      • #18
        If you are aligning to something like the human genome, then you would usually have one @SQ line for each chromosome in the sam file header.

        If you have the sequences of the host and pathogen the reads were mapped to, you could combine them into a ref.fa file, and run samtools faidx.

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Best Practices for Single-Cell Sequencing Analysis
          by seqadmin



          While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
          Today, 07:15 AM
        • seqadmin
          Latest Developments in Precision Medicine
          by seqadmin



          Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

          Somatic Genomics
          “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
          05-24-2024, 01:16 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Today, 08:18 AM
        0 responses
        10 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, Today, 08:04 AM
        0 responses
        12 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 06-03-2024, 06:55 AM
        0 responses
        13 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-30-2024, 03:16 PM
        0 responses
        27 views
        0 likes
        Last Post seqadmin  
        Working...
        X