Header Leaderboard Ad

Collapse

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

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
          Improved Targeted Sequencing: A Comprehensive Guide to Amplicon Sequencing
          by seqadmin



          Amplicon sequencing is a targeted approach that allows researchers to investigate specific regions of the genome. This technique is routinely used in applications such as variant identification, clinical research, and infectious disease surveillance. The amplicon sequencing process begins by designing primers that flank the regions of interest. The DNA sequences are then amplified through PCR (typically multiplex PCR) to produce amplicons complementary to the targets. RNA targets...
          03-21-2023, 01:49 PM
        • seqadmin
          Targeted Sequencing: Choosing Between Hybridization Capture and Amplicon Sequencing
          by seqadmin




          Targeted sequencing is an effective way to sequence and analyze specific genomic regions of interest. This method enables researchers to focus their efforts on their desired targets, as opposed to other methods like whole genome sequencing that involve the sequencing of total DNA. Utilizing targeted sequencing is an attractive option for many researchers because it is often faster, more cost-effective, and only generates applicable data. While there are many approaches...
          03-10-2023, 05:31 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Yesterday, 01:40 PM
        0 responses
        6 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 03-29-2023, 11:44 AM
        0 responses
        12 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 03-24-2023, 02:45 PM
        0 responses
        20 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 03-22-2023, 12:26 PM
        0 responses
        28 views
        0 likes
        Last Post seqadmin  
        Working...
        X