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
          Advancing Precision Medicine for Rare Diseases in Children
          by seqadmin




          Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
          12-16-2024, 07:57 AM
        • seqadmin
          Recent Advances in Sequencing Technologies
          by seqadmin



          Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

          Long-Read Sequencing
          Long-read sequencing has seen remarkable advancements,...
          12-02-2024, 01:49 PM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 12-17-2024, 10:28 AM
        0 responses
        27 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-13-2024, 08:24 AM
        0 responses
        43 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-12-2024, 07:41 AM
        0 responses
        29 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 12-11-2024, 07:45 AM
        0 responses
        42 views
        0 likes
        Last Post seqadmin  
        Working...
        X