This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Mpileup Segmentation Fault

I am interested in calling SNPs with mileup using de novo contigs generated from a Trinity run and reads aligned with Rsem.

I ran the following command but I got a segmentation fault

samtools mpileup -ugf mga_femalelimited_trinity.fas turkey_female_limited.transcript.sorted.bam

I generated the index for the fasta file separately with faidx and there was no error.

Any help would be much appreciated, thanks

mpileup

3 answers

what's your version of samtools ?

Is your bam indexed with samtools index ?

does samtools view your.bam | more works ?

can you run Picard ValidateSamFile on your bam ? http://picard.sourceforge.net/command-line-overview.shtml#ValidateSamFile

can you run and see what happens with gdb ?

gdb /path/to/samtools
$ run  -ugf mga_femalelimited_trinity.fas turkey_female_limited.transcript.sorted.bam

Hi,

Thanks for your help and quick reply

1.Version: 0.1.18

2.The bam is sorted and indices generated by samtools within Rsem

3.Yes the samtools view definitely works with the bam file

4.This is the output from Picard ValidateSamFile Exception in thread "main" java.lang.IllegalArgumentException: No enum const class net.sf.samtools.SAMFileHeader$SortOrder.unknown at java.lang.Enum.valueOf(Enum.java:196) at net.sf.samtools.SAMFileHeader$SortOrder.valueOf(SAMFileHeader.java:59) at net.sf.samtools.SAMFileHeader.getSortOrder(SAMFileHeader.java:240) at net.sf.picard.sam.SamFileValidator.init(SamFileValidator.java:354) at net.sf.picard.sam.SamFileValidator.validateSamFileVerbose(SamFileValidator.java:133) at net.sf.picard.sam.ValidateSamFile.doWork(ValidateSamFile.java:156) at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:177) at net.sf.picard.sam.ValidateSamFile.main(ValidateSamFile.java:92)

5.I ran exactly this command gdb /path/to/samtools and within gbd run -ugf mgafemalelimitedtrinity.fas turkeyfemalelimited.transcript.sorted.bam

and this is the output Starting program: -ugf mgafemalelimitedtrinity.fas turkeyfemalelimited.transcript.sorted.bam No executable file specified. Use the "file" or "exec-file" command.

Have I entered the command correctly?

Also as a final note, the command samtools mpileup -ugf mgafemalelimitedtrinity.fas turkeyfemalelimited.transcript.sorted.bam runs for a bit but terminates when it reaches a certain contig. But it cannot output this to a file.

Thanks

apologies, the error from gdb is actually Program received signal EXCBADACCESS, Could not access memory. Reason: KERNINVALIDADDRESS at address: 0x00000000ad65e7ab bamauxget (b=0x107d44830, tag=<value temporarily="" unavailable,="" due="" to="" optimizations="">) at bam_aux.c:44 44if (x == y) return s;

apologies, the error from gdb is actually Program received signal EXCBADACCESS, Could not access memory. Reason: KERNINVALIDADDRESS at address: 0x00000000ad65e7ab bamauxget (b=0x107d44830, tag=<value temporarily="" unavailable,="" due="" to="" optimizations="">) at bam_aux.c:44 44if (x == y) return s;

you should edit your question/comment and add the information there then delete these - otherwise you keep adding answers

thanks, I have done now

If anyone else has any further comments on this problem I would greatly appreciate it, thanks

Log in to answer this question.