Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault with hmm_flagger #48

Open
jkfo002 opened this issue Jan 6, 2025 · 4 comments
Open

Segmentation fault with hmm_flagger #48

jkfo002 opened this issue Jan 6, 2025 · 4 comments

Comments

@jkfo002
Copy link

jkfo002 commented Jan 6, 2025

Hi, @mobinasri

I am running flagger v1.2 with singularity container, but end up with hmm_flagger segementaion fault. Could you help me what happened here ?

Command

singularity=~/00_biosoft/singularity-ce-3.10.3/bin/singularity
flagger=~/00_biosoft/

cat hap1.fa hap2.fa > hapall.fa
seqkit sort -nN hapall.fa > hapall_sorted.fa
samtools faidx hapall_sorted.fa
cat hapall_sorted.fa.fai | awk '{print $1"\t0\t"$2}' > whole_genome.bed

minimap2 -t 20 -ax map-hifi -k 21 hapall_sorted.fa hifi.fa | samtools view -hb | samtools sort - > 334_sorted.bam
samtools index 334_sorted.bam

# Convert BAM to COV
echo "{" > annotations_path.json
echo \"whole_genome\" : \"${PWD}/whole_genome.bed\" >> annotations_path.json
echo "}" >> annotations_path.json
singularity exec -B 'pwd' flagger_v1.2.sif \
bam2cov --bam 334_sorted.bam \
--output coverage_file.cov.gz \
--annotationJson annotations_path.json \
--threads 16 \
--baselineAnnotation whole_genome

# hmm_flagger
mkdir -p hmm_flagger_outputs
singularity exec -B 'pwd' flagger_v1.2.sif \
hmm_flagger --input coverage_file.cov.gz \
--outputDir hmm_flagger_outputs  \
--alphaTsv /home/programs/config/alpha_optimum_trunc_exp_gaussian_w_4000_n_50.tsv \
--labelNames Err,Dup,Hap,Col \
--threads 16

log

{
"whole_genome" : "/public/agis/huangsanwen_group/daijichen/01_run/flagger/334/whole_genome.bed"
}
[2025-01-06 18:56:04] Parsed annotation whole_genome:/public/agis/huangsanwen_group/daijichen/01_run/flagger/334/whole_genome.bed
[2025-01-06 18:56:04] Number of created annotation block tables = 2
[2025-01-06 18:56:04] Added annotation blocks to coverage block tables: tot_len=4519929413, number=10540557
[2025-01-06 18:56:04] Started sorting and merging blocks
[2025-01-06 18:56:06] Blocks before merging : tot_len=4519929413, number=10540557
[2025-01-06 18:56:07] Created final block table : tot_len=1506657645, number=10540563
{
"whole_genome" : "/public/agis/huangsanwen_group/daijichen/01_run/flagger/334/whole_genome.bed"
}
[2025-01-06 18:56:08] Number of annotations added to the blocks table (+1 for 'no_annotation' which is a reserved annotation name for blocks with no annotation): 2
[2025-01-06 18:56:08] Bias detection is disabled. Running bias module only for getting the whole genome median coverage.
[2025-01-06 18:56:09] Whole genome median coverage = 62
[2025-01-06 18:56:18] Started writing to coverage_file.cov.gz.
[2025-01-06 18:56:46] Done.
Real time: 362.365 sec; CPU: 1593.146 sec; Peak RSS: 4.666 GB; CPU usage: 439.7%
INFO: Cleaning up image...
INFO: Converting SIF file to temporary sandbox...
[2025-01-06 18:57:03] Parsing/Creating coverage chunks.
[2025-01-06 18:57:03] The given input file is not binary so chunks will be constructed from cov file.
[2025-01-06 18:57:03] Index file does not exist: expected path coverage_file.cov.gz.index
[2025-01-06 18:57:03] Constructing index in memory ...
[2025-01-06 18:57:15] Index is constructed.
[2025-01-06 18:57:15] Index file (coverage_file.cov.gz.index) is written
[2025-01-06 18:57:15] Index is saved into coverage_file.cov.gz.index (It will skip index construction for next runs).
[2025-01-06 18:57:15] Parsing header info for ChunksCreator.
[2025-01-06 18:57:18] Truth tag was set to false (or not defined) so truth labels will not be parsed from file.
[2025-01-06 18:57:18] Prediction tag was set to false (or not defined) so prediction labels will not be parsed from file.
[2025-01-06 18:57:18] Creating empty chunks.
[2025-01-06 18:57:18] Created a thread pool with 10 threads for parsing chunks
[2025-01-06 18:57:18] Queued 64 jobs for the thread pool (no more than 10 jobs will be processed at a time)
[2025-01-06 18:58:31] Chunks are constructed from cov file.
[2025-01-06 18:58:31] 64 chunks are parsed covering total length of 1506657645 bases.
[2025-01-06 18:58:31] Determining the number of components for the 'collapsed' state.
[2025-01-06 18:58:31] The number of collapsed components (n=5) is determined and adjusted automatically by taking the maximum observed coverage.
[2025-01-06 18:58:31] Creating HMM model.
INFO: Cleaning up image...
/var/spool/slurm/d/job17358112/slurm_script: line 111: 32694 Segmentation fault (core dumped) $singularity exec -B pwd $flagger hmm_flagger --input coverage_file.cov.gz --outputDir hmm_flagger_outputs --alphaTsv /home/programs/config/alpha_optimum_trunc_exp_gaussian_w_4000_n_50.tsv --labelNames Err,Dup,Hap,Col --threads 10

Coverge file
coverage_file.cov.head10000.gz

@mobinasri
Copy link
Owner

@jkfo002 Are you using mobinasri/flagger:v1.2.0-dev this is still in development. your coverage file looked fine to me. Could you please provide the full coverage file?

@jkfo002
Copy link
Author

jkfo002 commented Jan 14, 2025

@mobinasri
Copy link
Owner

Thanks @jkfo002 it seems that the link is not public. I just asked you to give permission.

@jkfo002
Copy link
Author

jkfo002 commented Jan 20, 2025

Sorry @mobinasri, please check again whether the link accessible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants