Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • apeltzer
    Junior Member
    • Feb 2014
    • 1

    [PICARD] Problems with SAM/BAM files without header

    Hi there,

    I have several problems when dealing with SAM/BAM files without an appropriate header inside. First of all, if there is a correct header the PicardTools SDK I use in my tool works without any flaws. If there is however no header, I had to change my tool to use the
    VALIDATION_STRINGENCY=LENIENT setting, otherwise it would crash giving me the information that there is no header (so far so good and expected).

    My problem now is: If I have a file without a header, but my reads have a corresponding header reference set (e.g. gi|040304024...) this is set to "*" by picard, without any necessity. Downstream my analysis, this is causing several issues in the pipeline. Can I force Picard to leave the already existing reference IDs set in each read as they are somehow?

    Thanks,
    Hope this is getting clear for anybody ;-)
  • TiborNagy
    Senior Member
    • Mar 2010
    • 329

    #2
    Header of SAM file is a very simple thing. Try to create manually.

    Comment

    • dpryan
      Devon Ryan
      • Jul 2011
      • 3478

      #3
      I'm not particularly familiar with the SAM JDK (I use the samtools C API mostly), but I can at least explain why this is happening. For both picard and samtools, alignments are stored internally in something like the BAM format, regardless of how they're written in a file. In a BAM file, the chromosome/contig name is absent, there's just a number (in the C API, this is read->core.tid, I don't know what the equivalent is in java). This number is just an index into an array stored in the header. At least in the C API, you can use an arbitrary header when reading a SAM/BAM file, since the reader function is given the header as an argument. Since java is an OO language, I wouldn't be surprised if there's no equivalently convenient way to do this in java. You might have to look at the code for SAMFileReader and see if you can manually change what it uses as a SAMFileHeader.

      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
      16 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-17-2026, 06:09 AM
      0 responses
      49 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 06-09-2026, 11:58 AM
      0 responses
      108 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...