Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Alignment is not BAM or CRAM file #71

Open
daisyyr opened this issue May 24, 2024 · 4 comments
Open

Alignment is not BAM or CRAM file #71

daisyyr opened this issue May 24, 2024 · 4 comments

Comments

@daisyyr
Copy link

daisyyr commented May 24, 2024

Hi, I am trying to run cgpwgs within docker on my own data. Here is my code:

export CGPWGS_VERSION=2.1.1
docker run  --rm  \
-w myworkpath/Project \
	  -v myworkpath/:myworkpath/ \
	  -v myworkpath/PublicDB/gatkBundle/:myworkpath/PublicDB/gatkBundle/ \
	  -v myworkpath/publicDB/dockstore_cpgwgs_ref/:myworkpath/publicDB/dockstore_cpgwgs_ref/\
quay.io/wtsicgp/dockstore-cgpwgs:$CGPWGS_VERSION \
ds-cgpwgs.pl \
-r myworkpath/publicDB/dockstore_cpgwgs_ref \
-a myworkpath/publicDB/dockstore_cpgwgs_ref \
-si myworkpath/publicDB/dockstore_cpgwgs_ref \
-cs myworkpath/publicDB/dockstore_cpgwgs_ref \
-qc myworkpath/publicDB/dockstore_cpgwgs_ref \
-pl 3.65 -pu 1.0 \
-e 'MT,GL%,hs37d5,NC_007605' \
-t $tumor_bam \
-tidx $tumor_bai \
-n $normal_bam \
-nidx $normal_bai \
-sp homo_sapiens \
-c 10 \
-as myworkpath/PublicDB/gatkBundle/hg38/Homo_sapiens_assembly38.fasta \
-o $out_dir 

And it got errors as follows:

Options loaded:
$VAR1 = {
          'cr' => 350000,
          'sp' => 'homo_sapiens',
          't' => 'myworkpath/Project/Project_tumor/basic_analysis/mutect2_bam/M1609.bam',
          'qc' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'si' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'e' => 'MT,GL%,hs37d5,NC_007605',
          'wt_sm' => 'T1609B',
          'c' => 10,
          'n' => 'myworkpath/Project/Project_tumor/basic_analysis/mutect2_bam/T1609B.bam',
          'pc' => 8,
          'tidx' => 'myworkpath/Project/Project_tumor/basic_analysis/mutect2_bam/M1609.bai',
          'o' => 'myworkpath/Project/Project_tumor_downstream/dockstore_cpgwgs/M1609_out/',
          'as' => 'myworkpath/PublicDB/gatkBundle/hg38/Homo_sapiens_assembly38.fasta',
          'nidx' => 'myworkpath/Project/Project_tumor/basic_analysis/mutect2_bam/T1609B.bai',
          'pu' => '1.0',
          'mt_sm' => 'M1609',
          'r' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'a' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'pi' => '3.65',
          'cs' => 'myworkpath/publicDB/dockstore_cpgwgs_ref'
        };


Start workflow: Fri May 24 05:35:32 UTC 2024

Loading user options from: myworkpath/Project/Project_tumor_downstream/dockstore_cpgwgs/M1609_out//run.params
	BAM_MT : myworkpath/Project/Project_tumor/basic_analysis/mutect2_bam/M1609.bam
	BAM_WT : myworkpath/Project/Project_tumor/basic_analysis/mutect2_bam/T1609B.bam
	NAME_MT : M1609
	NAME_WT : T1609B
Alignment is not BAM or CRAM file: $

And the bam file was generated by GATK4 pipeline after mapping, sorting, removing duplicates and BaseRecalibration. I further check bam file, founding that all bam files are ok.
image

Any advice on how to fix this? Looking forward to your reply!

Thanks!

@AndyMenzies
Copy link

GATK BaseRecalibration is almost certainly the issue. Most of our tools are written to use Illumina standard quality scores, BaseRecalibration will push the quality scores well outside the expected ranges. This will cause it to throw file format errors as it will think the file is either corrupt or malformed.

@daisyyr
Copy link
Author

