Filterbam error of segmentation fault

Discussions about predicting genes with AUGUSTUS. Not covered here: WebAUGUSTUS and BRAKER1

Moderator: bioinf

Post Reply
clement
Posts: 2
Joined: Thu Jan 05, 2023 3:26 pm

Filterbam error of segmentation fault

Post by clement »

Hello,

First of all, thank you for the development of your tool!

I am currently trying to make the structural annotation of a specific contig. At the moment I am producing hint from two libraries RNA-seq illumina. So first I changed the name of the reads to "-1 and -2" via a sed command. Then I created an interleave fastq from R1 and R2.

Here is a head of my fastq:

@SRR1693840.1 EXTGAIIX_101210:5:1:1433:1105-1
TNCATCCAGGCGGTCCATTCGATCCATTAGGTCTAGCAAATGATCCCGACCAAGCTGCAATCCTAAAAGTGAAGGAAATTAAGAATGGAAGACTTGCTATGTTTGCCAT
+
B!B@BEFFFDGDGGGDHEHBDGADGGGGGGGEGGGGGGDDBGGGGFBHDHDFFBCD>8GGB8D<BBBB+GBDAADG@3DDD8?E@ABBD3B?;'?:::::?C8A8C####
@SRR1693840.1 EXTGAIIX_101210:5:1:1433:1105-2
CTTCCATTAAATAAAGCAAAATGCCTTCAGTGAGATGTATTGTACATTCAAGATTGGATTAACAAAAAAGCATGAAAATGATCTGATTCATCACAGAGTTGGAGCCT
+
HDIIDGIFFGIDIFI>EGGGGG>G@>DE:EDGGE8GG@GDGGBG8GF=BFBGGGEG@EGECGGG>>DDDAD>GG8EG<DD8E8D-DBD88G@<GBDG<<>A########
@SRR1693840.2 EXTGAIIX_101210:5:1:1986:1101-1
CNAAGCAACTATAGCCACTTTATTTTATTAAAAAAGCAAACATATATGATATGCTTTTTCTACATTATCATTACATATTGACTCTAATATCTGCTTCACAC

I then ran the alignment by following the commands below:

``bash
conda activate tophat
tophat -o $outputDIR -p 4 $index_DIR/dgl_COI_bwt_index $RNAseq_leaves_r1,$RNAseq_leaves_r2 $RNAseq_roots_r1,$RNAseq_roots_r2
RNAseq_leaves_interleave=$RNAseq_files_DIR/SSRR1693840_Pisum_sativum_cv_Cameor_Leaves_paired_end_library_stage_B_Low-nitrate_Hydroponics_readNameChanged_interleave.fastq.gz
tophat -o $outputDIR1/ -p 16 $index_DIR/dgl_COI_bwt_index $RNAseq_leaves_interleave

# convert junction bed file from the first run:
junction_bedFile_PATH=$outputDIR1/junctions.bed
cat $junction_bedFile_PATH | python2 /NetScratch/cpichot/.conda/envs/tophat/bin/bed_to_juncs > $outputDIR1/junctions_parsed.bed

RNAseq_roots_interleave=$RNAseq_files_DIR/SRR1664818_Pisum_sativum_cv_Cameor_Root_system_paired_end_library_stage_A_High-nitrate_Hydroponics_readNameChanged_interleave.fastq.gz
tophat -j $outputDIR1/junctions_parsed.bed -o $outputDIR2/ -p 16 $index_DIR/dgl_COI_bwt_index $RNAseq_roots_interleave

```
Finally I wanted to filter the bam by following these commands:

``bash
# Filtering RNA-seq alignment:
conda activate samtools

align_results_bam_leaves_PATH=$outputDIR1/accepted_hits.bam
align_results_bam_root_PATH=$outputDIR2/accepted_hits.bam

samtools sort -n $align_results_bam_leaves_PATH > $outputDIR1/accepted_hits.s

samtools sort -n $align_results_bam_root_PATH > $outputDIR2/accepted_hits.s

# filter alignments with filterBam: # do not work at this time !!!!!!
filterBam --uniq --paired --in $outputDIR1/accepted_hits.s --out $outputDIR1/accepted_hits.sf.bam

filterBam --uniq --paired --in $outputDIR2/accepted_hits.s --out $outputDIR2/accepted_hits.sf.bam
```
However, when I try to do the filtering I get a segmentation fault error

