Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fabrice ODEFREY
    Member
    • May 2010
    • 21

    #1

    Problem with sam files created by bfast

    Hi everyone,
    In advance excuse my ignorance if it is something obvious but I have been looking around and couldn’t find similar problems. I’m not sure if I have just one problem carrying on or several at different level of analyses...

    I have 8 sam files created with bfast for 1 sample, I have tried and succeeded to create 1 merged BAM file using 2 different ways (8sam>8bam>8sortedbam>1mergedbam or 8sam>1mergedsam>1bam>1 sorted bam) to see if it could solve my problem. But each time I can’t visualize it in IGV or use it in downstream analyses (SRMA, samtools pileup). The error message I get from IGV is as followed:

    Error loading SAM header: for sequence 0, text and binary have different names in file sample1.bam

    Then when I hit ok a second message appear:
    An error occurred while loading: sample1.bam [java.lang.nullPointerException]

    With SRMA I got a similar error:
    net.sf.samtools.SAMFormatException: For sequence 0, text and binary have different names in file ~/sample1/bfast.sample1.merged.bam

    at net.sf.samtools.BAMFileReader.readHeader(BAMFileReader.java:354)
    at net.sf.samtools.BAMFileReader.<init>(BAMFileReader.java:114)
    at net.sf.samtools.BAMFileReader.<init>(BAMFileReader.java:93)
    at net.sf.samtools.SAMFileReader.init(SAMFileReader.java:500)
    at net.sf.samtools.SAMFileReader.<init>(SAMFileReader.java:148)
    at srma.SAMRecordIO.<init>(SAMRecordIO.java:49)
    at srma.SRMA.doWork(SRMA.java:141)
    at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:150)
    at srma.SRMA.main(SRMA.java:92)


    I have tried samtools view to look at my header which looked ok.
    @HD VN:0.1.2 SO:unsorted GO:none
    @SQ SN:chr1 LN:249250621
    @SQ SN:chr2 LN:243199373
    @SQ SN:chr3 LN:198022430
    @SQ SN:chr4 LN:191154276
    @SQ SN:chr5 LN:180915260
    @SQ SN:chr6 LN:171115067
    @SQ SN:chr7 LN:159138663
    @SQ SN:chr8 LN:146364022
    @SQ SN:chr9 LN:141213431
    @SQ SN:chr10 LN:135534747
    @SQ SN:chr11 LN:135006516
    @SQ SN:chr12 LN:133851895
    @SQ SN:chr13 LN:115169878
    @SQ SN:chr14 LN:107349540
    @SQ SN:chr15 LN:102531392
    @SQ SN:chr16 LN:90354753
    @SQ SN:chr17 LN:81195210
    @SQ SN:chr18 LN:78077248
    @SQ SN:chr19 LN:59128983
    @SQ SN:chr20 LN:63025520
    @SQ SN:chr21 LN:48129895
    @SQ SN:chr22 LN:51304566
    @SQ SN:chrX LN:155270560
    @SQ SN:chrY LN:59373566
    @SQ SN:chrM LN:16571
    @PG ID:bfast VN:0.6.4c

    One strange thing is that when I sort, the header indicates chr 1 then chr2 etc..., Whereas the main mapped read start with chrM then Y... it is true that within each chr each read are sorted from beginning to end of the chr but the chr are not sorted from 1 to M...could it be the problem? I couldn’t find any option in samtools sort to specify the sorting from chr 1 to M...
    I have tried to remove all unmapped reads thinking that it could cause the error but it didn’t do anything. I have tried also to work only with 1 sam file in case the merging was causing the problem just doing the compression in bam and then the sorting but the problem was still there...

    thanks in advance for any help you could provide!
    Fabrice
    Last edited by Fabrice ODEFREY; 09-22-2010, 05:54 PM.
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    The reads should be sorted in the same order as the header. Are the read sorted in reverse order?

    Comment

    • Fabrice ODEFREY
      Member
      • May 2010
      • 21

      #3
      Hi Nils and thanks for you quick reply.
      It looks like it is reverse from the order of my header doing all chr M first then Y, X, 22...but I don't understand why samtools sort isn't changing then my header accordingly?

      Comment

      Latest Articles

      Collapse

      • SEQadmin2
        Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
        by SEQadmin2



        Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

        Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
        ...
        10-14-2026, 09:55 AM
      • SEQadmin2
        New Genomics Technologies Take Aim at Long-Standing Limits
        by SEQadmin2


        Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

        We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
        ...
        09-28-2026, 10:25 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by SEQadmin2, Yesterday, 11:13 AM
      0 responses
      16 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, Yesterday, 10:48 AM
      0 responses
      16 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-15-2026, 10:52 AM
      0 responses
      35 views
      0 reactions
      Last Post SEQadmin2  
      Started by SEQadmin2, 10-14-2026, 05:39 AM
      0 responses
      42 views
      0 reactions
      Last Post SEQadmin2  
      Working...