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

            • SEQadmin2
              Nine Things a Sample Prep Scientist Thinks About Before Sequencing
              by SEQadmin2


              I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

              Here are nine questions we think about, in roughly the order they matter, before...
              06-18-2026, 07:11 AM
            • 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.
              ...
              06-02-2026, 10:05 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, 06-26-2026, 11:10 AM
            0 responses
            12 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-17-2026, 06:09 AM
            0 responses
            46 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-09-2026, 11:58 AM
            0 responses
            106 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 06-05-2026, 10:09 AM
            0 responses
            125 views
            0 reactions
            Last Post SEQadmin2  
            Working...