I have a bash script about HaplotypeCaller.sh. Is it possible to run this in gnu parallel ?

cat HaplotypeCaller.sh | parallel

    #!/bin/bash
    
    for i in *.bam; do 
    gatk --java-options "-Xmx40g" HaplotypeCaller -R /media/gatk/Homo_sapiens_assembly38.fasta -I $i -O $i.vcf.gz --dbsnp /media/gatk/dbsnp_138.hg38.vcf.gz -L /media/gatk/target/ag_V6_list.interval_list; done
nextflow (not tested)

    params.ref="/media/gatk/Homo_sapiens_assembly38.fasta"
    params.bams=""
    params.dbsnp="/media/gatk/dbsnp_138.hg38.vcf.gz"
    params.intervals="/media/gatk/target/ag_V6_list.interval_list"
    
    Channel.fromPath(params.bams).splitCsv(header: false,sep:',',strip:true).map{T->file(T[0])}.set{bamfiles}
    
    process hapCaller {
    tag "${bam.name}"
    memory "40g"
    input:
       file bam from bamfiles
    output:
       file("${bam.getBaseName()}.vcf.gz") into vcf
    script:
    """
    gatk --java-options " -Xmx${task.memory.giga}g -Djava.io.tmpdir=." HaplotypeCaller \
        -R ${params.ref} \
        -I {bam.toRealPath()} \
        -O "${bam.getBaseName()}.vcf.gz" \
        --dbsnp "${params.dbsnp}" \
        -L "${params.intervals}"
    """
    }