bamdst icon indicating copy to clipboard operation
bamdst copied to clipboard

Error ocurrus when use bamdst to stat WGS bam file

Open yuanpingdu opened this issue 11 months ago • 4 comments

Hi, when I use bamdst to stat WGS file, the output file depth.tsv.gz just has the first chrosome result in the region file, and the task is stoped with no error information.How to slove it?

the target region: chr1 1 254717395 chr2 1 242636919 chr3 1 199957529 chr4 1 191432471 chr5 1 183988138 chr6 1 171967578 chr7 1 158872745 chr8 1 145796002 chr9 1 137877317 chr10 1 134863434 chr11 1 135971833 chr12 1 133770623 chr13 1 105970862 chr14 1 98522907 chr15 1 94829848 chr16 1 90698698 chr17 1 83813795 chr18 1 80489117 chr19 1 62832331 chr20 1 66744663 chr21 1 45247884 chr22 1 50276510 chrX 1 157365100 chrY 1 65593761 chrM 1 16571

the run command: bamdst -p /ref/CN1.chr.region -1 -o /work/WGS6/ --maxdepth 10000000000 --isize 1000000000 -f 0 /work/WGS6/WGS6.sort.dup.bam

yuanpingdu avatar Mar 05 '24 08:03 yuanpingdu

the output depth.tsv.gz just has chr1 information and region.tsv.gz is null ,the other 3 files was not create.

yuanpingdu avatar Mar 05 '24 08:03 yuanpingdu

I think the process has killed because out of memory. Try to split each chromosome into small pieces.

shiquan avatar Mar 05 '24 10:03 shiquan

I have used chr1 and chr2 to test in a target file, and split each chromosome into 100bp for each region, but still the same errors that only chr1 results and region.tsv.gz is null ,the other 3 files was not create.

the target region: chr1 1 100 chr1 101 200 chr1 201 300 chr1 301 400 ... chr1 254717201 254717300 chr1 254717301 254717395 chr2 1 100 chr2 101 200 chr2 201 300 ... chr2 242636801 242636900 chr2 242636901 242636919

the output depth.tsv.gz file is not a normal gz file: gzip -dc WGS6/depth.tsv.gz|tail -3

gzip: WGS6/depth.tsv.gz: unexpected end of file chr1 254717394 0 0 0 chr1 254717395 0 0 0

yuanpingdu avatar Mar 07 '24 00:03 yuanpingdu

Try to divide the chromosome region into 1M pieces. If it's still not works, plz send your bed file to my email, I will check it. [email protected]

shiquan avatar Mar 07 '24 12:03 shiquan

Hello, @shiquan Version: 1.0.9 I get a 1M window bed file here, but the error still shows.

$ bedtools makewindows -b ucsc.hg19.WGS.bed -w 1000000 > ucsc.hg19.fasta.1000000.bed
$ bamdst/bamdst -o xxx -p ucsc.hg19.fasta.1000000.bed WGS.bam
@@ ERROR ABORT @@ 
[NeedMEM] trying to allocate 997002480 bytes (limits: 500000000)

And the bed file, ucsc.hg19.fasta.1000000.bed.txt

Best, xiucz

xiucz avatar May 24 '24 03:05 xiucz

@xiucz make sure it should be at least 1bp for nearby regions. Because bamdst will merge the bed file before read counting. I didn't test the following command but it should work.

bedtools makewindows -b ucsc.hg19.WGS.bed -w 1000000 | awk -vOFS='\t' '{end =$3-1; print $1, $2, end}'> ucsc.hg19.fasta.1000000.bed

shiquan avatar May 24 '24 12:05 shiquan

It works now, thank you!

xiucz avatar May 28 '24 03:05 xiucz