Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SRMA Problem SAMRecord contig does not match the current reference sequence contig

    Hi,

    I am receiving the error "SAMRecord contig does not match the current reference sequence contig" and a subsequent program exit when trying to perform realignment on a sorted bam file. The error occurs somewhere near the completion of processing the first chromosome (chr10). I have seen a previous post where the problem was caused by the SAM header order differing from the order of the headers in the reference fasta file but this doesn't seem to explain my problem.

    The headers from the sam file used to generate the bam look like this:

    @SQ SN:chr10 LN:135534747
    @SQ SN:chr11 LN:135006516
    @SQ SN:chr11_gl000202_random LN:40103
    @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_ctg5_hap1 LN:1680828
    @SQ SN:chr17 LN:81195210
    @SQ SN:chr17_gl000203_random LN:37498
    @SQ SN:chr17_gl000204_random LN:81310
    @SQ SN:chr17_gl000205_random LN:174588
    @SQ SN:chr17_gl000206_random LN:41001
    @SQ SN:chr18 LN:78077248
    @SQ SN:chr18_gl000207_random LN:4262
    @SQ SN:chr19 LN:59128983
    @SQ SN:chr19_gl000208_random LN:92689
    @SQ SN:chr19_gl000209_random LN:159169
    @SQ SN:chr1 LN:249250621
    @SQ SN:chr1_gl000191_random LN:106433
    @SQ SN:chr1_gl000192_random LN:547496
    @SQ SN:chr20 LN:63025520
    @SQ SN:chr21 LN:48129895
    @SQ SN:chr21_gl000210_random LN:27682
    @SQ SN:chr22 LN:51304566
    @SQ SN:chr2 LN:243199373
    @SQ SN:chr3 LN:198022430
    @SQ SN:chr4_ctg9_hap1 LN:590426
    @SQ SN:chr4 LN:191154276
    @SQ SN:chr4_gl000193_random LN:189789
    @SQ SN:chr4_gl000194_random LN:191469
    @SQ SN:chr5 LN:180915260
    @SQ SN:chr6_apd_hap1 LN:4622290
    @SQ SN:chr6_cox_hap2 LN:4795371
    @SQ SN:chr6_dbb_hap3 LN:4610396
    @SQ SN:chr6 LN:171115067
    @SQ SN:chr6_mann_hap4 LN:4683263
    @SQ SN:chr6_mcf_hap5 LN:4833398
    @SQ SN:chr6_qbl_hap6 LN:4611984
    @SQ SN:chr6_ssto_hap7 LN:4928567
    @SQ SN:chr7 LN:159138663
    @SQ SN:chr7_gl000195_random LN:182896
    @SQ SN:chr8 LN:146364022
    @SQ SN:chr8_gl000196_random LN:38914
    @SQ SN:chr8_gl000197_random LN:37175
    @SQ SN:chr9 LN:141213431
    @SQ SN:chr9_gl000198_random LN:90085
    @SQ SN:chr9_gl000199_random LN:169874
    @SQ SN:chr9_gl000200_random LN:187035
    @SQ SN:chr9_gl000201_random LN:36148
    @SQ SN:chrM LN:16571
    @SQ SN:chrUn_gl000211 LN:166566
    @SQ SN:chrUn_gl000212 LN:186858
    @SQ SN:chrUn_gl000213 LN:164239
    @SQ SN:chrUn_gl000214 LN:137718
    @SQ SN:chrUn_gl000215 LN:172545
    @SQ SN:chrUn_gl000216 LN:172294
    @SQ SN:chrUn_gl000217 LN:172149
    @SQ SN:chrUn_gl000218 LN:161147
    @SQ SN:chrUn_gl000219 LN:179198
    @SQ SN:chrUn_gl000220 LN:161802
    @SQ SN:chrUn_gl000221 LN:155397
    @SQ SN:chrUn_gl000222 LN:186861
    @SQ SN:chrUn_gl000223 LN:180455
    @SQ SN:chrUn_gl000224 LN:179693
    @SQ SN:chrUn_gl000225 LN:211173
    @SQ SN:chrUn_gl000226 LN:15008
    @SQ SN:chrUn_gl000227 LN:128374
    @SQ SN:chrUn_gl000228 LN:129120
    @SQ SN:chrUn_gl000229 LN:19913
    @SQ SN:chrUn_gl000230 LN:43691
    @SQ SN:chrUn_gl000231 LN:27386
    @SQ SN:chrUn_gl000232 LN:40652
    @SQ SN:chrUn_gl000233 LN:45941
    @SQ SN:chrUn_gl000234 LN:40531
    @SQ SN:chrUn_gl000235 LN:34474
    @SQ SN:chrUn_gl000236 LN:41934
    @SQ SN:chrUn_gl000237 LN:45867
    @SQ SN:chrUn_gl000238 LN:39939
    @SQ SN:chrUn_gl000239 LN:33824
    @SQ SN:chrUn_gl000240 LN:41933
    @SQ SN:chrUn_gl000241 LN:42152
    @SQ SN:chrUn_gl000242 LN:43523
    @SQ SN:chrUn_gl000243 LN:43341
    @SQ SN:chrUn_gl000244 LN:39929
    @SQ SN:chrUn_gl000245 LN:36651
    @SQ SN:chrUn_gl000246 LN:38154
    @SQ SN:chrUn_gl000247 LN:36422
    @SQ SN:chrUn_gl000248 LN:39786
    @SQ SN:chrUn_gl000249 LN:38502
    @SQ SN:chrX LN:155270560
    @SQ SN:chrY LN:59373566
    @PG ID:bwa PN:bwa VN:0.5.9-r16

    ANd the reference file headers look like this:

    >chr10
    >chr11
    >chr11_gl000202_random
    >chr12
    >chr13
    >chr14
    >chr15
    >chr16
    >chr17_ctg5_hap1
    >chr17
    >chr17_gl000203_random
    >chr17_gl000204_random
    >chr17_gl000205_random
    >chr17_gl000206_random
    >chr18
    >chr18_gl000207_random
    >chr19
    >chr19_gl000208_random
    >chr19_gl000209_random
    >chr1
    >chr1_gl000191_random
    >chr1_gl000192_random
    >chr20
    >chr21
    >chr21_gl000210_random
    >chr22
    >chr2
    >chr3
    >chr4_ctg9_hap1
    >chr4
    >chr4_gl000193_random
    >chr4_gl000194_random
    >chr5
    >chr6_apd_hap1
    >chr6_cox_hap2
    >chr6_dbb_hap3
    >chr6
    >chr6_mann_hap4
    >chr6_mcf_hap5
    >chr6_qbl_hap6
    >chr6_ssto_hap7
    >chr7
    >chr7_gl000195_random
    >chr8
    >chr8_gl000196_random
    >chr8_gl000197_random
    >chr9
    >chr9_gl000198_random
    >chr9_gl000199_random
    >chr9_gl000200_random
    >chr9_gl000201_random
    >chrM
    >chrUn_gl000211
    >chrUn_gl000212
    >chrUn_gl000213
    >chrUn_gl000214
    >chrUn_gl000215
    >chrUn_gl000216
    >chrUn_gl000217
    >chrUn_gl000218
    >chrUn_gl000219
    >chrUn_gl000220
    >chrUn_gl000221
    >chrUn_gl000222
    >chrUn_gl000223
    >chrUn_gl000224
    >chrUn_gl000225
    >chrUn_gl000226
    >chrUn_gl000227
    >chrUn_gl000228
    >chrUn_gl000229
    >chrUn_gl000230
    >chrUn_gl000231
    >chrUn_gl000232
    >chrUn_gl000233
    >chrUn_gl000234
    >chrUn_gl000235
    >chrUn_gl000236
    >chrUn_gl000237
    >chrUn_gl000238
    >chrUn_gl000239
    >chrUn_gl000240
    >chrUn_gl000241
    >chrUn_gl000242
    >chrUn_gl000243
    >chrUn_gl000244
    >chrUn_gl000245
    >chrUn_gl000246
    >chrUn_gl000247
    >chrUn_gl000248
    >chrUn_gl000249
    >chrX
    >chrY

    Any ideas what could be causing the problem?

  • #2
    What version are you using? Could you display the output error?

    Comment


    • #3
      Originally posted by nilshomer View Post
      What version are you using? Could you display the output error?
      I am using version 0.1.15 Nils.

      The screen output on program death looks like this:

      [Fri Jul 01 10:07:16 BST 2011] srma.SRMA INPUT=[reads_sort.bam] OUTPUT=[reads_sort_realigned] REFERENCE=../hg19/hg19_all_but_haps.fa VALIDATION_STRINGENCY=SILENT OFFSET=20 MIN_MAPQ=0 MINIMUM_ALLELE_PROBABILITY=0.1 MINIMUM_ALLELE_COVERAGE=3 MAXIMUM_TOTAL_COVERAGE=100 CORRECT_BASES=false USE_SEQUENCE_QUALITIES=true QUIET_STDERR=false MAX_HEAP_SIZE=8192 MAX_QUEUE_SIZE=65536 GRAPH_PRUNING=false NUM_THREADS=1 TMP_DIR=/tmp/goliver VERBOSITY=INFO QUIET=false COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
      Allele coverage cutoffs:
      coverage: 1 minimum allele coverage: 0
      coverage: 2 minimum allele coverage: 0
      coverage: 3 minimum allele coverage: 0
      coverage: 4 minimum allele coverage: 1
      coverage: 5 minimum allele coverage: 1
      coverage: 6 minimum allele coverage: 1
      coverage: 7 minimum allele coverage: 2
      coverage: 8 minimum allele coverage: 2
      coverage: 9 minimum allele coverage: 3
      coverage: >9 minimum allele coverage: 3
      Records processsed: 105356 (last chr10:135518316-135518416)java.lang.Exception: SAMRecord contig does not match the current reference sequence contig
      at srma.Graph.addSAMRecord(Graph.java:54)
      at srma.SRMA$GraphThread.run(SRMA.java:708)
      Please report bugs to [email protected]

      Comment


      • #4
        Looks like a potential bug. For now, you can try running one chromosome at a time. I would appreciated a way to reproduce and fix the bug. Could you please send me the input files? If they are large, you could try finding a range in the file that causes the file so that you only give a small file. For example, the end of chr10 and the beginning of the next one.

        Comment


        • #5
          Hi Nils,

          The input file is a 916MB BAM file. Is there anywhere I could deposit it by FTP?

          On the issue of running the file per chromosome, without specifying a numerical range, I tried the following "RANGE=chr1" but got an error:

          [Tue Jul 05 09:00:03 BST 2011] srma.SRMA INPUT=[reads_sort.bam] OUTPUT=[reads_sort_realigned] REFERENCE=../../hg19/hg19_all_but_haps.fa RANGE=chr1 OFFSET=20 MIN_MAPQ=0 MINIMUM_ALLELE_PROBABILITY=0.1 MINIMUM_ALLELE_COVERAGE=3 MAXIMUM_TOTAL_COVERAGE=100 CORRECT_BASES=false USE_SEQUENCE_QUALITIES=true QUIET_STDERR=false MAX_HEAP_SIZE=8192 MAX_QUEUE_SIZE=65536 GRAPH_PRUNING=false NUM_THREADS=1 TMP_DIR=/tmp/goliver VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false
          java.lang.Exception: BAM files and BAM indexes when using the RANGE or RANGES option
          at srma.SAMRecordIO.<init>(SAMRecordIO.java:53)
          at srma.SRMA.doWork(SRMA.java:159)
          at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:156)
          at srma.SRMA.main(SRMA.java:98)
          Please report bugs to [email protected]

          Comment


          • #6
            To process by chromosome, you must index the BAM file (as stated in the error message).

            Comment

            Latest Articles

            Collapse

            • seqadmin
              Strategies for Sequencing Challenging Samples
              by seqadmin


              Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
              03-22-2024, 06:39 AM
            • seqadmin
              Techniques and Challenges in Conservation Genomics
              by seqadmin



              The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

              Avian Conservation
              Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
              03-08-2024, 10:41 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Yesterday, 06:37 PM
            0 responses
            8 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Yesterday, 06:07 PM
            0 responses
            8 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 03-22-2024, 10:03 AM
            0 responses
            49 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 03-21-2024, 07:32 AM
            0 responses
            67 views
            0 likes
            Last Post seqadmin  
            Working...
            X