nygenome / lancet

Microassembly based somatic variant caller for NGS data
Other
153 stars 33 forks source link

Lancet could not open tumor BAM file #52

Closed AldhairMedico closed 2 years ago

AldhairMedico commented 2 years ago

Hi, I've been using GATK and Lancet for a few months and I had no issues overall. However, suddenly with a new set of samples (which I follow exactly the same protocol) Lancet just couldn't run and I don't know why.

The code is:

for chrom in $chromosomes; do echo "\n### Analyzing SNVs/Indels of chromosome: $chrom for $comparison_name'_BWA_MEM'" $lancet \ --tumor $bam_calibrated_dir/T9_BWA_MEM_calibrated.bam \ --normal $bam_calibrated_dir/N4_BWA_MEM_calibrated.bam \ --ref $ref_genome_gatk \ --reg $chrom \ --num-threads 8 > $lancet_results_dir/'N4_T9_BWA_MEM_'${chrom}.vcf done

And the output is just:

Analyzing SNVs/Indels of chromosome: chr1 for '_BWA_MEM'

Could not open tumor BAM file.

Do you have any clue what could be wrong? As I said, I used the same protocol with other samples with no issued at all.

Thanks for your time Aldhair

gnarzisi commented 2 years ago

Hi Aldhair,

unfortunately the reported problem is hard to debug without further info. Failure to open the BAM file could be due to various reasons. The problem could be as simple as passing a non-existing file, or a missing index file, or some issue with the header. Are you able to read/open the same BAM file with other tools (e.g., samtools)?

AldhairMedico commented 2 years ago

Yes, in fact, I already run other variant callers using these BAMs. I´m gonna check if re-indexing these files solve the problem or if it´s something wrong with headers. If still does not work, is there some internal log file or something to get more info about it?

gnarzisi commented 2 years ago

The "Could not open tumor BAM file" error is the result of a direct call to BamReader from the Bamtools API (https://github.com/pezmaster31/bamtools), so there is no internal log I can point you to unfortunately. Please let us know if you solve the problem.

AldhairMedico commented 2 years ago

I can finally confirm that the problem was in the BAM indexing, apparently, during the BAI file generation the process was suddenly stopped and the indexes were incomplete. Lancet was incapable of reading corrupted BAIs.