Do you have any suggestions? Did I prepare the fastq wrong?

Thanks in advance for your help

best regards,

Clement
mehlan
Site Admin
Posts: 8
Joined: Mon Oct 14, 2019 2:24 pm

Re: Filterbam error of segmentation fault

Post by mehlan »

As far as I can see, the problem is a segmentation fault in the execution of line

Code: Select all

filterBam --uniq --paired --in $outputDIR1/accepted_hits.s --out $outputDIR1/accepted_hits.sf.bam
I don't know what is going wrong.
  • You can try with

    Code: Select all

    filterBam --verbose --uniq --paired --in $outputDIR1/accepted_hits.s --out $outputDIR1/accepted_hits.sf.bam
    to learn more.
  • You can try with

    Code: Select all

    samtools sort -n -o $outputDIR1/accepted_hits.s.bam $outputDIR1/accepted_hits.bam
    filterBam --uniq --paired --in $outputDIR1/accepted_hits.s.bam --out $outputDIR1/accepted_hits.sf.bam
    Note the ".bam" name extension in the sorted bam file.
  • You can help the developers to fix the bug by sending a file accepted_hits.s to the developers. For this you can use the possibility to create a new issue in https://github.com/Gaius-Augustus/Augustus/issues and attach accepted_hits.s as zipped file there (maximum file size is 25 MB - Please use the smallest accepted_hits.s that causes this error)
    Please specify the output/error message of the filterBam execution too.
clement
Posts: 2
Joined: Thu Jan 05, 2023 3:26 pm

Re: Filterbam error of segmentation fault

Post by clement »

Hi mehlan,

thanks for your quick response.

I have check all recommendation, I still have the issue of segmentation fault.
Here you have the terminal output of the filterbam command with --verbose option:

```bash
filterBam --verbose --uniq --in $outputDIR1/accepted_hits.s.bam --out $outputDIR1/accepted_hits.sf.bam
------------------------------------------------
Selected options are:
best=0
help=0
noIntrons=0
paired=0
uniq=1
verbose=1
pairwiseAlignments=0
Input file: /NetScratch/FLOCAD/cpichot/genome_assembling/2-geneAnnotation/topHat_out_leaves/accepted_hits.s.bam
Output file: /NetScratch/FLOCAD/cpichot/genome_assembling/2-geneAnnotation/topHat_out_leaves/accepted_hits.sf.bam
insertLimit=10
maxIntronLen=500000
minCover=80
minId=92
minIntronLen=35
uniqThresh=0.96
commonGeneFile=
pairBedFile=
------------------------------------------------
Erreur de segmentation (segmentation fault)



#### test with paired option:


filterBam --verbose --uniq --paired --in $outputDIR1/accepted_hits.s.bam --out $outputDIR1/accepted_hits.sf.bam
------------------------------------------------
Selected options are:
best=0
help=0
noIntrons=0
paired=1
uniq=1
verbose=1
pairwiseAlignments=0
Input file: /NetScratch/FLOCAD/cpichot/genome_assembling/2-geneAnnotation/topHat_out_leaves/accepted_hits.s.bam
Output file: /NetScratch/FLOCAD/cpichot/genome_assembling/2-geneAnnotation/topHat_out_leaves/accepted_hits.sf.bam
insertLimit=10
maxIntronLen=500000
minCover=80
minId=92
minIntronLen=35
uniqThresh=0.96
commonGeneFile=
pairBedFile=
------------------------------------------------
Erreur de segmentation

```
I will open an issue on the github and put in attachment my bamfile.

Do you have any Idea?

Thanks in advance
janice
Posts: 1
Joined: Tue Apr 04, 2023 6:20 am
Contact:

Re: Filterbam error of segmentation fault

Post by janice »

load the core file into GDB, do a backtrace, move into the scope of your code, and list the lines of code that caused the segmentation fault.
Post Reply