Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • bgibb
    Junior Member
    • Jul 2010
    • 7

    #16
    I noticed the same problem when running pileup under SAMtools-0.1.15. However the problem does not seem to occur when running pileup under SAMtools-0.1.4 (using the same reference file, same BAM file and same command line options).

    samtools-0.1.4/samtools pileup -s -f reference.fa sorted.bam > pileup.out

    Comment

    • smehr12
      Junior Member
      • May 2011
      • 4

      #17
      Originally posted by SMHfrog View Post
      I had this same problem, and after seeing no solution here did some more digging, and have a possible solution for you.

      I noticed that the ref.fa.fai file for my whole genome was 0 kb. The .fai is used by samtools when building the pileup. When I ran the command to re-build the .fai:

      samtools faidx reference.fa

      I got the following error message:

      [fai_build_core] different line length in sequence 'scaffold_14'.
      Segmentation fault

      No doubt this same message occurred the first time I ran the pileup command (which also builds the .fai if it doesn't exist), but I apparently didn't pay attention. After that first time, the .fai file EXISTED so no errors were subsequently reported when I ran pileup again.

      In my case, there was an extra line after scaffold_14. I removed this, and re-built the .fai using the samtools faidx command and then re-ran the pileup command. My pileup then contained the reference base as intended!

      Hope this helps y'all find the solution to your problem.
      Best,
      Shannon
      University of Texas at Austin
      Hi all,
      I have the same error.
      samtools faidx bwa.ref/ref.fasta ref.fa

      ERROR:
      different line length in sequence 'scaffold_67'.
      Segmentation fault
      NOTE: I see NNNN in that scaffold . Does anyone have a suggestion?

      Comment

      • ericpante
        Junior Member
        • Nov 2011
        • 1

        #18
        Hi everybody,

        I am have similar problems with samtools 0.1.18. I would like to have reference characters listed in a pileup files, but I have problems with headers.

        samtools faidx AGSbrut.fasta
        samtools view -q 20 -buh -t AGSbrut.fasta.fai A.sam | samtools sort - A
        samtools view -q 20 -buh -t AGSbrut.fasta.fai S.sam | samtools sort - S
        samtools mpileup -B -f AGSbrut_index.fai A.bam S.bam > AS.mpileup

        [fai_build_core] different line length in sequence 'null'.
        Segmentation fault

        I hypothesized that this 'null' sequence may be a blank line; so I looked for it manually and with sed, with no luck. I also looked for other potential problems based on what was previously reported (no extra spaces, characters, etc in reference sequence names in fai and sam files). I also tried to re-head the file, with no success:

        samtools view -HS -t AGSbrut.fasta.fai A.sam > Aheader.sam
        samtools reheader Aheader.sam A.bam > Aheaded.bam

        [bam_header_read] EOF marker is absent. The input is probably truncated.

        All insights are welcome!
        thank you, eric

        Comment

        • adowney
          Junior Member
          • Dec 2011
          • 1

          #19
          Originally posted by colindaven View Post
          Here's another possible solution - the headers are not consistent between SAM/BAM and the original fasta:

          Even though the reference file was the same one in both cases, sometimes aligners just write a substring out into the SAM file. Samtools seems to take the full header.

          For example the first contiguous part of my genome header is
          gi|110645304|ref|NC_002516.2|

          However in my SAM file the aligner has only written
          NC_002516.2

          Samtools has written the full header to the .fa.fai index
          gi|110645304|ref|NC_002516.2|

          .. and this does not match.

          Solution:

          Try correcting the original header on the reference fasta to just the substring which the aligner uses.
          eg
          gi|110645304|ref|NC_002516.2|
          to
          NC_002516.2
          The above suggestion fixed the problem when I got this error

          Comment

          • jgibbons1
            Senior Member
            • Oct 2009
            • 135

            #20
            Hey folks,

            Have been struggling to figure out why I am getting N's for my pileup reference sequence. I found hope when I discovered this string but I have followed all the suggestions to no avail. I've tried this with different versions of samtools, different data sets, different reference files and have simplified ID names, rebuilt the faidx index, etc. etc.

            Still can't figure out what's going on here. Has anyone found any other solutions?

            Thanks

            Comment

            • jgibbons1
              Senior Member
              • Oct 2009
              • 135

              #21
              Using pileup with the -f argument allows you to supply the faidx indexed reference sequence file. I used this option and it fixed my problem.

              Comment

              • nupurgupta
                Member
                • Aug 2010
                • 29

                #22
                Same problem

                Did you find a solution to the null problem please?

                Originally posted by ericpante View Post
                Hi everybody,

                I am have similar problems with samtools 0.1.18. I would like to have reference characters listed in a pileup files, but I have problems with headers.

                samtools faidx AGSbrut.fasta
                samtools view -q 20 -buh -t AGSbrut.fasta.fai A.sam | samtools sort - A
                samtools view -q 20 -buh -t AGSbrut.fasta.fai S.sam | samtools sort - S
                samtools mpileup -B -f AGSbrut_index.fai A.bam S.bam > AS.mpileup

                [fai_build_core] different line length in sequence 'null'.
                Segmentation fault

                I hypothesized that this 'null' sequence may be a blank line; so I looked for it manually and with sed, with no luck. I also looked for other potential problems based on what was previously reported (no extra spaces, characters, etc in reference sequence names in fai and sam files). I also tried to re-head the file, with no success:

                samtools view -HS -t AGSbrut.fasta.fai A.sam > Aheader.sam
                samtools reheader Aheader.sam A.bam > Aheaded.bam

                [bam_header_read] EOF marker is absent. The input is probably truncated.

                All insights are welcome!
                thank you, eric

                Comment

                Latest Articles

                Collapse

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, 06-05-2026, 10:09 AM
                0 responses
                14 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-04-2026, 08:59 AM
                0 responses
                28 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-02-2026, 12:03 PM
                0 responses
                33 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 06-02-2026, 11:40 AM
                0 responses
                23 views
                0 reactions
                Last Post SEQadmin2  
                Working...