We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

Reorder Sam error "New reference sequence does not contain a matching contig for chrM_rCRS"

Hi I'm trying to re align bam file using GATK tools. My bam file is currently in lexographical format and I need to convert it karyotipic form. The bam files' chromosomes are numbered as "chr1 chr2..." and my ref file also has chromosomes numbered in the same way. I first extract the autosomes of the bam file (chr1-22) then index it. After Indexing it I run the command
"java -jar $picard ReorderSam I= $input O= ${i}_Reordered_22chrs.bam REFERENCE= $ref" However I still get the error:
"New reference sequence does not contain a matching contig for chrM_rCRS"
I'm not sure where the ChrM_rCS is even coming from it's not in the ref.fai file, the ref.dict file or bam file.

Tagged:

Best Answer

Answers

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin
    Make sure you delete the index of the new bam and reindex it (using e.g. BuildBamIndex)
  • skhalid7skhalid7 GatechMember

    I have deleted the bam index file, then reindexed the new file but I still get the same error

  • SheilaSheila Broad InstituteMember, Broadie ✭✭✭✭✭

    @skhalid7
    Hi,

    Can you please post the BAM file header (specifically the @SQ lines) and the FASTA .dict file?

    Thanks,
    Sheila

  • skhalid7skhalid7 GatechMember

    The bam file does not have any header (It was downloaded from TCGA).

    The dict file is:
    @SQ SN:chr13 LN:115169878 M5:283f8d7892baa81b510a015719ca7b0b UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr14 LN:107349540 M5:98f3cae32b2a2e9524bc19813927542e UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr15 LN:102531392 M5:e5645a794a8238215b2cd77acb95a078 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr16 LN:90354753 M5:fc9b1a7b42b97a864f56b348b06095e6 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr17 LN:81195210 M5:351f64d4f4f9ddd45b35336ad97aa6de UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr18 LN:78077248 M5:b15d4b2d29dde9d3e4f93d1d0f2cbc9c UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr19 LN:59128983 M5:1aacd71f30db8e561810913e0b72636d UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr20 LN:63025520 M5:0dec9660ec1efaaf33281c0d5ea2560f UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr21 LN:48129895 M5:2979a6085bfe28e3ad6f552f361ed74d UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chr22 LN:51304566 M5:a718acaa6135fdca8357d5bfe94211dd UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrX LN:155270560 M5:7e0e2e580297b7764e31dbc80c2540dd UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrY LN:59373566 M5:1fa3474750af0948bdf97d5a0ee52e51 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrMT LN:16569 M5:c68f52674c9fb33aef52dcf399755519 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000207.1 LN:4262 M5:f3814841f1939d3ca19072d9e89f3fd7 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000226.1 LN:15008 M5:1c1b2cd1fccbc0a99b6a447fa24d1504 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000229.1 LN:19913 M5:d0f40ec87de311d8e715b52e4c7062e1 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000231.1 LN:27386 M5:ba8882ce3a1efa2080e5d29b956568a4 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000210.1 LN:27682 M5:851106a74238044126131ce2a8e5847c UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000239.1 LN:33824 M5:99795f15702caec4fa1c4e15f8a29c07 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000235.1 LN:34474 M5:118a25ca210cfbcdfb6c2ebb249f9680 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000201.1 LN:36148 M5:dfb7e7ec60ffdcb85cb359ea28454ee9 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000247.1 LN:36422 M5:7de00226bb7df1c57276ca6baabafd15 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000245.1 LN:36651 M5:89bc61960f37d94abf0df2d481ada0ec UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000197.1 LN:37175 M5:6f5efdd36643a9b8c8ccad6f2f1edc7b UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000203.1 LN:37498 M5:96358c325fe0e70bee73436e8bb14dbd UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000246.1 LN:38154 M5:e4afcd31912af9d9c2546acf1cb23af2 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000249.1 LN:38502 M5:1d78abec37c15fe29a275eb08d5af236 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000196.1 LN:38914 M5:d92206d1bb4c3b4019c43c0875c06dc0 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000248.1 LN:39786 M5:5a8e43bec9be36c7b49c84d585107776 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000244.1 LN:39929 M5:0996b4475f353ca98bacb756ac479140 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000238.1 LN:39939 M5:131b1efc3270cc838686b54e7c34b17b UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000202.1 LN:40103 M5:06cbf126247d89664a4faebad130fe9c UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000234.1 LN:40531 M5:93f998536b61a56fd0ff47322a911d4b UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000232.1 LN:40652 M5:3e06b6741061ad93a8587531307057d8 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000206.1 LN:41001 M5:43f69e423533e948bfae5ce1d45bd3f1 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000240.1 LN:41933 M5:445a86173da9f237d7bcf41c6cb8cc62 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000236.1 LN:41934 M5:fdcd739913efa1fdc64b6c0cd7016779 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000241.1 LN:42152 M5:ef4258cdc5a45c206cea8fc3e1d858cf UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000243.1 LN:43341 M5:cc34279a7e353136741c9fce79bc4396 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000242.1 LN:43523 M5:2f8694fc47576bc81b5fe9e7de0ba49e UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000230.1 LN:43691 M5:b4eb71ee878d3706246b7c1dbef69299 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000237.1 LN:45867 M5:e0c82e7751df73f4f6d0ed30cdc853c0 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta
    @SQ SN:chrGL000233.1 LN:45941 M5:7fed60298a8d62ff808b74b6ce820001 UR:file:/gpfs/scratch1/6/skhalid7/work/Homo_sapiens_assembly19chr.fasta

    Issue · Github
    by Sheila

    Issue Number
    1357
    State
    closed
    Last Updated
    Assignee
    Array
    Milestone
    Array
    Closed By
    chandrans
  • skhalid7skhalid7 GatechMember

    Sorry I was using the wrong for the header
    My bam files header is
    @HD VN:1.0 SO:unsorted
    @SQ SN:chr1 LN:249250621
    @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:chr2 LN:243199373
    @SQ SN:chr20 LN:63025520
    @SQ SN:chr21 LN:48129895
    @SQ SN:chr22 LN:51304566
    @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:chrM_rCRS LN:16569
    @SQ SN:chrX LN:155270560
    @SQ SN:chrY LN:59373566
    @RG ID:111118_UNC11-SN627_0168_BC059VACXX_3_GGCTAC PL:illumina PU:barcode LB:TruSeq SM:111118_UNC11-SN627_0168_BC059VACXX_3_GGCTAC

  • shleeshlee CambridgeMember, Broadie ✭✭✭✭✭

    @skhalid7,

    If you just need to reorder the BAM file, you can use ReorderSam according to this article. If you are realigning, then strip alignment information according to the article I linked in my last reply. Also, I hope the dictionary you posted is a sampling and not the entirety of your reference dictionary. Make sure your reference and reference dictionary also containschromosomes 1–12.

Sign In or Register to comment.