daisyyr commented May 29, 2024

GATK BaseRecalibration is almost certainly the issue. Most of our tools are written to use Illumina standard quality scores, BaseRecalibration will push the quality scores well outside the expected ranges. This will cause it to throw file format errors as it will think the file is either corrupt or malformed.

Thank you for your quick reply! I attempted to use the BAM files before BaseRecalibration, which had only undergone BWA MEM mapping, SortSam, and MarkDuplicates. Unfortunately, I still encountered the same errors. What might be the problems?

Options loaded:
$VAR1 = {
          'wt_sm' => 'T1609B',
          'pc' => 8,
          'qc' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'cr' => 350000,
          'si' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'a' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'r' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'n' => 'myworkpath/Project/Project_NB_4s/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam',
          'mt_sm' => 'M1609',
          'pu' => '1.0',
          'sp' => 'homo_sapiens',
          'pi' => '3.65',
          'as' => '/sibcb1/mxqianlab1/common/PublicDB/gatkBundle/hg38/Homo_sapiens_assembly38.fasta',
          'nidx' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bai',
          'c' => 10,
          'o' => 'myworkpath/Project/Project_tumor_downstream/dockstore_cpgwgs/M1609_out/',
          'cs' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'tidx' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/M1609_clean_dedup.bai',
          'e' => 'MT,GL%,hs37d5,NC_007605',
          't' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/M1609_clean_dedup.bam'
        };


Start workflow: Wed May 29 02:49:11 UTC 2024

Loading user options from: myworkpath/Project/Project_tumor_downstream/dockstore_cpgwgs/M1609_out//run.params
	BAM_MT : myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/M1609_clean_dedup.bam
	BAM_WT : myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam
	NAME_MT : M1609
	NAME_WT : T1609B
Alignment is not BAM or CRAM file: $

@sb43
Copy link
Member

sb43 commented May 29, 2024

It seems the BWA_WT: path is different from the one provided in in vars file:
'n' => 'myworkpath/Project/Project_NB_4s/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam',
'nidx' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bai',

BAM_WT : myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam

Commands expects bam and bai at same location.

is this intended?

@daisyyr
Copy link
Author

daisyyr commented May 29, 2024

It seems the BWA_WT: path is different from the one provided in in vars file: 'n' => 'myworkpath/Project/Project_NB_4s/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam', 'nidx' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bai',

BAM_WT : myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam

Commands expects bam and bai at same location.

is this intended?

Sorry for the misleading here. For confidentiality reasons, I have changed the folder names. But some of them were missed out. Anyway, it's actually in the same directory. The error should look like this:

Options loaded:
$VAR1 = {
          'wt_sm' => 'T1609B',
          'pc' => 8,
          'qc' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'cr' => 350000,
          'si' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'a' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'r' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'n' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam',
          'mt_sm' => 'M1609',
          'pu' => '1.0',
          'sp' => 'homo_sapiens',
          'pi' => '3.65',
          'as' => 'myworkpath/PublicDB/gatkBundle/hg38/Homo_sapiens_assembly38.fasta',
          'nidx' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bai',
          'c' => 10,
          'o' => 'myworkpath/Project/Project_tumor_downstream/dockstore_cpgwgs/M1609_out/',
          'cs' => 'myworkpath/publicDB/dockstore_cpgwgs_ref',
          'tidx' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/M1609_clean_dedup.bai',
          'e' => 'MT,GL%,hs37d5,NC_007605',
          't' => 'myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/M1609_clean_dedup.bam'
        };


Start workflow: Wed May 29 02:49:11 UTC 2024

Loading user options from: myworkpath/Project/Project_tumor_downstream/dockstore_cpgwgs/M1609_out//run.params
	BAM_MT : myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/M1609_clean_dedup.bam
	BAM_WT : myworkpath/Project/Project_tumor/basic_analysis/no_recal_bam/T1609B_clean_dedup.bam
	NAME_MT : M1609
	NAME_WT : T1609B
Alignment is not BAM or CRAM file: $

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

No branches or pull requests

3 participants