Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • genome
    Junior Member
    • Nov 2010
    • 3

    bowtie - invalid CIGAR string - wrong sam format

    Hi,

    I am trying to align short reads from Illumina with different aligners.

    I have used the same .fq files to align with BWA, Bowtie and Maq.

    BWA and Maq align without errors and give me the expected output files in the right format.

    But when I use the same fq and reference files to align with Bowtie, I get the following:

    My Command:

    bowtie --chunkmbs 100 -p 2 -X 500 prefixDB -1 /path/to/file/file_1.fq -2 /path/to/file/file_2.fq result.sam

    Result:

    # reads processed: xxx
    # reads with at least one reported alignment: yyy (57.06%)
    # reads that failed to align: zzz (42.94%)
    Reported aaa paired-end alignments to 1 output stream(s)

    So that looks alright, but when I tried converting the resultant sam file to bam:

    samtools view -bS -o result.bam result.sam

    I get:

    [samopen] no @SQ lines in the header.
    [sam_read1] missing header? Abort!

    So I indexted the reference.fasta file and tried:

    samtools view -bt ref.fasta.fai result.sam > result.bam

    I get:

    [sam_header_read2] 1 sequences loaded.
    Parse error at line 1: invalid CIGAR character
    Aborted

    Now this is the first line of result.sam (the file I am trying to convert to bam)

    SRR034509.174/1 + NC_000913.2 1272036 GCACCACAGGCGTCGCCTATCGACTGCCAGAAGAGACGCTGGAGCAGGAACTAACCCTGTTGTGGAAGCGAGAGATGATTAATGGCTGTGTTTGTTTATCA IIII;III>-8II*II.IIIIII@II@:I.IIIIII567II?EI);>>DI,I?H0&7F8AB=*&.;F5';E.(0)2,?,44%$)%!&%#$&"$#$##%!#" 0 81:C>A,82:C>T,89:T>G,90:A>T,92:C>T,93:T>G,94:G>T,95:C>T,96:C>T,98:A>T,100:C>A

    All lines follow the same format, which I realize doesn't look the a typical .sam file format (it has missing fields) and I am wondering where I have gone wrong, and how I can correct this.

    Things to note:

    - I am running the latest bowtie and samtools version
    - My bowtie-build command on the reference.fasta has given me the right files as I have used them to align other .fq reads.
    - As mentioned previously, BWA and Maq worked fine with the same data so its very likely nothing is wrong with that.

    Thanks
  • swbarnes2
    Senior Member
    • May 2008
    • 910

    #2
    That's not a .sam file. It's Bowtie native format. You need to add -S or --sam to the command line make the output .sam format.

    The "+" is the giveaway. SAM output has the bitwise flag, which is a number, in the second column of the output.

    Comment

    • genome
      Junior Member
      • Nov 2010
      • 3

      #3
      Originally posted by swbarnes2 View Post
      That's not a .sam file. It's Bowtie native format. You need to add -S or --sam to the command line make the output .sam format.

      The "+" is the giveaway. SAM output has the bitwise flag, which is a number, in the second column of the output.
      :P thanku!

      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, Yesterday, 12:17 PM
      0 responses
      14 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-23-2026, 11:41 AM
      0 responses
      15 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-20-2026, 11:10 AM
      0 responses
      23 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 07-13-2026, 10:26 AM
      0 responses
      37 views
      0 reactions
      Last Post SEQadmin2  
      Working...