Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • GATK RNA-Seq pathway Split 'n' Trim- problems with .bai and .fai index compatibility

    I am processing aligned RNA-Seq data to get phased haplotypes of novel genes in sea stars. I am working through the analysis pipeline that used the Genome Analysis Toolkit suite of software, and is detailed on the Broad Institute website:
    https://www.broadinstitute.org/gatk/...ces?bpm=RNAseq

    and

    https://www.broadinstitute.org/gatk/...c?name=methods

    I am up to the Split 'n' Trim stage of the pipeline, where the SplitNCigarReads tool is used to refine the sequence alignment. I have hit some problems with my index files. The order of the scaffolds and contigs for .fai (fasta index file) and .bai (index for bam file; bam file has been sorted, read-groups have been added and duplicated marked) files is different.

    e.g. the .fai file:
    Scaffold1 154793 11 70 71
    Scaffold2 383464 157027 70 71
    Scaffold3 336159 545981 70 71

    eg. the .bai file (samtools idxstats filename.bam):
    Scaffold1 154793 0 0
    Scaffold10 244803 0 0
    Scaffold100 200181 0 0

    I therefore got the following error from GATK:
    ##### ERROR MESSAGE: Input files reads and reference have incompatible contigs: Relative ordering of overlapping contigs differs, which is unsafe.
    ##### ERROR reads contigs = [Scaffold1, Scaffold10, Scaffold100, Scaffold1000...
    ##### ERROR reference contigs = [Scaffold1, Scaffold2, Scaffold3, Scaffold4…

    I wrote a script to change the order of the items in the .fai file so they would be in the same order as the .bai file, but this produced another error:
    ##### ERROR MESSAGE: Couldn't read file filename.fa because Mismatch between sequence dictionary fasta index for filename.fa, sequence 'Scaffold2' != 'Scaffold10'.

    Can anyone suggest a good work around for this problem? Do I need to change the order of entries in the fasta file reference sequence? Should I alter the .dict file (scaffolds/contigs are in the same order as they are in the original .fai file)?
    Last edited by gwilymh; 11-17-2014, 06:03 PM. Reason: Specifying the specific part of the pipeline where I had the problem

  • #2
    You can't just reorder the lines in the fai file, they need to be in the exact same order as the contigs in the fasta file.

    You have two options:
    (1) Reorder the fasta file. If there are a LOT of contigs then this could be a pain. The simplest method is to split the fasta file by chromosome and then reconcatenate things...in the proper order.
    (2) Reorder the BAM file. You can use picard tool's ReorderSam command to do this. This will order things to match the fasta file.

    I expect option (2) is easier in your case.

    Comment

    Latest Articles

    Collapse

    • seqadmin
      Essential Discoveries and Tools in Epitranscriptomics
      by seqadmin


      The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
      Today, 07:01 AM
    • seqadmin
      Current Approaches to Protein Sequencing
      by seqadmin


      Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
      04-04-2024, 04:25 PM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, 04-11-2024, 12:08 PM
    0 responses
    37 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-10-2024, 10:19 PM
    0 responses
    41 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-10-2024, 09:21 AM
    0 responses
    35 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 04-04-2024, 09:00 AM
    0 responses
    54 views
    0 likes
    Last Post seqadmin  
    Working...
    X