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
          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
        • 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

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 04-11-2024, 12:08 PM
        0 responses
        18 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 10:19 PM
        0 responses
        22 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-10-2024, 09:21 AM
        0 responses
        17 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-04-2024, 09:00 AM
        0 responses
        49 views
        0 likes
        Last Post seqadmin  
        Working...
        X