ApplyBQSR doesn't recognise my arguments?
AnsweredI'm trying to recalibrate some bam files using the following code. The first section is working fine and producing the table, but the ApplyBQSR command is giving the error below.
#!/bin/bash
module purge
module load picard/2.6.0-Java-1.8.0_131
module load GATK/4.0.5.1-foss-2018a-Python-3.6.4
## Set your master path
MASTER=/lustre/projects/Research_Project-T109423/ali/FIBR_transfer/ftp1.sequencing.exeter.ac.uk/V0085/11_trimmed/practiceSNP_calling
## Also add path to indexed reference and recalibration file
reference=/lustre/projects/Research_Project-XXXX/STAR/STAR.chromosomes.release.fasta
recal=/lustre/projects/Research_Project-XXXX/STAR/STAR_intersect_recal.vcf
bam_in=$MASTER/SNP_calling/bams/interim_bams
bam_out=$MASTER/SNP_calling/bams/clean_bams
metadata=$MASTER/SNP_calling/metaCA10.tsv
## This just catches the array in case it's running for a value with no individual (this screws with the outputs)
IND_N=$(cut -f2 $metadata | tail -n+2 | uniq | awk 'NF > 0' | wc -l)
if [ $SLURM_ARRAY_TASK_ID -le $IND_N ]
then
## In array ##
insampleID_array=( `cat $metadata | cut -f 2` )
insampleID=$bam_in/${insampleID_array[(($SLURM_ARRAY_TASK_ID))]}
## Out array
outsampleID_array=( `cat $metadata | cut -f 2` )
outsampleID=$bam_out/${outsampleID_array[(($SLURM_ARRAY_TASK_ID))]}
## Apply base quality score recalibration
## BaseRecal
gatk --java-options "-Xmx8g" BaseRecalibrator \
-I $insampleID.sorted.dups.bam \
-R $reference --known-sites $recal \
-O $outsampleID.table
## ApplyBQSR
gatk --java-options "-Xmx8g" ApplyBQSR
-I $insampleID.sorted.dups.bam \
-R $reference --bqsr-recal-file $outsampleID.table \
-O $outsampleID.recal.bam
## Index the recalibrated bam files
java -Xmx10g -jar $EBROOTPICARD/picard.jar BuildBamIndex \
I=$outsampleID.recal.bam VALIDATION_STRINGENCY=LENIENT
fi
***********************************************************************
A USER ERROR has occurred: Argument output was missing: Argument 'output' is required.
***********************************************************************
Set the system property GATK_STACKTRACE_ON_USER_EXCEPTION (--java-options '-DGATK_STACKTRACE_ON_USER_EXCEPTION=true') to print the stack trace.
Using GATK jar /lustre/shared/software/GATK/4.0.5.1-foss-2018a-Python-3.6.4/gatk-package-4.0.5.1-local.jar
Running:
java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -Xmx8g -jar /lustre/shared/software/GATK/4.0.5.1-foss-2018a-Python-3.6.4/gatk-package-4.0.5.1-local.jar ApplyBQSR
/var/spool/slurmd/job866408/slurm_script: line 127: -I: command not found
/var/spool/slurmd/job866408/slurm_script: line 129: -O: command not found
If I add a \ after "gatk --java-options "-Xmx8g" ApplyBQSR" I get the following error instead:
***********************************************************************Can anyone help me out? I'm not sure what I'm doing wrong at this point.
A USER ERROR has occurred: Invalid argument ' '.
***********************************************************************
Set the system property GATK_STACKTRACE_ON_USER_EXCEPTION (--java-options '-DGATK_STACKTRACE_ON_USER_EXCEPTION=true') to print the stack trace.
Using GATK jar /lustre/shared/software/GATK/4.0.5.1-foss-2018a-Python-3.6.4/gatk-package-4.0.5.1-local.jar
Running:
java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -Xmx8g -jar /lustre/shared/software/GATK/4.0.5.1-foss-2018a-Python-3.6.4/gatk-package-4.0.5.1-local.jar ApplyBQSR
/var/spool/slurmd/job866367/slurm_script: line 108: -I: command not found
-
I think this is an issue in your bash or slurm code. Could you try having the entire ApplyBQSR command on the same line and see if it works?
-
Thanks! I tried this yesterday but somehow an extra character must have still snuck in - I did it again just now and it seems to be working!
-
Great news! Thanks for the update!
Please sign in to leave a comment.
3 comments