Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • lwhitmore
    Member
    • Aug 2013
    • 70

    Samtools Errors

    Hey I know there are alot of posts about samtool errors but I have yet to find a solution.

    When I run
    $ samtools view Reads.bam >reads.sam -bS
    [samopen] no @SQ lines in the header.
    [sam_read1] missing header? Abort!

    Additionally when I tried the following two options I got errors as well-bash-$samtools view -T Reference.fa Reads.bam >reads.sam -bS
    [sam_header_read2] 1 sequences loaded.
    [sam_read1] reference 'SO:unsorted' is recognized as '*'.
    Parse error at line 1: invalid CIGAR character
    Aborted

    $ samtools view -bt Reference.fa.fai Reads.bam > reads.sam
    [sam_header_read2] 1 sequences loaded.
    [sam_read1] reference 'SO:unsorted' is recognized as '*'.
    Parse error at line 1: invalid CIGAR character
    Aborted

    Additionally I tried this but the sam file cam out blank
    $ samtools view -h SRR519779test_Aligned_LW.dat.bam | awk -F'\t' 'BEGIN { dict[65] dict[147]} $2 in dict' >reads.sam

    Thanks for any help
    Leanne
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    It may be useful to add what program was used to generate your BAM files. Or were these downloaded from somewhere.

    Comment

    • lwhitmore
      Member
      • Aug 2013
      • 70

      #3
      Mosaik an IUPAC alignment program

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Does it directly produce BAM files or is there a SAM intermediate (I've never used Mosaik)? Also, which version of samtools are you using (if you just type "samtools" then it'll be near the top of the output)? For some reason samtools is seeing those as SAM files rather than BAM files, which should only happen if you supply "-S" on the command line.

        Comment

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #5
          BTW, this:
          Code:
          samtools view Reads.bam >reads.sam -bS
          doesn't make any sense as a command. I assume you actually meant:

          Code:
          samtools view -bS Reads.sam >reads.bam
          which could produce the error messages you observed if "Reads.sam" is missing a header. If that's the case, just post the first dozen or so lines of Reads.sam

          Comment

          • swbarnes2
            Senior Member
            • May 2008
            • 910

            #6
            Or, try

            Code:
            samtools view -bSh Reads.sam >reads.bam
            Assuming you do have a header in your .sam file.

            Comment

            Latest Articles

            Collapse

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 06-05-2026, 10:09 AM
            0 responses
            12 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-04-2026, 08:59 AM
            0 responses
            23 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-02-2026, 12:03 PM
            0 responses
            28 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-02-2026, 11:40 AM
            0 responses
            22 views
            0 reactions
            Last Post SEQadmin2  
            Working...