Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • samtools mpipeup error: different line length in sequence 'chr1'.

    hi,
    I am new about samtools and bioinformatics, these days I try to call an SNP using bwa and samtools.everything went well, but at the last step, there is an error:
    [fai_load] build FASTA index.
    [fai_build_core] different line length in sequence 'chr1'.
    [afs] 0:0.000
    and my command is : samtools mpileup -uf ref.fa input.rmdup.bam |bcftools view -vcg ->test.raw.vcf
    This is probably a dumb question, but what could be causing this?

    thanks

  • #2
    hi mihuzx ,
    Did you sort & index the bam file before going to mpileup by using

    samtools sort aln.bam aln.sorted
    samtools index aln.sorted.bam

    Comment


    • #3
      Originally posted by mihuzx View Post
      hi,
      I am new about samtools and bioinformatics, these days I try to call an SNP using bwa and samtools.everything went well, but at the last step, there is an error:
      [fai_load] build FASTA index.
      [fai_build_core] different line length in sequence 'chr1'.
      [afs] 0:0.000
      and my command is : samtools mpileup -uf ref.fa input.rmdup.bam |bcftools view -vcg ->test.raw.vcf
      This is probably a dumb question, but what could be causing this?

      thanks
      The "different line length" error will generally mean that some of the lines in your reference sequence are longer/shorter than others. It's OK for the last line of a chromosome/contig to be shorter, but the others need to be the same length. If you're curious why this is the case, it's result of how indexing and random seeking of fasta files by samtools works (basically, the index gives the length of the chromosome, the number of nucleotides in each line and a chromosome offset, which is sufficient to calculate a offset position in a file for seeking). The solution, then is to just fix the fasta file. The "NormalizeFasta" command from Picard tools should be able to due this.

      Comment


      • #4
        Originally posted by dpryan View Post
        The "different line length" error will generally mean that some of the lines in your reference sequence are longer/shorter than others. It's OK for the last line of a chromosome/contig to be shorter, but the others need to be the same length. If you're curious why this is the case, it's result of how indexing and random seeking of fasta files by samtools works (basically, the index gives the length of the chromosome, the number of nucleotides in each line and a chromosome offset, which is sufficient to calculate a offset position in a file for seeking). The solution, then is to just fix the fasta file. The "NormalizeFasta" command from Picard tools should be able to due this.
        thanks for your advice. this is the exact solution to my problem.
        thanks to everyone.

        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...
          Yesterday, 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
        39 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
        55 views
        0 likes
        Last Post seqadmin  
        Working...
        X