class: Workflow cwlVersion: v1.2 id: >- bristol-myers-squibb/integrated-wes-wgs-production-ready-pipelines/wes-alignment-translational/13 doc: >- Pipeline to perform alignment on fastq files and produce deduplicated, realigned and recalibrated BAM files. It uses BWA (alt aware) on each separate Read group (equivalent to lanes for most cases) and then MarkDuplicates (picard) to merge and dedup the BAM files. Sentieon Realign and Recalibrate are used to produce the final output label: WES alignment (Translational) $namespaces: sbg: 'https://sevenbridges.com' inputs: - id: inputFastq1 'sbg:fileTypes': 'FASTQ, FASTQ.GZ, FQ, FQ.GZ' type: 'File[]' label: Input reads 1 doc: Input reads for FASTQ paired end 1. 'sbg:x': -310.4539794921875 'sbg:y': 1612.429443359375 - id: inputFastq2 'sbg:fileTypes': 'FASTQ, FASTQ.GZ, FQ, FQ.GZ' type: 'File[]?' label: Input reads 2 doc: Input reads for FASTQ paired end 2. 'sbg:x': -297.9209289550781 'sbg:y': 1321.56982421875 - id: TargetRegions 'sbg:fileTypes': 'BED, INTERVALS' type: File label: Target regions doc: Target regions in BED/INTERVALS format. 'sbg:x': -76.06531524658203 'sbg:y': 504.5608215332031 - id: referenceGenomeSequence 'sbg:fileTypes': 'FASTA, FA' type: File label: Reference genome sequence doc: Reference genome sequence. 'sbg:x': -80.50225067138672 'sbg:y': 939.9234008789062 - id: dbsnp 'sbg:fileTypes': 'VCF.GZ, VCF' type: File label: dbSNP database doc: dbSNP database in VCF.GZ format. secondaryFiles: - pattern: .tbi required: true 'sbg:x': -84.18468475341797 'sbg:y': 2101.858154296875 - id: knownIndelSites 'sbg:fileTypes': 'VCF.GZ, VCF' type: File label: Known INDELs Sites doc: Known INDELs sites in VCF.GZ format. secondaryFiles: - pattern: .tbi required: true 'sbg:x': -80.39639282226562 'sbg:y': 813.0157470703125 - id: TargetCCDS 'sbg:fileTypes': 'INTERVALS, BED' type: File label: Target CCDS doc: CCDS intervals file. 'sbg:x': -72.38288116455078 'sbg:y': 661.6666870117188 - id: COSMIC 'sbg:fileTypes': 'INTERVALS, BED' type: File label: Cosmic coding intervals doc: Cosmic coding intervals. 'sbg:x': -84.07882690429688 'sbg:y': 2243.4345703125 - id: genotypingSNPs 'sbg:fileTypes': 'INTERVALS, BED' type: File label: Genotyping SNPs intervals doc: Interval file for genotyping SNPs in Sentieon Haplotyper. 'sbg:x': -84.18468475341797 'sbg:y': 1967.9639892578125 - id: bait_set_name type: string? label: Bait set name doc: Name of bait set. 'sbg:x': -84.07882690429688 'sbg:y': 2396.48193359375 - id: licsrvr_host_and_port type: string label: License server host and port doc: >- License server host and port in the format (HOST:PORT) (parentheses omitted). 'sbg:x': -72.46151733398438 'sbg:y': 1086.0606689453125 - id: bait_bed 'sbg:fileTypes': BED type: File label: Bait BED file doc: >- A BED file that contains the locations of the baits used. Default value: null. This option must be specified at least 1 times. 'sbg:x': -86.39502716064453 'sbg:y': 2541.333984375 - id: BWAReference 'sbg:fileTypes': TAR.GZ type: File label: Reference TAR doc: Reference directory with all BWA indices. 'sbg:x': -80.3115005493164 'sbg:y': 1841.415283203125 outputs: - id: MarkDuplicateMetrics outputSource: - bms_rename_app_duplicate_metrics/out_file 'sbg:fileTypes': QCSTATS type: File label: Duplicate metrics doc: Duplicate metrics for the combined BAM file 'sbg:x': 1732.9814453125 'sbg:y': 2149.943115234375 - id: LaneDistrMetrics outputSource: - fastq_qc/LaneDistrMetrics 'sbg:fileTypes': QCSTATS type: File label: Lane Distribution Metrics doc: Number of reads per lane. 'sbg:x': 678.134765625 'sbg:y': 201.0884552001953 - id: FastqQCMetrics outputSource: - fastq_qc/FastqQCMetrics 'sbg:fileTypes': ZIP type: 'File[]' label: FASTQC Metrics doc: FASTQC Metrics. 'sbg:x': 680.5663452148438 'sbg:y': 376.1789855957031 - id: CutadaptMetrics outputSource: - fastq_qc/CutadaptMetrics 'sbg:fileTypes': QCSTATS type: File label: Cutadapt Metrics doc: Cutadapt Metrics. 'sbg:x': 675.5894775390625 'sbg:y': 640.9263916015625 - id: RecalibrationTable outputSource: - bms_rename_app_tbl/out_file 'sbg:fileTypes': TBL type: File label: Recalibration table doc: Recalibration table. 'sbg:x': 3145.373779296875 'sbg:y': 306 - id: RecalibratedBAM outputSource: - set_sex_metadata/out_alignments 'sbg:fileTypes': BAM type: File label: Recalibrated BAM doc: >- BAM file with recalibrated quality values. This is intented to be used in downstream analyses. 'sbg:x': 3343.07666015625 'sbg:y': 474.9581604003906 - id: PostRecalibrationTable outputSource: - bms_rename_app_post_recal_tbl/out_file 'sbg:fileTypes': TBL type: File label: Post recalibration table doc: Post recalibration table. 'sbg:x': 3153.57373046875 'sbg:y': 626.7271118164062 - id: GenotypingGVCF outputSource: - bms_rename_app_genotyping_gvcf/out_file 'sbg:fileTypes': 'VCF, VCF.GZ' type: File label: Genotyping gVCF doc: Genotyping gVCF. 'sbg:x': 1892.8443603515625 'sbg:y': 1850.9195556640625 - id: MarkDuplicatesMetrics_QC outputSource: - bms_rename_app_deduplication_per_lane/out_file 'sbg:fileTypes': QCSTATS type: File label: Mark Duplicates Metrics per lane QC doc: Duplicate metrics per lane. 'sbg:x': 1718.4473876953125 'sbg:y': 817 - id: TargetWESMetrics outputSource: - wes_align_basic/TargetWESMetrics 'sbg:fileTypes': QCSTATS type: File? label: Target WES Metrics doc: Target Metrics. 'sbg:x': 2301.30029296875 'sbg:y': -308.6173400878906 - id: SexPrediction outputSource: - wes_align_basic/SexPrediction type: string? label: Sex prediction doc: >- Sex prediction based on coverage of non pseudo autosomal regions of sex chromosomes. 'sbg:x': 2305.322998046875 'sbg:y': -173.9722900390625 - id: SexDetermMetrics outputSource: - wes_align_basic/SexDetermMetrics 'sbg:fileTypes': QCSTATS type: File label: Sex Determination Metrics doc: Sex determination metrics. 'sbg:x': 2303.841064453125 'sbg:y': -38.21811294555664 - id: QualityYieldMetrics outputSource: - wes_align_basic/QualityYieldMetrics 'sbg:fileTypes': QUALITY_YIELD_METRICS type: File label: Quality Yield Metrics doc: Quality Yield Metrics. 'sbg:x': 2311.575439453125 'sbg:y': 86.70088195800781 - id: QualityDistributionPDF outputSource: - wes_align_basic/QualityDistributionPDF 'sbg:fileTypes': PDF type: File label: Quality Distribution PDF doc: Quality Distribution PDF. 'sbg:x': 2320.90869140625 'sbg:y': 512.3814086914062 - id: QualityDistributionMetrics outputSource: - wes_align_basic/QualityDistributionMetrics 'sbg:fileTypes': QUALITY_DISTRIBUTION_METRICS type: File label: Quality Distribution Metrics doc: Quality Distribution Metrics. 'sbg:x': 2319.5908203125 'sbg:y': 626.8306884765625 - id: QualityCyclePDF outputSource: - wes_align_basic/QualityCyclePDF 'sbg:fileTypes': PDF type: File label: Quality Cycle PDF doc: Quality Cycle PDF. 'sbg:x': 2316.621337890625 'sbg:y': 756.5660400390625 - id: QualityCycleMetrics outputSource: - wes_align_basic/QualityCycleMetrics 'sbg:fileTypes': QUALITY_BY_CYCLE_METRICS type: File label: Quality Cycle Metrics doc: Quality Cycle Metrics. 'sbg:x': 2321.141845703125 'sbg:y': 872.0082397460938 - id: PreAdapterSummaryMetrics outputSource: - wes_align_basic/PreAdapterSummaryMetrics 'sbg:fileTypes': PRE_ADAPTER_SUMMARY_METRICS type: File label: PreAdapter Summary Metrics doc: PreAdapter Summary Metrics. 'sbg:x': 2321.1884765625 'sbg:y': 994.302490234375 - id: PreAdapterDetailMetrics outputSource: - wes_align_basic/PreAdapterDetailMetrics 'sbg:fileTypes': PRE_ADAPTER_DETAIL_METRICS type: File label: PreAdapter Detail Metrics doc: PreAdapter Detail Metrics. 'sbg:x': 2321.607177734375 'sbg:y': 1107.984619140625 - id: OxogMetrics outputSource: - wes_align_basic/OxogMetrics 'sbg:fileTypes': OXOG_METRICS type: File label: OxoG Metrics doc: OxoG Metrics. 'sbg:x': 2321.272216796875 'sbg:y': 1238.9603271484375 - id: InsertSizeMetrics outputSource: - wes_align_basic/InsertSizeMetrics 'sbg:fileTypes': QCSTATS type: File label: Insert Size metrics doc: Insert Size metrics. 'sbg:x': 2329.392578125 'sbg:y': 1376.24072265625 - id: InsertSizeChart outputSource: - wes_align_basic/InsertSizeChart 'sbg:fileTypes': PDF type: File label: Insert Size chart doc: Insert Size chart. 'sbg:x': 2335.90283203125 'sbg:y': 1512.6962890625 - id: HsMetrics outputSource: - wes_align_basic/HsMetrics 'sbg:fileTypes': QCSTATS type: File? label: HS Metrics output doc: HS (Hybrid selection) Metrics. 'sbg:x': 2334.686767578125 'sbg:y': 1653.0806884765625 - id: HsCOSMICMetrics outputSource: - wes_align_basic/HsCOSMICMetrics 'sbg:fileTypes': QCSTATS type: File? label: HS Metrics on Comsic doc: HS (Hybrid Selection) Metrics on Cosmic. 'sbg:x': 2347.2353515625 'sbg:y': 1790.17236328125 - id: HsCCDSMetrics outputSource: - wes_align_basic/HsCCDSMetrics 'sbg:fileTypes': QCSTATS type: File? label: HS Metrics on CCDS doc: HS (Hybrid Selection) Metrics on CCDS. 'sbg:x': 2348 'sbg:y': 1925.2886962890625 - id: GCBiasSummaryMetrics outputSource: - wes_align_basic/GCBiasSummaryMetrics 'sbg:fileTypes': SUMMARY_METRICS type: File label: GC Bias Summary Metrics doc: GC Bias Summary Metrics. 'sbg:x': 2360.19970703125 'sbg:y': 2062.6005859375 - id: GCBiasPDF outputSource: - wes_align_basic/GCBiasPDF 'sbg:fileTypes': PDF type: File label: GCBias PDF doc: GCBias PDF. 'sbg:x': 2363.528076171875 'sbg:y': 2194.760498046875 - id: AlignmentSummaryMetrics outputSource: - wes_align_basic/AlignmentSummaryMetrics 'sbg:fileTypes': ALIGNMENT_SUMMARY_METRICS type: File label: Alignment Summary Metrics doc: Alignment Summary Metrics. 'sbg:x': 2372.1669921875 'sbg:y': 2602.4150390625 - id: GCBiasDetailMetrics outputSource: - wes_align_basic/GCBiasDetailMetrics 'sbg:fileTypes': DETAIL_METRICS type: File label: GC Bias Detail Metrics doc: GC Bias Detail Metrics. 'sbg:x': 2367.05615234375 'sbg:y': 2334.84814453125 - id: ErrorSummaryMetrics outputSource: - wes_align_basic/ErrorSummaryMetrics 'sbg:fileTypes': ERROR_SUMMARY_METRICS type: File label: Error Summary Metrics doc: Error Summary Metrics. 'sbg:x': 2375.995849609375 'sbg:y': 2464.924072265625 - id: COSMICWESMetrics outputSource: - wes_align_basic/COSMICWESMetrics 'sbg:fileTypes': QCSTATS type: File? label: Target metrics on COSMIC sites doc: Target metrics on Cosmic file. 'sbg:x': 2378.991455078125 'sbg:y': 2748.59326171875 - id: CollectAlnMetrics outputSource: - wes_align_basic/CollectAlnMetrics 'sbg:fileTypes': QCSTATS type: File label: Collect alignment metrics doc: Collect alignment metrics. 'sbg:x': 2862.25 'sbg:y': 1130.2454833984375 - id: CCDSWESMetrics outputSource: - wes_align_basic/CCDSWESMetrics 'sbg:fileTypes': QCSTATS type: File? label: Target metrics on CCDS doc: Target metrics on CCDS. 'sbg:x': 2868.083251953125 'sbg:y': 1275.9952392578125 - id: BigWig outputSource: - wes_align_basic/BigWig 'sbg:fileTypes': BW type: File? label: BigWig doc: Big WIG file. 'sbg:x': 2871.66650390625 'sbg:y': 1433.828857421875 - id: BaseDistributionCyclePDF outputSource: - wes_align_basic/BaseDistributionCyclePDF 'sbg:fileTypes': PDF type: File label: Base Distribution Cycle PDF doc: Base Distribution Cycle PDF. 'sbg:x': 2878.163330078125 'sbg:y': 1561.5750732421875 - id: BaseDistributionCycleMetrics outputSource: - wes_align_basic/BaseDistributionCycleMetrics 'sbg:fileTypes': BASE_DISTRIBUTION_BY_CYCLE_METRICS type: File label: Base Distribution Cycle Metrics doc: Base Distribution Cycle Metrics. 'sbg:x': 2879.7490234375 'sbg:y': 1689.41015625 - id: BamIndexMetrics outputSource: - wes_align_basic/BamIndexMetrics 'sbg:fileTypes': 'TXT, QCSTATS' type: File label: BAM Index Metrics doc: BAM Index Metrics. 'sbg:x': 2885.4169921875 'sbg:y': 1827.4273681640625 - id: BaitBiasSummaryMetrics outputSource: - wes_align_basic/BaitBiasSummaryMetrics 'sbg:fileTypes': BAIT_BIAS_SUMMARY_METRICS type: File label: Bait Bias Summary Metrics doc: Bait Bias Summary Metrics. 'sbg:x': 2892.582763671875 'sbg:y': 1969.9986572265625 - id: BaitBiasDetailMetrics outputSource: - wes_align_basic/BaitBiasDetailMetrics 'sbg:fileTypes': BAIT_BIAS_DETAIL_METRICS type: File label: Bait Bias Detail Metrics doc: Bait Bias Detail Metrics. 'sbg:x': 2894.915771484375 'sbg:y': 2107.5771484375 - id: out_all_metrics_zip outputSource: - bms_rename_app/out_file 'sbg:fileTypes': ZIP type: File label: Output all metrics ZIP file doc: All zipped metrics. 'sbg:x': 3569.73291015625 'sbg:y': 881.11279296875 steps: - id: bwa in: - id: inputFastq1 source: fastqsplit_1/outputFastq1 - id: threads default: 16 - id: reference_tar source: BWAReference - id: soft_clipping default: true - id: rg_id source: fastqsplit_1/outputRGID - id: rg_platform source: fastqsplit_1/outputRGPL - id: rg_library source: fastqsplit_1/outputRGLB - id: rg_platformunit source: fastqsplit_1/outputRGID - id: rgheader default: true - id: postalt default: true - id: sample_name source: fastqsplit_1/outputRGSM - id: inputFastq2 source: fastqsplit_1/outputFastq2 - id: coordSortedOutput default: true - id: threadsSort default: 16 - id: cpu_per_job_bwa default: 16 - id: licsrvr_host_and_port source: licsrvr_host_and_port - id: species_reference default: Human - id: output_name source: fastqsplit_1/outputRGID out: - id: output - id: output_HLA run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bwa/4 baseCommand: [] inputs: - id: min_seed_length type: int? inputBinding: prefix: '-k' shellQuote: false position: 1 - id: inputFastq1 type: File inputBinding: shellQuote: false position: 3 label: Input R1 FASTQ file doc: Input reads for FASTQ 1. 'sbg:fileTypes': 'FASTQ, FQ, FASTQ.GZ, FQ.GZ' - id: threads type: int inputBinding: prefix: '-t' shellQuote: false position: 1 label: BWA threads - id: min_std_max_min type: 'int[]?' inputBinding: prefix: '-I' itemSeparator: ',' shellQuote: false position: 1 - id: reference_tar type: File inputBinding: shellQuote: false position: 2 valueFrom: |- ${ var name = inputs.reference_tar.basename.split(".tar.gz")[0] if (inputs.species_reference == "Human"){ return (name + "/genome.fa" ) } else if (inputs.species_reference == "Mouse"){ return (name + "/GRCm38.ensembl.fasta") } } label: Reference directory doc: Reference directory with all BWA indices. 'sbg:fileTypes': TAR.GZ - id: soft_clipping type: boolean inputBinding: prefix: '-Y' shellQuote: false position: 0 - id: rg_id type: string? - id: rg_platform type: string? - id: rg_library type: string? - id: rg_platformunit type: string? - id: rgheader type: boolean? inputBinding: prefix: '-R' shellQuote: false position: 0 valueFrom: |- ${ var sample=inputs.sample_name if( typeof inputs.rg_sample === 'undefined' || inputs.rg_sample === null){ if( typeof inputs.sample_name === 'undefined' || inputs.sample_name === null ) { sample=inputs.sample_name } } var id=inputs.rg_id if( typeof inputs.rg_id === 'undefined' || inputs.rg_sample === null){ inputs.rg_id=sample } var platform=inputs.rg_platform if( typeof inputs.rg_platform === 'undefined' || inputs.rg_sample === null) { platform='ILLUMINA' } var library=inputs.rg_library if( typeof inputs.rg_library === 'undefined' || inputs.rg_sample === null) { library=sample } var platformunit=inputs.rg_platformunit if( typeof inputs.rg_platformunit === 'undefined' || inputs.rg_sample === null) { platformunit=sample } return "'@RG\\tID:"+id+"\\tSM:"+sample+"\\tPL:"+platform+"\\tLB:"+library+"\\tPU:"+platformunit +"'" } label: RG header doc: >- If set to True the RG header will be added. The RGID, PL, PU, SM need to be specifiied - id: postalt type: boolean? - id: sample_name type: string label: Sample name doc: This is used in the output name - id: mdups type: boolean? inputBinding: prefix: '-M' shellQuote: false position: 0 - id: inputFastq2 type: File? inputBinding: shellQuote: false position: 4 label: Input R2 FASSTQ file doc: >- If this file is absent BWA regards input reads as single-end. If this file is present, this command assumes the i-th read in reads.fq and the i-th read in mates.fq constitute a read pair. If -p is used, the command assumes the 2i-th and the (2i+1)-th read in reads.fq constitute a read pair (such input file is said to be interleaved). In this case, mates.fq is ignored. In the paired-end mode, the mem command will infer the read orientation and the insert size distribution from a batch of reads. - id: interleaved type: boolean? inputBinding: prefix: '-p' shellQuote: false position: 0 label: Interleaved doc: if set it is assumed that the fastq is in interleaved format - id: coordSortedOutput type: boolean? - id: threadsSort type: int label: BAMsort threads - 'sbg:category': Execution 'sbg:toolDefaultValue': '60000' id: mem_per_job_bwa type: int? label: 'Memory per job (in MB) [BWA MEM]' doc: 'Memory per job (in MB) [BWA MEM]' - 'sbg:category': Execution id: cpu_per_job_bwa type: int? label: 'CPUs per job [BWA MEM]' doc: 'Number of CPUs per job [BWA MEM]' - 'sbg:category': Execution id: licsrvr_host_and_port type: string label: License server host and port doc: >- License server host and port in the format (HOST:PORT) (parentheses omitted). - 'sbg:toolDefaultValue': Human id: species_reference type: - 'null' - type: enum symbols: - Human - Mouse name: species_reference label: Species reference doc: Species reference default: Human - id: output_name type: string? label: Output filename outputs: - id: output type: File outputBinding: glob: |- ${ if (inputs.output_name){ return inputs.output_name + "*.bam" } else{ return inputs.sample_name + "*.bam" } } outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' secondaryFiles: - pattern: |- ${ if(inputs.output_name){ return inputs.output_name + '.coord.bai' } else{ return inputs.sample_name + '.coord.bai' } } required: false - id: output_HLA type: 'File[]?' outputBinding: glob: |- ${ if (inputs.output_name){ return inputs.output_name + "*HLA*fq" } else{ return inputs.sample_name + "*HLA*fq" } } outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' doc: >- **BWA MEM** is an algorithm designed for aligning sequence reads onto a large reference genome. BWA MEM is implemented as a component of BWA. The algorithm can automatically choose between performing end-to-end and local alignments. BWA MEM is capable of outputting multiple alignments, and finding chimeric reads. It can be applied to a wide range of read lengths, from 70 bp to several megabases. In order to obtain possibilities for additional fast processing of aligned reads, two tools are embedded together into the same package with BWA MEM (0.7.17): Samblaster. (0.1.22) and Sambamba (v0.6.7). [1] A list of **all inputs and parameters** with corresponding descriptions can be found at the bottom of the page. ### Common Use Cases Besides the standard BWA MEM SAM output file, BWA MEM package has been extended to support two additional output options: a BAM file obtained by piping through **Sambamba view** while filtering out the secondary alignments, as well as a Coordinate Sorted BAM option that additionally pipes the output through **Sambamba sort**, along with an accompanying .bai file produced by **Sambamba sort** as side effect. Sorted BAM is the default output of BWA MEM. Parameters responsible for these additional features are 'Filter out secondary alignments' and 'Output format'. ### Changes Introduced by Seven Bridges * Passing data from BWA MEM to Samblaster and Sambamba tools has been done through the pipes which saves processing times of two read and write of aligned reads into the hard drive. ### Common Issues and Important Notes * There is the **known issue** with samblaster. It does not support processing when number of sequences in fasta is larger than 32768. If this is the case do not use deduplication option because the output BAM will be corrupted. ### Performance Benchmarking In the following table you can find estimates of running time and cost. All samples are aligned against **GRCh37 human reference index**. *Cost can be significantly reduced by using **spot instances**. Visit the [Knowledge Center](https://docs.sevenbridges.com/docs/about-spot-instances) for more details.* | FASTQs File Size [GB] | Mean coverage |Duration (min) | Cores | Cost ($) | Instance (AWS) | |--------------------------|----------------|----------------|-------|----------|------------| | 2 X 0.998 | 6X | 9 | 16 | 0.12 | c4.4xlarge | | 2 X 6.2 | 40X | 17 | 16 | 0.22 | c4.4xlarge | | 2 X 7.1 | 46X | 17 | 16 | 0.22 | c4.4xlarge | | 2 X 156.5 | 42X | 160 | 48 | 6.14 | m5.12xlarge | | 2 X 184.7 | 50X | 180 | 48 | 6.91 | m5.12xlarge | | 2 X 209.8 | 52X | 300 | 48 | 11.52 | m5.12xlarge | ### References [1 - Sentieon manual](https://support.sentieon.com/manual/_downloads/Sentieon.pdf) label: Sentieon BWA 0.7.17 arguments: - prefix: '-K' shellQuote: false position: 0 valueFrom: '100000000' - prefix: '' shellQuote: false position: 99 valueFrom: |- ${ var output_name = [].concat(inputs.inputFastq1)[0].basename; if (inputs.output_name){ output_name = inputs.output_name; } if(inputs.coordSortedOutput === true){ return " | $SENTIEON_PATH/bin/sentieon util sort -o " + output_name + ".coord.bam -t " + inputs.threadsSort + " --sam2bam -i -"+ " && mv " + output_name + ".coord.bam.bai " + output_name + ".coord.bai" } else { return "| samtools view -@ " + inputs.threadsSort + " -Sbh -o " + output_name + ".name.bam - " } } - prefix: '' shellQuote: false position: 80 valueFrom: |- ${ var output_name = [].concat(inputs.inputFastq1)[0].basename; if (inputs.output_name){ output_name = inputs.output_name; } var name = inputs.reference_tar.basename.split('.tar.gz')[0] if (inputs.postalt === true){ if (inputs.species_reference == "Human"){ return "| samtools view -@ " + inputs.threadsSort + " -Sbh -o " + output_name + ".bam - && samtools view -h " + output_name + ".bam | /opt/k8 /opt/bwa-postalt.js -p " + output_name +"_HLA " + name + "/genome.fa.alt"} else if (inputs.species_reference == "Mouse"){ return "| samtools view -@ " + inputs.threadsSort + " -Sbh -o " + output_name + ".bam - && samtools view -h " + output_name + ".bam | /opt/k8 /opt/bwa-postalt.js -p " + output_name +"_HLA " + name + "/GRCm38.ensembl.fasta.alt"} } else { return "" } } - prefix: '' shellQuote: false position: 100 valueFrom: |- ${ var output_name = [].concat(inputs.inputFastq1)[0].basename; if (inputs.output_name){ output_name = inputs.output_name; } return "&& rm -f " + output_name + ".bam" } - prefix: '' shellQuote: false position: -2 valueFrom: |- ${ var command = 'export SENTIEON_LICENSE='; var command = command + inputs.licsrvr_host_and_port; return command; } - prefix: '&&' shellQuote: false position: -1 valueFrom: $SENTIEON_PATH/bin/sentieon bwa mem - prefix: '' shellQuote: false position: -3 valueFrom: |- ${ return "tar xzf " + inputs.reference_tar.path + " ; " } requirements: - class: ShellCommandRequirement - class: NetworkAccess networkAccess: true - class: ResourceRequirement ramMin: |- ${ var memory = 60000; if (inputs.mem_per_job_bwa){ memory = inputs.mem_per_job_bwa; } return memory; } coresMin: |- ${ var default_ = 8; var threads_ = 8; var per_job_ = 8; if (inputs.threads && inputs.threadsSort){ threads_=inputs.threads+inputs.threadsSort; } if (inputs.cpu_per_job_bwa){ per_job_=inputs.cpu_per_job_bwa; } return Math.max(default_, threads_, per_job_); } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/sentieon20201001:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) if (o1.secondaryFiles) { o1.secondaryFiles = inheritMetadata(o1.secondaryFiles, o2) } } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) if (o1[i].secondaryFiles) { o1[i].secondaryFiles = inheritMetadata(o1[i].secondaryFiles, o2) } } } return o1; }; 'sbg:toolkit': Sentieon 'sbg:toolkitVersion': '20201001' 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672164 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637673388 'sbg:revisionNotes': Added network access to true - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377458 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377582 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379716 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:license': Client licence 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bwa/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379716 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672164 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a761904eb07943e63c9322e551b3758f8bcd6d892fd182c00be2030922d76faeb label: BWA 0.7.17 scatter: - inputFastq1 - rg_id - rg_platform - rg_library - rg_platformunit - sample_name - inputFastq2 - output_name scatterMethod: dotproduct 'sbg:x': 890.7882690429688 'sbg:y': 1632.4234619140625 - id: fastq_qc in: - id: sampleName source: sample_from_file/out_sample_id - id: inputFastq1 source: merge_fastq_1/output - id: inputFastq2 source: merge_fastq_r2/output - id: sample_id source: sample_from_file/out_sample_id - id: suffix_string_lane_metrics default: .lane_distribution.qcstats - id: suffix_string_for_cutadapt_metrics default: .cutadapt.qcstats out: - id: FastqQCMetrics - id: LaneDistrMetrics - id: CutadaptMetrics - id: CutadaptTrimmedFastq1 - id: CutadaptTrimmedFastq2 - id: CheckformatMetrics - id: reformatFastq2 - id: reformatFastq1 run: class: Workflow cwlVersion: v1.2 id: sbguser/wes-alignment-wf/fastq-qc/4 doc: >- Pipeline to execute the standard fastqQC steps 1. Check the quality range in the fastq files and if needed update the qualities to be in q33 2. Run fastqQC on the fastq files 3. Get the number of reads per lane (lane distribution) 4. Trim the reads with cutadapt. Get the trimmed fastq files and the statistics label: QC metrics on fastq files $namespaces: sbg: 'https://sevenbridges.com' inputs: - id: sampleName type: string label: Sample name doc: used to name output files 'sbg:x': -16.77011489868164 'sbg:y': 140.21263122558594 - id: inputFastq1 'sbg:fileTypes': fastq type: File 'sbg:x': -13.074711799621582 'sbg:y': 398.92242431640625 - id: inputFastq2 'sbg:fileTypes': fastq type: File? 'sbg:x': -14.382183074951172 'sbg:y': 273.6178283691406 - id: sample_id type: string? label: Sample ID doc: First part of the output name = Sample ID. Overrides the input file. 'sbg:x': -24.392383575439453 'sbg:y': -8.362083435058594 - id: suffix_string_lane_metrics type: string? label: Suffix string for Lane metrics doc: Suffix string for Lane metrics. 'sbg:x': -30 'sbg:y': -196.41253662109375 - id: suffix_string_for_cutadapt_metrics type: string? label: Suffix String for Cutadapt Metrics doc: Suffix String for Cutadapt Metrics. 'sbg:x': -29 'sbg:y': -317.9254455566406 - id: quality type: 'int[]?' label: quality cutoff doc: >- Trim low-quality bases from 5' and/or 3' ends of each read before adapter removal. Applied to both reads if data is paired. If one value is given, only the 3' end is trimmed. If two comma-separated cutoffs are given, the 5' end is trimmed with the first cutoff, the 3' end with the second. 'sbg:exposed': true - id: adapter3p1 type: 'string[]?' label: 3p adapter 1st read 'sbg:exposed': true - id: minimumLength type: int? 'sbg:exposed': true - id: adapter3p2 type: 'string[]?' label: 3 adapter 2nd read 'sbg:exposed': true outputs: - id: FastqQCMetrics outputSource: - fastqc/output_qcstats 'sbg:fileTypes': ZIP type: 'File[]' label: FastqQC report doc: FASTQC report metrics. 'sbg:x': 1027.281494140625 'sbg:y': 9.721275329589844 - id: LaneDistrMetrics outputSource: - bms_rename_app/out_file type: File label: Lane distribution statistics doc: Lane distribution statistics. 'sbg:x': 1016.3309936523438 'sbg:y': -174.01393127441406 - id: CutadaptMetrics outputSource: - bms_rename_app_1/out_file 'sbg:fileTypes': QCSTATS type: File label: Cutadapt Metrics doc: Cutadapt Metrics. 'sbg:x': 1054.738525390625 'sbg:y': 481.0804748535156 - id: CutadaptTrimmedFastq1 outputSource: - cutadapt/outputFastq1 'sbg:fileTypes': 'FQ, FQ.GZ, FASTQ, FASTQ.GZ' type: File label: Cutadapt Trimmed Fastq1 doc: Cutadapt Trimmed Fastq1. 'sbg:x': 1036.4339599609375 'sbg:y': 282.5574645996094 - id: CutadaptTrimmedFastq2 outputSource: - cutadapt/outputFastq2 'sbg:fileTypes': 'FQ, FQ.GZ, FASTQ, FASTQ.GZ' type: File? label: Cutadapt Trimmed Fastq2 doc: Cutadapt Trimmed Fastq2. 'sbg:x': 1031.2039794921875 'sbg:y': 146.79310607910156 - id: CheckformatMetrics outputSource: - bbmap/output_qcstats_reformat type: File doc: |- Metrics from bbmap reformat. Contain information about the encoding, read length etc. 'sbg:x': 1013.729736328125 'sbg:y': -316.831298828125 - id: reformatFastq2 outputSource: - bbmap/output_fastq2_reformat 'sbg:fileTypes': 'FASTQ, FASTQ.GZ, FQ, FQ.GZ' type: File? label: Reformatted fastq (2) doc: Reformatted fastq (2). 'sbg:x': 550.0736083984375 'sbg:y': 0 - id: reformatFastq1 outputSource: - bbmap/output_fastq1_reformat 'sbg:fileTypes': 'FASTQ, FASTQ.GZ, FQ.GZ, FQ' type: File label: Reformatted fastq (1) doc: Reformatted fastq (1). 'sbg:x': 550.0736083984375 'sbg:y': 106.953125 steps: - id: fastqc in: - id: inputFastq1 source: bbmap/output_fastq1_reformat - id: inputFastq2 source: bbmap/output_fastq2_reformat out: - id: output_qcstats run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/fastqc/4 baseCommand: - /opt/FastQC/fastqc inputs: - id: inputFastq1 type: File inputBinding: shellQuote: false position: 2 label: Input fastq files (R1) - id: inputFormat type: - 'null' - type: enum symbols: - fastq - bam name: inputFormat inputBinding: prefix: '--format' shellQuote: false position: 0 - id: inputFastq2 type: File? inputBinding: shellQuote: false position: 3 label: Input fastq file (R2) - id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job - 'sbg:category': Execution 'sbg:toolDefaultValue': '8000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). outputs: - id: output_qcstats label: Zip file with metrics type: 'File[]' outputBinding: glob: '*.zip' outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' 'sbg:fileTypes': ZIP label: FastQC 0.11.9 arguments: - prefix: '--quiet' shellQuote: false position: 0 valueFrom: ' ' - prefix: '--nogroup' shellQuote: false position: 0 valueFrom: ' ' - prefix: '--extract' shellQuote: false position: 0 valueFrom: ' ' - prefix: '--outdir' shellQuote: false position: 0 valueFrom: . - prefix: '--threads' shellQuote: false position: 0 valueFrom: |- ${ var cpus = 8; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 8; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/fastqc_0.11.9:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) if (o1.secondaryFiles) { o1.secondaryFiles = inheritMetadata(o1.secondaryFiles, o2) } } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) if (o1[i].secondaryFiles) { o1[i].secondaryFiles = inheritMetadata(o1[i].secondaryFiles, o2) } } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672166 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682316 'sbg:revisionNotes': Image updated to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377459 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377584 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379698 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:toolkitVersion': 0.11.9 'sbg:toolkit': FastQC 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/fastqc/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379698 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672166 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': ac39b6f40e69be07161fe81a7ac19dbbc14a46406c648b59c3fe556688cb051f8 label: fastqc 'sbg:x': 550.0736083984375 'sbg:y': 327.859375 - id: get_library_distribution in: - id: inputFastq1 source: bbmap/output_fastq1_reformat out: - id: output_qcstats run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/get-library-distribution/4 baseCommand: - getLibraryDistribution inputs: - id: inputFastq1 type: File inputBinding: shellQuote: false position: 0 - 'sbg:category': Execution 'sbg:toolDefaultValue': '8000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB) - 'sbg:category': Execution 'sbg:toolDefaultValue': '8' id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job. outputs: - id: output_qcstats type: File outputBinding: glob: '*.qcstats' outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' label: Get Library Distribution arguments: - prefix: '' separate: false shellQuote: false position: 1 valueFrom: >- $( inputs.inputFastq1.basename.replace(/.fq.gz|.fastq.gz/,".qcstats") ) requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 8; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/fastqsplit:v1.4 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672167 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682185 'sbg:revisionNotes': Updated image to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377460 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377585 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379659 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/get-library-distribution/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379659 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672167 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a996acc02b237c1968fbf948d290e1ef446970bd4f2128c5312607b07d91b14fa label: get library distribution 'sbg:x': 550.0736083984375 'sbg:y': 213.90625 - id: cutadapt in: - id: quality source: - quality - id: inputFastq1 source: bbmap/output_fastq1_reformat - id: sample_name source: sampleName - id: adapter3p1 default: - AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC source: - adapter3p1 - id: minimumLength default: 15 source: minimumLength - id: inputFastq2 source: bbmap/output_fastq2_reformat - id: adapter3p2 default: - AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT source: - adapter3p2 - id: pairFilter default: any out: - id: outputFastq1 - id: output_qcstats - id: outputFastq2 run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/cutadapt/4 baseCommand: - cutadapt inputs: - id: quality type: 'int[]?' inputBinding: prefix: '-q' itemSeparator: ',' shellQuote: false position: 0 label: quality cutoff doc: >- Trim low-quality bases from 5' and/or 3' ends of each read before adapter removal. Applied to both reads if data is paired. If one value is given, only the 3' end is trimmed. If two comma-separated cutoffs are given, the 5' end is trimmed with the first cutoff, the 3' end with the second. - id: inputFastq1 type: File inputBinding: shellQuote: false position: 1 label: input (R1) file 'sbg:fileTypes': fastq - id: sample_name type: string - id: adapter3p1 type: 'string[]?' inputBinding: prefix: '-a' shellQuote: false position: 0 label: 3p adapter 1st read - id: adapter5p1 type: 'string[]?' inputBinding: prefix: '-g' shellQuote: false position: 0 label: 5p adapter 1st read - id: adapter5p2 type: 'string[]?' inputBinding: shellQuote: false position: 0 valueFrom: |- ${ if(inputs.inputFastq2 == null){return ""} if(self !== null){ return "-G " + inputs.adapter5p2.join(" ") } } label: 5p adapter 2nd read - id: minimumLength type: int? inputBinding: prefix: '--minimum-length' shellQuote: false position: 0 - id: maximumLength type: int? inputBinding: prefix: '--maximum-length' shellQuote: false position: 0 - id: inputFastq2 type: File? inputBinding: shellQuote: false position: 2 label: input (R2) fastq file 'sbg:fileTypes': fastq - id: adapter3p2 type: 'string[]?' inputBinding: shellQuote: false position: 0 valueFrom: |- ${ if(inputs.inputFastq2 == null ){ return "" } if( self !==null){ return "-A " + inputs.adapter3p2.join(" ") } } label: 3 adapter 2nd read - id: pairFilter type: - 'null' - type: enum symbols: - both - any - first name: pairFilter doc: >- The --pair-filter option determines how to combine the filters for R1 and R2 into a single decision about the read pair. The default is --pair-filter=any, which means that a read pair is discarded (or redirected) if one of the reads (R1 or R2) fulfills the filtering criterion. As an example, if option --minimum-length=20 is used and paired-end data is processed, a read pair if discarded if one of the reads is shorter than 20 nt. To require that filtering criteria must apply to both reads in order for a read pair to be discarded, use the option --pair-filter=both. If you want the filter to ignore the second read, use --pair-filter=first. outputs: - id: outputFastq1 doc: Trimmed fastq R1. label: Trimmed fastq R1 type: File outputBinding: glob: '*R1.fq.gz' outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' 'sbg:fileTypes': 'FASTQ, FASTQ.GZ, FQ, FQ.GZ' - id: output_qcstats doc: QC Stats. label: QC Stats type: File outputBinding: glob: '*.qcstats' outputEval: '$(inheritMetadata(self, inputs.inputFastq2))' - id: outputFastq2 doc: Trimmed fastq R2. label: Trimmed fastq R2 type: File? outputBinding: glob: '*R2.fq.gz' outputEval: '$(inheritMetadata(self, inputs.inputFastq2))' 'sbg:fileTypes': 'FASTQ, FASTQ.GZ, FQ, FQ.GZ' label: Cutadapt 3.2 arguments: - prefix: '-o' shellQuote: false position: 0 valueFrom: | $(inputs.sample_name + "_R1.fq.gz") - prefix: '' separate: false shellQuote: false position: 0 valueFrom: |- ${ if(inputs.inputFastq2 == null ){ return "" } else{ return "-p " + inputs.sample_name + "_R2.fq.gz" } } - prefix: '-j' shellQuote: false position: 0 valueFrom: '16' - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if(inputs.inputFastq2 == null ){ return "" }else{ return "--pair-filter="+inputs.pairFilter } } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: 8000 coresMin: 16 - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/cutadapt:v3.2 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) if (o1.secondaryFiles) { o1.secondaryFiles = inheritMetadata(o1.secondaryFiles, o2) } } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) if (o1[i].secondaryFiles) { o1[i].secondaryFiles = inheritMetadata(o1[i].secondaryFiles, o2) } } } return o1; }; stdout: |- ${ return inputs.sample_name + ".qcstats" } 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672168 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682353 'sbg:revisionNotes': Updated image to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377462 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377586 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379638 'sbg:revisionNotes': Updated back to rev1 'sbg:image_url': null 'sbg:toolkit': Cutadapt 'sbg:toolkitVersion': '3.2' 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/cutadapt/4 'sbg:revision': 4 'sbg:revisionNotes': Updated back to rev1 'sbg:modifiedOn': 1638379638 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672168 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a5c873dc691d4eef69efb8401e3875d37b04f18ebf2853f899b7cccdd2478857a label: cutadapt 'sbg:x': 550.0736083984375 'sbg:y': 455.8125 - id: bbmap in: - id: inputFastq1 source: inputFastq1 - id: sample_name source: sampleName - id: inputFastq2 source: inputFastq2 out: - id: output_fastq1_reformat - id: output_qcstats_reformat - id: output_fastq2_reformat run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bbmap/4 baseCommand: - reformat.sh inputs: - id: inputFastq1 type: File inputBinding: prefix: in= separate: false itemSeparator: 'null' shellQuote: false position: 0 label: Input R1 file in fastq format 'sbg:fileTypes': fastq - id: sample_name type: string label: sample name doc: Used to name the output files. - id: inputFastq2 type: File? inputBinding: prefix: in2= separate: false shellQuote: false position: 0 label: Input R2 file (fastq) 'sbg:fileTypes': fastq - 'sbg:category': Execution 'sbg:toolDefaultValue': '4' id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job. - 'sbg:category': Execution 'sbg:toolDefaultValue': '8000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). - 'sbg:category': Execution 'sbg:toolDefaultValue': '500' id: mem_overhead_per_job type: int? label: Memory overhead per job (in MB) doc: Memory overhead per job (in MB). outputs: - id: output_fastq1_reformat type: File outputBinding: glob: '*R1.fq.gz' outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' 'sbg:fileTypes': fastq - id: output_qcstats_reformat type: File outputBinding: glob: '*.qcstats' outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' - id: output_fastq2_reformat type: File? outputBinding: glob: '*R2.fq.gz' outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' 'sbg:fileTypes': fastq doc: >- App that checks the quality of the fastq files and fixes some common issues.. The input is either 1 (R1) fastq file, or 2 (R1 and R2) fastq files. It returns the same fastq files but with adjusted qualities. label: Bbmap CheckFormat arguments: - prefix: maxcalledquality= separate: false shellQuote: false position: 0 valueFrom: '40' - prefix: '' shellQuote: false position: 0 valueFrom: $("out=" + inputs.sample_name + "_R1.fq.gz") - prefix: qout= separate: false shellQuote: false position: 0 valueFrom: '33' - prefix: mincalledquality= separate: false shellQuote: false position: 0 valueFrom: '2' - prefix: '' separate: false shellQuote: false position: 0 valueFrom: |- ${ var cmd if ( inputs.inputFastq2 !== '' && inputs.inputFastq2 !== null){ return"out2=" + inputs.sample_name + "_R2.fq.gz" } } - prefix: qin= separate: false shellQuote: false position: 0 valueFrom: auto - prefix: fixjunk= separate: false shellQuote: false position: 0 valueFrom: t - prefix: '-Xmx' separate: false shellQuote: false position: -1 valueFrom: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } var overhead = 500; if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } return "".concat(mem - overhead, "M"); } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 4; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/bbmap_38-90:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; stderr: '${ return inputs.sample_name + ".qcstats" }' 'sbg:toolkit': bbmap 'sbg:toolkitVersion': '38.90' 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672169 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682141 'sbg:revisionNotes': Updated image to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377463 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377587 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379609 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bbmap/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379609 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672169 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a153284fab188cf2259754bc434c3584503be4c0dded5f330b39589d396acd0a8 label: bbmap checkformat 'sbg:x': 162.296875 'sbg:y': 274.3828125 - id: bms_rename_app in: - id: suffix_string default: .lane_distribution.qcstats source: suffix_string_lane_metrics - id: first_part_of_string source: sample_id - id: in_file source: get_library_distribution/output_qcstats out: - id: out_file run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bms-rename-app/4 baseCommand: [] inputs: - 'sbg:category': Name inputs id: suffix_string type: string? label: Suffix String doc: Tool string in desired format with extension. - 'sbg:category': Name inputs 'sbg:toolDefaultValue': None id: second_part_of_string type: string? label: String 2 doc: Second part of the output name. Overrides the input file. - 'sbg:category': Name inputs id: first_part_of_string type: string? label: String 1 doc: First part of the output name. Overrides the input file. - 'sbg:stageInput': link 'sbg:category': File Inputs id: in_file type: File inputBinding: shellQuote: false position: 1 'sbg:cmdInclude': true label: Input file doc: Input file. - 'sbg:category': Name inputs id: second_part_of_string_file type: File? label: File - second part of name string doc: >- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- https://bms-cwltool-vayu.sbgenomics.com/ns/brood/images/sbguser/wes-alignment-wf/fastq-qc/4.png 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/fastq-qc/4 'sbg:revision': 4 'sbg:revisionNotes': Updated all decomposed tools in the workflow 'sbg:modifiedOn': 1638380519 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672170 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': af7704c4f3b8835b110fdc26223494d8f046fc1624b174ec20983dfcf79e04d4f label: QC metrics on fastq files 'sbg:x': 214.91058349609375 'sbg:y': 1632.3857421875 - id: sentieon_realignment in: - id: threads default: 16 - id: ReferenceGenome source: sbg_fasta_indices/out_reference_and_index - id: inputBAM source: sentieon_markduplicates/MarkDuplicatesBAM - id: knownSites source: knownIndelSites - id: intervals source: TargetRegions - id: licsrvr_host_and_port source: licsrvr_host_and_port out: - id: RealignedBAM run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/sentieon-realignment/4 baseCommand: [] inputs: - id: threads type: int? inputBinding: prefix: '-t' shellQuote: false position: 0 label: SentieonRealign threads - id: ReferenceGenome type: File inputBinding: prefix: '-r' shellQuote: false position: 0 label: Reference fasta secondaryFiles: - pattern: .fai required: true - id: inputBAM type: File inputBinding: prefix: '-i' shellQuote: false position: 0 label: input BAM file secondaryFiles: - pattern: ^.bai required: true - id: knownSites type: File inputBinding: prefix: '-k' shellQuote: false position: 2 label: known sites for realignment (Mills) 'sbg:fileTypes': vcf secondaryFiles: - pattern: .tbi required: true - id: intervals type: File? inputBinding: prefix: '--interval_list' shellQuote: false position: 2 label: Interval list 'sbg:fileTypes': intervals - 'sbg:category': Execution id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUS per job. - 'sbg:category': Execution 'sbg:toolDefaultValue': '30000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB) - 'sbg:category': Execution id: licsrvr_host_and_port type: string label: License server host and port doc: >- License server host and port in the format (HOST:PORT) (parentheses omitted). outputs: - id: RealignedBAM label: Realigned output BAM file type: File outputBinding: glob: '*.bam' outputEval: '$(inheritMetadata(self, inputs.inputBAM))' secondaryFiles: - pattern: .bai required: false doc: >- **Sentieon Realigner** is an algorithm designed for INDEL realignment. The local realignment process is designed to consume one or more BAM files and to locally realign reads such that the number of mismatching bases is minimized across all the reads. In general, a large percent of regions requiring local realignment are due to the presence of an insertion or deletion (INDELs) in the individual's genome with respect to the reference genome. [1] A list of **all inputs and parameters** with corresponding descriptions can be found at the bottom of the page. ### Common Use Cases * A single command is run to perform local realignment around INDELs on the BAM file after alignment, sorting and deduplication. Common case is to use both files: * _1000 Genome INDELs_ * _Mills standard INDELs_ ### Changes Introduced by Seven Bridges * No modifications to the original tool representation have been made. ### Common Issues and Important Notes * No common issues specific to the tool's execution on the Seven Bridges Platform have been detected. ### Performance Benchmarking In the following table you can find estimates of running time and cost. All samples are aligned against **GRCh37 human reference index**. *Cost can be significantly reduced by using **spot instances**. Visit the [Knowledge Center](https://docs.sevenbridges.com/docs/about-spot-instances) for more details.* | BAM File Size [GB] | Mean coverage |Duration (min) | Cores | Cost ($) | Instance (AWS) | |--------------------------|----------------|----------------|-------|----------|------------| | 0.61 | 6X | 1 | 16 | 0.013 | c4.4xlarge | | 4.49 | 40X | 2 | 16 | 0.029 | c4.4xlarge | | 5.89 | 46X | 3 | 16 | 0.039 | c4.4xlarge | | 97.17 | 42X | 30 | 48 | 1.15 | m5.12xlarge | | 114.64 | 50X | 25 | 48 | 0.96 | m5.12xlarge | | 148.81 | 52X | 32 | 48 | 1.22 | m5.12xlarge | ### References [1 - Sentieon manual](https://support.sentieon.com/manual/_downloads/Sentieon.pdf) label: Sentieon Realign arguments: - prefix: '--algo' shellQuote: false position: 1 valueFrom: Realigner - prefix: '' shellQuote: false position: 3 valueFrom: |- ${ return inputs.inputBAM.basename.replace(/.mdup|.coord|.name|.bam$/gi ,'') + ".bam" } - prefix: '' shellQuote: false position: -1 valueFrom: |- ${ var command = 'export SENTIEON_LICENSE='; var command = command + inputs.licsrvr_host_and_port; return command; } - prefix: '&&' shellQuote: false position: 0 valueFrom: $SENTIEON_PATH/bin/sentieon driver requirements: - class: ShellCommandRequirement - class: NetworkAccess networkAccess: true - class: ResourceRequirement ramMin: |- ${ var mem = 30000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 8; var threads = 8; if (inputs.threads){ threads = inputs.threads; } if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return Math.max(cpus, threads); } - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/sentieon20201001:0' - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672172 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637673360 'sbg:revisionNotes': Added network access to true - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377467 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377592 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638378514 'sbg:revisionNotes': Back to rev 1 'sbg:image_url': null 'sbg:toolkit': Sentieon 'sbg:toolkitVersion': '20201001' 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/sentieon-realignment/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev 1 'sbg:modifiedOn': 1638378514 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672172 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a4129fd52b50aa4cc3a2d512d61fef11f39c381be4a87c9b7511340d51e0aceb5 label: Sentieon realign 'sbg:x': 1531.34814453125 'sbg:y': 1608.25 - id: sentieon_recalibration in: - id: ReferenceGenome source: sbg_fasta_indices/out_reference_and_index - id: inputBAM source: sentieon_realignment/RealignedBAM - id: knownSites source: - knownIndelSites - dbsnp - id: interval source: TargetRegions - id: licsrvr_host_and_port source: licsrvr_host_and_port out: - id: RecalibrationTable - id: RecalibratedBAM - id: PostRecalibrationTable run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/sentieon-recalibration/4 baseCommand: [] inputs: - id: threads type: int? inputBinding: prefix: '-t' shellQuote: false position: 0 label: SentieonRecalibrate threads - id: ReferenceGenome type: File inputBinding: prefix: '-r' shellQuote: false position: 0 label: Reference genome (fasta) 'sbg:fileTypes': fasta secondaryFiles: - pattern: .fai required: true - id: inputBAM type: File inputBinding: prefix: '-i' shellQuote: false position: 0 label: input BAM file doc: >- Note that the index file comes from Sentieon Realign and is in the form BAM.BAI 'sbg:fileTypes': BAM secondaryFiles: - pattern: .bai required: true - id: knownSites type: 'File[]' inputBinding: itemSeparator: ' -k ' shellQuote: false position: 2 valueFrom: |- ${ var prefix = '-k' var files = [].concat(self); var output = []; for (var i=0; i- License server host and port in the format (HOST:PORT) (parentheses omitted). - 'sbg:category': Execution id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job - 'sbg:category': Execution 'sbg:toolDefaultValue': '16000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). outputs: - id: RecalibrationTable type: File outputBinding: glob: '*.recal.tbl' outputEval: '$(inheritMetadata(self, inputs.inputBAM))' - id: RecalibratedBAM label: BAM file with recalibrated values type: File outputBinding: glob: '*.bam' outputEval: '$(inheritMetadata(self, inputs.inputBAM))' secondaryFiles: - pattern: ^.bai required: false - pattern: .bai required: false - id: PostRecalibrationTable type: File outputBinding: glob: '*.recal.post.tbl' outputEval: '$(inheritMetadata(self, inputs.inputBAM))' doc: >- **Sentieon QualCal** is an algorithm designed to detect and correct for patterns of systematic errors in the base quality scores, which are confidence scores emitted by the sequencer for each base. Base quality scores play an important role in weighing the evidence for or against possible variant alleles during the variant discovery process, so it's important to correct any systematic bias observed in the data. Biases can originate from biochemical processes during library preparation and sequencing, from manufacturing defects in the chips, or instrumentation defects in the sequencer. [1] The recalibration math depends on platform (PL) tag of the ReadGroup; the QualCal algorithm supports the following platforms: _ILLUMINA_, _ION TORRENT_, _LS454_, _PACBIO_, _COMPLETE GENOMICS_, Support for sequencing data from the SOLID platform is not currently implemented. A list of **all inputs and parameters** with corresponding descriptions can be found at the bottom of the page. ### Common Use Cases * A single command is run to calculate the required modification of the quality scores assigned to individual read bases of the sequence read data. Recalibration table is created which can be applied during variant calling. ### Changes Introduced by Seven Bridges * This tool is wrapped along with _ReadWriter_ algorithm. By default recalibration of BAM file is performed and plot of recalibration table is generated. Parameters **Do not recal BAM** or **Do not plot table** can be checked if one want to output recalibration table to perform recalibration during variant calling step. * Tool outputs: * Recalibrated BAM file (with BAI index) * PDF plot of recalibration table * Recalibration table ### Common Issues and Important Notes * No common issues specific to the tool's execution on the Seven Bridges Platform have been detected. ### Performance Benchmarking In the following table you can find estimates of running time and cost. All samples are aligned against **GRCh37 human reference index**. *Cost can be significantly reduced by using **spot instances**. Visit the [Knowledge Center](https://docs.sevenbridges.com/docs/about-spot-instances) for more details.* | BAM File Size [GB] | Mean coverage |Duration (min) | Cores | Cost ($) | Instance (AWS) | |--------------------------|----------------|----------------|-------|----------|------------| | 0.62 | 6X | 2 | 16 | 0.026 | c4.4xlarge | | 4.49 | 40X | 4 | 16 | 0.053 | c4.4xlarge | | 5.89 | 46X | 5 | 16 | 0.066 | c4.4xlarge | | 97.17 | 42X | 30 | 58 | 2.22 | m5.12xlarge | | 114.64 | 50X | 25 | 53 | 2.03 | m5.12xlarge | | 148.81 | 52X | 32 | 48 | 3.11 | m5.12xlarge | ### References [1 - Sentieon manual](https://support.sentieon.com/manual/_downloads/Sentieon.pdf) label: Sentieon Calculate Recalibration arguments: - prefix: '--algo' shellQuote: false position: 1 valueFrom: QualCal - prefix: '' shellQuote: false position: 3 valueFrom: |- ${ return inputs.inputBAM.basename.replace(/.mdup|.name|.coord|.bam$/gi, '') +'.recal.tbl' } - prefix: '' shellQuote: false position: 10 valueFrom: '&& $SENTIEON_PATH/bin/sentieon driver' - prefix: '-t' shellQuote: false position: 11 valueFrom: $(inputs.threads) - prefix: '-r' shellQuote: false position: 11 valueFrom: $(inputs.ReferenceGenome.path) - prefix: '-i' shellQuote: false position: 11 valueFrom: $(inputs.inputBAM.path) - prefix: '--algo' shellQuote: false position: 12 valueFrom: QualCal - prefix: '-q' shellQuote: false position: 11 valueFrom: >- ${ return inputs.inputBAM.basename.replace(/.mdup|.name|.coord|.bam$/gi, '')+'.recal.tbl' } - prefix: '-k' shellQuote: false position: 13 valueFrom: |- ${ var ar=[] for( var i =0 ; i- ${ return inputs.inputBAM.basename.replace(/.mdup|.name|.coord|.bam$/gi, '')+'.recal.post.tbl' } - prefix: '--algo' shellQuote: false position: 20 valueFrom: ReadWriter - prefix: '' shellQuote: false position: 21 valueFrom: $(inputs.inputBAM.basename) - prefix: '' shellQuote: false position: 100 valueFrom: |- ${ return "&& cp " +inputs.inputBAM.basename+".bai "+ inputs.inputBAM.nameroot+".bai"} - prefix: '' shellQuote: false position: -2 valueFrom: |- ${ var command = 'export SENTIEON_LICENSE='; var command = command + inputs.licsrvr_host_and_port; return command; } - prefix: '&&' shellQuote: false position: -1 valueFrom: $SENTIEON_PATH/bin/sentieon driver requirements: - class: ShellCommandRequirement - class: NetworkAccess networkAccess: true - class: ResourceRequirement ramMin: |- ${ var mem = 16000; if (inputs.mem_per_job){ mem = inputs.mem_per_job } return mem; } coresMin: |- ${ var cpus_ = 0; var threads_ = 0; var default_ = 4; if (inputs.threads){ threads_ = inputs.threads; } if (inputs.cpu_per_job){ cpus_ = inputs.cpu_per_job; } return Math.max(cpus_, threads_, default_) } - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/sentieon20201001:0' - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672173 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637673325 'sbg:revisionNotes': Added Network acces to true - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377469 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377593 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379455 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:toolkit': Sentieon 'sbg:toolkitVersion': '20201001' 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/sentieon-recalibration/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379455 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672173 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a45cea5c1bb212d9e20e0326578a9fb6474bf3d4314c6ee39726133d7625efb0d label: Sentieon Calculate Recalibration 'sbg:x': 2318.46484375 'sbg:y': 341.25 - id: wes_align_basic in: - id: referenceGenomeSequence source: sbg_fasta_indices/out_reference_and_index - id: TargetRegions source: TargetRegions - id: inputBAM source: sentieon_markduplicates/MarkDuplicatesBAM - id: dbsnp source: dbsnp - id: TargetCCDS source: TargetCCDS - id: COSMIC source: COSMIC - id: sampleName source: sample_from_file/out_sample_id - id: bait_set_name source: bait_set_name - id: bait_bed source: bait_bed - id: sequence_dictionary source: sbg_fasta_indices/out_reference_dict - id: genomeVersion default: 1k out: - id: InsertSizeMetrics - id: InsertSizeChart - id: CollectAlnMetrics - id: BamIndexMetrics - id: QualityYieldMetrics - id: QualityDistributionPDF - id: QualityDistributionMetrics - id: QualityCyclePDF - id: QualityCycleMetrics - id: PreAdapterSummaryMetrics - id: PreAdapterDetailMetrics - id: OxogMetrics - id: GCBiasSummaryMetrics - id: GCBiasPDF - id: GCBiasDetailMetrics - id: ErrorSummaryMetrics - id: BaseDistributionCyclePDF - id: BaseDistributionCycleMetrics - id: BaitBiasSummaryMetrics - id: BaitBiasDetailMetrics - id: AlignmentSummaryMetrics - id: CCDSWESMetrics - id: HsCCDSMetrics - id: COSMICWESMetrics - id: HsCOSMICMetrics - id: BigWig - id: SexDetermMetrics - id: SexPrediction - id: TargetWESMetrics - id: HsMetrics run: class: Workflow cwlVersion: v1.2 id: sbguser/wes-alignment-wf/wes-align-basic/6 label: WES alignment QC $namespaces: sbg: 'https://sevenbridges.com' inputs: - id: referenceGenomeSequence 'sbg:fileTypes': 'fasta, fa' type: File secondaryFiles: - pattern: .fai required: true 'sbg:x': -223.63963317871094 'sbg:y': 1373.5281982421875 - id: TargetRegions 'sbg:fileTypes': BED type: File label: Target regions (bait intervals) 'sbg:x': -223.63963317871094 'sbg:y': 1104.6182861328125 - id: inputBAM 'sbg:fileTypes': BAM type: File secondaryFiles: - pattern: ^.bai required: true 'sbg:x': -216.65089416503906 'sbg:y': 1504.98876953125 - id: dbsnp type: File secondaryFiles: - pattern: .tbi required: true 'sbg:x': -209.6621551513672 'sbg:y': 1642.4381103515625 - id: TargetCCDS 'sbg:fileTypes': intervals type: File 'sbg:x': -220.145263671875 'sbg:y': 1239.5732421875 - id: COSMIC 'sbg:fileTypes': intervals type: File label: COSMIC sites (vcf) 'sbg:x': -206.16778564453125 'sbg:y': 1780.8873291015625 - id: sampleName type: string 'sbg:x': 590.86474609375 'sbg:y': 854.9702758789062 - id: bait_set_name type: string? 'sbg:x': -206.16778564453125 'sbg:y': 1907.8536376953125 - id: bait_bed type: File label: Bait BED file doc: >- A BED file that contains the locations of the baits used. Default value: null. This option must be specified at least 1 times. 'sbg:x': -224.93194580078125 'sbg:y': 956.6478881835938 - id: sequence_dictionary 'sbg:fileTypes': DICT type: File label: 'The sequence dictionary, or BAM/VCF/IntervalList' doc: >- The sequence dictionary, or BAM/VCF/IntervalList from which a dictionary can be extracted. 'sbg:x': -224.58407592773438 'sbg:y': 816.139892578125 - id: genomeVersion type: - 'null' - type: enum symbols: - hg38 - 1k - hg19 name: genomeVersion label: Version of the human genome to use doc: 1k and hg38 are synonyms 'sbg:exposed': true outputs: - id: InsertSizeMetrics outputSource: - basic_bamqc/InsertSizeMetrics 'sbg:fileTypes': 'TXT, QCSTATS' type: File 'sbg:x': 1472.6314697265625 'sbg:y': 2139.184326171875 - id: InsertSizeChart outputSource: - basic_bamqc/InsertSizeChart type: File 'sbg:x': 1462.8682861328125 'sbg:y': 2271.842041015625 - id: CollectAlnMetrics outputSource: - basic_bamqc/CollectAlnMetrics type: File 'sbg:x': 1461.026123046875 'sbg:y': 2393.868408203125 - id: BamIndexMetrics outputSource: - basic_bamqc/BamIndexMetrics 'sbg:fileTypes': 'TXT, QCSTATS' type: File 'sbg:x': 1464.10498046875 'sbg:y': 2527.368408203125 - id: QualityYieldMetrics outputSource: - bms_rename_app_20/out_file 'sbg:fileTypes': QUALITY_YIELD_METRICS type: File label: Quality Yield Metrics doc: Quality Yield Metrics. 'sbg:x': 2486.897216796875 'sbg:y': 1141.3751220703125 - id: QualityDistributionPDF outputSource: - bms_rename_app_21/out_file 'sbg:fileTypes': PDF type: File label: Quality Distribution PDF doc: Quality Distribution PDF. 'sbg:x': 2481.988525390625 'sbg:y': 1290.09228515625 - id: QualityDistributionMetrics outputSource: - bms_rename_app_15/out_file 'sbg:fileTypes': QUALITY_DISTRIBUTION_METRICS type: File label: Quality Distribution Metrics doc: Quality Distribution Metrics. 'sbg:x': 2447.4912109375 'sbg:y': 368.6340637207031 - id: QualityCyclePDF outputSource: - bms_rename_app_13/out_file 'sbg:fileTypes': PDF type: File label: Quality Cycle PDF doc: Quality Cycle PDF. 'sbg:x': 2435.538330078125 'sbg:y': 41.02723693847656 - id: QualityCycleMetrics outputSource: - bms_rename_app_16/out_file 'sbg:fileTypes': QUALITY_BY_CYCLE_METRICS type: File label: Quality Cycle Metrics doc: Quality Cycle Metrics. 'sbg:x': 2453.54248046875 'sbg:y': 518.5490112304688 - id: PreAdapterSummaryMetrics outputSource: - bms_rename_app_22/out_file 'sbg:fileTypes': PRE_ADAPTER_SUMMARY_METRICS type: File label: PreAdapter Summary Metrics doc: PreAdapter Summary Metrics. 'sbg:x': 2500.172607421875 'sbg:y': 1452.188232421875 - id: PreAdapterDetailMetrics outputSource: - bms_rename_app_17/out_file 'sbg:fileTypes': PRE_ADAPTER_DETAIL_METRICS type: File label: PreAdapter Detail Metrics doc: PreAdapter Detail Metrics. 'sbg:x': 2460.24462890625 'sbg:y': 686.2747192382812 - id: OxogMetrics outputSource: - bms_rename_app_18/out_file 'sbg:fileTypes': OXOG_METRICS type: File label: OxoG Metrics doc: OxoG Metrics. 'sbg:x': 2465.893310546875 'sbg:y': 846.8932495117188 - id: GCBiasSummaryMetrics outputSource: - bms_rename_app_14/out_file 'sbg:fileTypes': SUMMARY_METRICS type: File label: GC Bias Summary Metrics doc: GC Bias Summary Metrics. 'sbg:x': 2446.014892578125 'sbg:y': 183.1236572265625 - id: GCBiasPDF outputSource: - bms_rename_app_11/out_file 'sbg:fileTypes': PDF type: File label: GCBias PDF doc: GCBias PDF. 'sbg:x': 2424.721435546875 'sbg:y': -244.96722412109375 - id: GCBiasDetailMetrics outputSource: - bms_rename_app_10/out_file 'sbg:fileTypes': DETAIL_METRICS type: File label: GC Bias Detail Metrics doc: GC Bias Detail Metrics. 'sbg:x': 2424.357421875 'sbg:y': -382.28521728515625 - id: ErrorSummaryMetrics outputSource: - bms_rename_app_23/out_file 'sbg:fileTypes': ERROR_SUMMARY_METRICS type: File label: Error Summary Metrics doc: Error Summary Metrics. 'sbg:x': 2514.239013671875 'sbg:y': 1599.6441650390625 - id: BaseDistributionCyclePDF outputSource: - bms_rename_app_19/out_file 'sbg:fileTypes': PDF type: File label: Base Distribution Cycle PDF doc: Base Distribution Cycle PDF. 'sbg:x': 2477.992431640625 'sbg:y': 991.0733032226562 - id: BaseDistributionCycleMetrics outputSource: - bms_rename_app_7/out_file 'sbg:fileTypes': BASE_DISTRIBUTION_BY_CYCLE_METRICS type: File label: Base Distribution Cycle Metrics doc: Base Distribution Cycle Metrics. 'sbg:x': 2434.1376953125 'sbg:y': -514.3344116210938 - id: BaitBiasSummaryMetrics outputSource: - bms_rename_app_12/out_file 'sbg:fileTypes': BAIT_BIAS_SUMMARY_METRICS type: File label: Bait Bias Summary Metrics doc: Bait Bias Summary Metrics. 'sbg:x': 2426.767822265625 'sbg:y': -106.91178894042969 - id: BaitBiasDetailMetrics outputSource: - bms_rename_app_9/out_file 'sbg:fileTypes': BAIT_BIAS_DETAIL_METRICS type: File label: Bait Bias Detail Metrics doc: Bait Bias Detail Metrics. 'sbg:x': 2442.71484375 'sbg:y': -648.7737426757812 - id: AlignmentSummaryMetrics outputSource: - bms_rename_app_8/out_file 'sbg:fileTypes': ALIGNMENT_SUMMARY_METRICS type: File label: Alignment Summary Metrics doc: Alignment Summary Metrics. 'sbg:x': 2441.373779296875 'sbg:y': -773.6524047851562 - id: CCDSWESMetrics outputSource: - bms_rename_app_6/out_file 'sbg:fileTypes': QCSTATS type: File? label: Target metrics on CCDS doc: Target metrics on CCDS. 'sbg:x': 1141.6837158203125 'sbg:y': 446.5199279785156 - id: HsCCDSMetrics outputSource: - bms_rename_app_5/out_file 'sbg:fileTypes': QCSTATS type: File? label: HS Metrics on CCDS doc: HS (Hybrid Selection) Metrics on CCDS. 'sbg:x': 1147.794921875 'sbg:y': 594.3687744140625 - id: COSMICWESMetrics outputSource: - bms_rename_app_4/out_file 'sbg:fileTypes': QCSTATS type: File? label: Target metrics on COSMIC sites doc: Target metrics on Cosmic file. 'sbg:x': 1112.9888916015625 'sbg:y': 127.6208724975586 - id: HsCOSMICMetrics outputSource: - bms_rename_app_3/out_file 'sbg:fileTypes': QCSTATS type: File? label: HS Metrics on Comsic doc: HS (Hybrid Selection) Metrics on Cosmic. 'sbg:x': 1122.4698486328125 'sbg:y': 273.5016784667969 - id: BigWig outputSource: - bms_rename_app/out_file type: File? 'sbg:x': 1475.464599609375 'sbg:y': 2002.1822509765625 - id: SexDetermMetrics outputSource: - bms_rename_app_24/out_file 'sbg:fileTypes': QCSTATS type: File label: Sex Determination Metrics doc: Sex determination metrics. 'sbg:x': 2514.77734375 'sbg:y': 1949.628173828125 - id: SexPrediction outputSource: - sexdetermination/SexPrediction type: string? 'sbg:x': 2500.594482421875 'sbg:y': 1781.8797607421875 - id: TargetWESMetrics outputSource: - bms_rename_app_1/out_file 'sbg:fileTypes': QCSTATS type: File? label: Target WES Metrics doc: Target Metrics. 'sbg:x': 1122.470947265625 'sbg:y': -216.16714477539062 - id: HsMetrics outputSource: - bms_rename_app_2/out_file 'sbg:fileTypes': QCSTATS type: File? label: HS Metrics output doc: HS (Hybrid selection) Metrics. 'sbg:x': 1127.1619873046875 'sbg:y': -41.35194396972656 steps: - id: basic_bamqc in: - id: inputBAM source: inputBAM - id: referenceGenomeSequence source: referenceGenomeSequence - id: sample_id source: sampleName - id: suffix_string_insert_size_metrics default: .mdup.InsertSize-picard.qcstats - id: suffix_string_insert_size_chart default: .mdup.InsertSize-picard.pdf - id: suffix_string_bamindex_metrics default: .mdup.BamIndex-picard.qcstats - id: suffix_string_aln_metrics default: .mdup.CalculateAlnMetrics-picard.qcstats - id: level default: ALL_READS out: - id: BamIndexMetrics - id: CollectAlnMetrics - id: InsertSizeMetrics - id: InsertSizeChart - id: outputAlnReads run: class: Workflow cwlVersion: v1.2 id: sbguser/wes-alignment-wf/basic-bamqc/4 doc: |- Standard BAM QC Can be applied on BAM file generated by all types of assays label: QC metrics on BAM files $namespaces: sbg: 'https://sevenbridges.com' inputs: - id: inputBAM 'sbg:fileTypes': bam type: File label: Input BAM file doc: Input alignment bam file secondaryFiles: - pattern: ^.bai required: true 'sbg:x': -1133.483154296875 'sbg:y': -457.64300537109375 - id: referenceGenomeSequence 'sbg:fileTypes': 'fasta, fa' type: File label: Reference genome (fasta + fai) doc: Genome sequence in fasta format secondaryFiles: - pattern: .fai required: true 'sbg:x': -1137.2647705078125 'sbg:y': -324.4065246582031 - id: sample_id type: string? label: Sample ID doc: >- First part of the output name = Sample ID. Overrides the input file. 'sbg:x': -1133.9293212890625 'sbg:y': -605.7445068359375 - id: suffix_string_insert_size_metrics type: string? label: Suffix String for Insert size metrics doc: >- Tool string in desired format with extension used for insert size metrics. 'sbg:x': -1133.5489501953125 'sbg:y': -733.065185546875 - id: suffix_string_insert_size_chart type: string? label: Suffix String for Insert size chart doc: >- Tool string in desired format with extension used for insert size chart. 'sbg:x': -1131.2275390625 'sbg:y': -870.8052368164062 - id: suffix_string_bamindex_metrics type: string? label: 'Suffix String for BAMIndex Metrics ' doc: >- Tool string in desired format with extension used for BAM index metrics. 'sbg:x': -1133.6988525390625 'sbg:y': -992.407470703125 - id: suffix_string_aln_metrics type: string? label: Suffix String for Alignment Metrics doc: >- Tool string in desired format with extension used for alignment metrics. 'sbg:x': -1135.47802734375 'sbg:y': -1121.3011474609375 - id: level type: - 'null' - type: enum symbols: - ALL_READS - SAMPLE - LIBRARY - READ_GROUP name: level label: Metric accumulation level doc: >- The level(s) at which to accumulate metrics. Default value: [ALL_READS]. This option can be set to 'null' to clear the default value. Possible values: {ALL_READS, SAMPLE, LIBRARY, READ_GROUP} This option may be specified 0 or more times. This option can be set to 'null' to clear the default list. 'sbg:exposed': true - id: bisulfite type: boolean? label: bisulfite sequenced doc: >- Whether the SAM or BAM file consists of bisulfite sequenced reads. Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false} 'sbg:exposed': true outputs: - id: BamIndexMetrics outputSource: - bms_rename_app_2/out_file 'sbg:fileTypes': 'TXT, QCSTATS' type: File label: BamIndex Metrics doc: BamIndex Metrics. 'sbg:x': -121.55473327636719 'sbg:y': -464.49591064453125 - id: CollectAlnMetrics outputSource: - bms_rename_app_3/out_file type: File label: Collect Alignment metrics statistics 'sbg:x': -124.0342788696289 'sbg:y': -643.4959106445312 - id: InsertSizeMetrics outputSource: - bms_rename_app/out_file 'sbg:fileTypes': 'TXT, QCSTATS' type: File label: Insert Size metrics doc: Insert Size Metrics. 'sbg:x': -68.4999008178711 'sbg:y': -305.9402160644531 - id: InsertSizeChart outputSource: - bms_rename_app_1/out_file type: File 'sbg:x': -59.30268859863281 'sbg:y': -136.26022338867188 - id: outputAlnReads outputSource: - picard_collectalnmetrics/outputAlnReads type: int label: Number of aligned reads doc: Number of aligned reads. 'sbg:x': -127.78223419189453 'sbg:y': -879.6251831054688 steps: - id: picard_bamindex in: - id: input_bam_file source: inputBAM out: - id: output_qcstats run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-bamindex/4 baseCommand: [] inputs: - id: input_bam_file type: File inputBinding: prefix: I= separate: false shellQuote: false position: 50 label: Input BAM doc: input bam file. Needs to be coordinate sorted secondaryFiles: - pattern: ^.bai required: true - 'sbg:category': Execution 'sbg:toolDefaultValue': '1000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). - 'sbg:category': Execution 'sbg:toolDefaultValue': '200' id: mem_overhead_per_job type: int? label: Memory overhead per job (in MB) doc: Memory overhead per job (in MB). - 'sbg:category': Execution id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job. outputs: - id: output_qcstats label: output file with bamindex statistics type: File outputBinding: glob: >- ${ return inputs.input_bam_file.basename.replace(/.coord|.name|.bam/gi,"") + ".BamIndex-picard.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_bam_file))' 'sbg:fileTypes': 'TXT, QCSTATS' label: Picard BAM Index 2.25 arguments: - prefix: '' shellQuote: false position: 1 valueFrom: |- ${ var mem = 1000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } var overhead = 200; if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } return "java -Xmx".concat(mem-overhead,"M -jar /opt/picard/picard.jar") } - prefix: '' shellQuote: false position: 2 valueFrom: BamIndexStats - prefix: VERBOSITY= separate: false shellQuote: false position: 5 valueFrom: WARNING - prefix: TMP_DIR= separate: false shellQuote: false position: 5 valueFrom: /tmp - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 5 valueFrom: SILENT requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 4; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/picard2.25.0:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; stdout: >- ${ return inputs.input_bam_file.basename.replace(/.coord|.name|.bam/gi,"") + ".BamIndex-picard.qcstats" } stderr: $(inputs.input_bam_file.basename).bamindex.stderr 'sbg:toolkit': picard tools 'sbg:toolkitVersion': v2.25 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672175 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637681730 'sbg:revisionNotes': Updated image to BMS repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377478 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377601 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379019 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-bamindex/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379019 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672175 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- a705a2f51e32c1c3b1f6c92daae251be18e0e191ff176e4dcc0abb1a58c81bf64 label: Picard bamindex 2.18.14 'sbg:x': -614.7398681640625 'sbg:y': -461.90765380859375 - id: picard_collectalnmetrics in: - id: input_BAM source: inputBAM - id: reference_genome source: referenceGenomeSequence - id: level default: ALL_READS source: level - id: bisulfite source: bisulfite out: - id: output - id: outputAlnReads run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-collectalnmetrics/4 baseCommand: [] inputs: - id: input_BAM type: File inputBinding: prefix: INPUT= separate: false shellQuote: false position: 0 'sbg:fileTypes': BAM secondaryFiles: - pattern: ^.bai required: true - id: reference_genome type: File inputBinding: prefix: REFERENCE_SEQUENCE= separate: false shellQuote: false position: 0 secondaryFiles: - pattern: .fai required: true - id: level type: - 'null' - type: enum symbols: - ALL_READS - SAMPLE - LIBRARY - READ_GROUP name: level inputBinding: prefix: METRIC_ACCUMULATION_LEVEL= separate: false shellQuote: false position: 0 label: Metric accumulation level doc: >- The level(s) at which to accumulate metrics. Default value: [ALL_READS]. This option can be set to 'null' to clear the default value. Possible values: {ALL_READS, SAMPLE, LIBRARY, READ_GROUP} This option may be specified 0 or more times. This option can be set to 'null' to clear the default list. - id: bisulfite type: boolean? inputBinding: prefix: IS_BISULFITE_SEQUENCED shellQuote: false position: 0 label: bisulfite sequenced doc: >- Whether the SAM or BAM file consists of bisulfite sequenced reads. Default value: false. This option can be set to 'null' to clear the default value. Possible values: {true, false} - id: pair_orientation type: - 'null' - type: enum symbols: - FR - RF - TANDEM name: pair_orientation inputBinding: prefix: EXPECTED_PAIR_ORIENTATIONS shellQuote: false position: 0 label: expected orientation doc: >- Paired-end reads that do not have this expected orientation will be considered chimeric. Default value: [FR]. This option can be set to 'null' to clear the default value. Possible values: {FR, RF, TANDEM} This option may be specified 0 or more times. This option can be set to 'null' to clear the default list. - 'sbg:category': Execution 'sbg:toolDefaultValue': '8000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). - 'sbg:category': Execution 'sbg:toolDefaultValue': '500' id: mem_overhead_per_job type: int? label: Memory overhead per job (in MB) doc: Memory overhead per job (in MB). - 'sbg:category': Execution 'sbg:toolDefaultValue': '4' id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job. outputs: - id: output type: File outputBinding: glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + ".CalculateAlnMetrics-picard.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: outputAlnReads type: - int - string outputBinding: loadContents: true glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + ".CalculateAlnMetrics-picard.qcstats" } outputEval: |- ${ var reads=0 var a=self[0].contents.split("\n") for(var i=0; i- Runs the CollectAlnmetrics from picard the results are a txt file with the metrics and the number of aligned reads (which can be used as input in downstream steps) label: Picard CollectAlignment 2.25 arguments: - prefix: '' shellQuote: false position: -2 valueFrom: |- ${ var mem = 8000; var overhead = 500; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } return "java -Xmx".concat(mem-overhead,"M -jar /opt/picard/picard.jar"); } - prefix: '' shellQuote: false position: -1 valueFrom: CollectAlignmentSummaryMetrics - prefix: VERBOSITY= separate: false shellQuote: false position: 0 valueFrom: WARNING - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 0 valueFrom: SILENT - prefix: TMP_DIR= separate: false shellQuote: false position: 0 valueFrom: /tmp - prefix: OUTPUT= separate: false shellQuote: false position: 0 valueFrom: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + ".CalculateAlnMetrics-picard.qcstats" } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 4; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/picard2.25.0:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:toolkit': Picard 'sbg:toolkitVersion': '2.25' 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672176 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637681694 'sbg:revisionNotes': Updated docker to BMS repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377479 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377602 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638378979 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-collectalnmetrics/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638378979 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672176 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- a69237bb0ba8c4410c3fd0352a226b89331410d5f269a4f112decb355e4c63f49 label: Picard CollectAlignment 2.18.14 'sbg:x': -609 'sbg:y': -658 - id: picard_insertsize in: - id: input_bam_file source: inputBAM - id: reference_genome source: referenceGenomeSequence out: - id: output_qcstats - id: output_pdf run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-insertsize/4 baseCommand: [] inputs: - id: input_bam_file type: File inputBinding: prefix: INPUT= separate: false shellQuote: false position: 50 label: Input BAM doc: input bam file. Needs to be coordinate sorted secondaryFiles: - pattern: ^.bai required: true - id: deviations type: float? inputBinding: prefix: DEVIATIONS= separate: false shellQuote: false position: 50 valueFrom: |- ${ if( typeof inputs.deviations === 'undefined' || inputs.deviations === null ){ return 10 }else{return inputs.deviations} } label: Deviations doc: >- Generate mean, sd and plots by trimming the data down to MEDIAN + DEVIATIONS*MEDIAN_ABSOLUTE_DEVIATION. This is done because insert size data typically includes enough anomalous values from chimeras and other artifacts to make the mean and sd grossly misleading regarding the real distribution. Default value: 10.0. This option can be set to 'null' to clear the default value. - id: hist_width type: int? inputBinding: prefix: HISTOGRAM_WIDTH= separate: false shellQuote: false position: 50 valueFrom: |- ${ if( typeof inputs.hist_width === 'undefined' || inputs.hist_width === null ){ return null }else{return inputs.hist_width} } label: >- Histogram widthExplicitly sets the Histogram width, overriding automatic truncation of Histogram tail. Also, when calculating mean and standard deviation, only bins <= Histogram_WIDTH will be included. Default value: null. doc: >- Explicitly sets the Histogram width, overriding automatic truncation of Histogram tail. Also, when calculating mean and standard deviation, only bins <= Histogram_WIDTH will be included. Default value: null. - id: min_pct type: float? inputBinding: prefix: MINIMUM_PCT= separate: false shellQuote: false position: 50 valueFrom: |- ${ if( typeof inputs.min_pct === 'undefined' || inputs.min_pct === null ){ return 0.05 }else{return inputs.min_pct} } label: Minimum pct - id: MetricAccumulationLevel type: - 'null' - type: enum symbols: - ALL_READS - SAMPLE - LIBRARY - READ_GROUP name: MetricAccumulationLevel inputBinding: prefix: LEVEL= separate: false shellQuote: false position: 50 valueFrom: |- ${ if( typeof inputs.MetricAccumulationLevel === 'undefined' || inputs.MetricAccumulationLevel === null ){ return 'ALL_READS' }else{return inputs.MetricAccumulationLevel} } - id: include_dups type: - 'null' - type: enum symbols: - 'true' - 'false' name: include_dups inputBinding: prefix: INCLUDE_DUPLICATES= separate: false shellQuote: false position: 50 valueFrom: |- ${ if( typeof inputs.include_dups === 'undefined' || inputs.include_dups === null ){ return false }else{return inputs.include_dups} } label: Include duplicates - id: assume_sorted type: - 'null' - type: enum symbols: - 'true' - 'false' name: assume_sorted inputBinding: prefix: ASSUME_SORTED= separate: false shellQuote: false position: 50 valueFrom: |- ${ if( typeof inputs.assume_sorted === 'undefined' || inputs.assume_sorted === null ){ return true }else{return inputs.assume_sorted} } - id: reference_genome type: File inputBinding: prefix: REFERENCE_SEQUENCE= separate: false shellQuote: false position: 52 secondaryFiles: - pattern: .fai required: true - 'sbg:category': Execution 'sbg:toolDefaultValue': '8000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). - 'sbg:category': Execution 'sbg:toolDefaultValue': '500' id: mem_overhead_per_job type: int? label: Memory overhead per job (in MB) doc: Memory overhead per job (in MB) - 'sbg:category': Execution 'sbg:toolDefaultValue': '4' id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job. outputs: - id: output_qcstats label: output file with bamindex statistics type: File outputBinding: glob: >- ${ return inputs.input_bam_file.basename.replace(/.coord|.name|.bam$/gi,"") + ".InsertSize-picard.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_bam_file))' 'sbg:fileTypes': 'TXT, QCSTATS' - id: output_pdf type: File outputBinding: glob: >- ${ return inputs.input_bam_file.basename.replace(/.coord|.name|.bam$/gi, "") + ".InsertSize-picard.pdf" } outputEval: '$(inheritMetadata(self, inputs.input_bam_file))' label: Picard InsertSize 2.25 arguments: - prefix: '' shellQuote: false position: 1 valueFrom: |- ${ var mem = 8000; var overhead = 500; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } return "java -Xmx".concat(mem-overhead, "M -jar /opt/picard/picard.jar") } - prefix: '' shellQuote: false position: 2 valueFrom: CollectInsertSizeMetrics - prefix: VERBOSITY= separate: false shellQuote: false position: 3 valueFrom: WARNING - prefix: TMP_DIR= separate: false shellQuote: false position: 3 valueFrom: /tmp - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 3 valueFrom: SILENT - prefix: OUTPUT= separate: false shellQuote: false position: 4 valueFrom: >- ${ return inputs.input_bam_file.basename.replace(/.coord|.name|.bam$/gi,"") + ".InsertSize-picard.qcstats" } - prefix: HISTOGRAM_FILE= separate: false shellQuote: false position: 5 valueFrom: >- ${ return inputs.input_bam_file.basename.replace(/.coord|.name|.bam$/gi, "") + ".InsertSize-picard.pdf" } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 4; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/picard2.25.0:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) if (o1.secondaryFiles) { o1.secondaryFiles = inheritMetadata(o1.secondaryFiles, o2) } } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) if (o1[i].secondaryFiles) { o1[i].secondaryFiles = inheritMetadata(o1[i].secondaryFiles, o2) } } } return o1; }; stdout: >- ${ return inputs.input_bam_file.basename.replace(/.coord|.name|.bam/gi,"") + ".insertsize.log" } stderr: $(inputs.input_bam_file.basename).insertsize.log 'sbg:toolkit': picard tools 'sbg:toolkitVersion': '2.25' 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672177 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637681754 'sbg:revisionNotes': Updated image to BMS repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377480 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377603 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638378891 'sbg:revisionNotes': Back to rev 1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-insertsize/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev 1 'sbg:modifiedOn': 1638378891 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672177 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- a37e96b143e50c41bef99e455efa0c7379051f465ad9bc45d012f470766e9ec54 label: Picard InsertSize 2.18.14 'sbg:x': -617.8716430664062 'sbg:y': -304.7713928222656 - id: bms_rename_app in: - id: suffix_string default: .mdup.InsertSize-picard.qcstats source: suffix_string_insert_size_metrics - id: first_part_of_string source: sample_id - id: in_file source: picard_insertsize/output_qcstats out: - id: out_file run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bms-rename-app/4 baseCommand: [] inputs: - 'sbg:category': Name inputs id: suffix_string type: string? label: Suffix String doc: Tool string in desired format with extension. - 'sbg:category': Name inputs 'sbg:toolDefaultValue': None id: second_part_of_string type: string? label: String 2 doc: >- Second part of the output name. Overrides the input file. - 'sbg:category': Name inputs id: first_part_of_string type: string? label: String 1 doc: First part of the output name. Overrides the input file. - 'sbg:stageInput': link 'sbg:category': File Inputs id: in_file type: File inputBinding: shellQuote: false position: 1 'sbg:cmdInclude': true label: Input file doc: Input file. - 'sbg:category': Name inputs id: second_part_of_string_file type: File? label: File - second part of name string doc: >- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- bms-images.sbgenomics.com/bristol-myers-squibb/ubuntu:20.04 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672169 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637675017 'sbg:revisionNotes': Updated image to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377464 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377588 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379494 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bms-rename-app/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379494 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672169 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- ae7e3182c2c69c931a451b1260d7e1e222f8fcb82bc614e798a069d2f83080155 label: BMS Rename App 'sbg:x': -339.6901550292969 'sbg:y': -304.43475341796875 - id: bms_rename_app_1 in: - id: suffix_string default: .mdup.InsertSize-picard.pdf source: suffix_string_insert_size_chart - id: first_part_of_string source: sample_id - id: in_file source: picard_insertsize/output_pdf out: - id: out_file run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bms-rename-app/4 baseCommand: [] inputs: - 'sbg:category': Name inputs id: suffix_string type: string? label: Suffix String doc: Tool string in desired format with extension. - 'sbg:category': Name inputs 'sbg:toolDefaultValue': None id: second_part_of_string type: string? label: String 2 doc: >- Second part of the output name. Overrides the input file. - 'sbg:category': Name inputs id: first_part_of_string type: string? label: String 1 doc: First part of the output name. Overrides the input file. - 'sbg:stageInput': link 'sbg:category': File Inputs id: in_file type: File inputBinding: shellQuote: false position: 1 'sbg:cmdInclude': true label: Input file doc: Input file. - 'sbg:category': Name inputs id: second_part_of_string_file type: File? label: File - second part of name string doc: >- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- bms-images.sbgenomics.com/bristol-myers-squibb/ubuntu:20.04 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672169 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637675017 'sbg:revisionNotes': Updated image to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377464 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377588 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379494 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bms-rename-app/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379494 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672169 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- ae7e3182c2c69c931a451b1260d7e1e222f8fcb82bc614e798a069d2f83080155 label: BMS Rename App 'sbg:x': -341.9266357421875 'sbg:y': -132.98912048339844 - id: bms_rename_app_2 in: - id: suffix_string default: .mdup.BamIndex-picard.qcstats source: suffix_string_bamindex_metrics - id: first_part_of_string source: sample_id - id: in_file source: picard_bamindex/output_qcstats out: - id: out_file run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bms-rename-app/4 baseCommand: [] inputs: - 'sbg:category': Name inputs id: suffix_string type: string? label: Suffix String doc: Tool string in desired format with extension. - 'sbg:category': Name inputs 'sbg:toolDefaultValue': None id: second_part_of_string type: string? label: String 2 doc: >- Second part of the output name. Overrides the input file. - 'sbg:category': Name inputs id: first_part_of_string type: string? label: String 1 doc: First part of the output name. Overrides the input file. - 'sbg:stageInput': link 'sbg:category': File Inputs id: in_file type: File inputBinding: shellQuote: false position: 1 'sbg:cmdInclude': true label: Input file doc: Input file. - 'sbg:category': Name inputs id: second_part_of_string_file type: File? label: File - second part of name string doc: >- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- bms-images.sbgenomics.com/bristol-myers-squibb/ubuntu:20.04 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672169 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637675017 'sbg:revisionNotes': Updated image to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377464 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377588 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379494 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bms-rename-app/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379494 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672169 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- ae7e3182c2c69c931a451b1260d7e1e222f8fcb82bc614e798a069d2f83080155 label: BMS Rename App 'sbg:x': -351.4109802246094 'sbg:y': -461.9278869628906 - id: bms_rename_app_3 in: - id: suffix_string default: .mdup.CalculateAlnMetrics-picard.qcstats source: suffix_string_aln_metrics - id: first_part_of_string source: sample_id - id: in_file source: picard_collectalnmetrics/output out: - id: out_file run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bms-rename-app/4 baseCommand: [] inputs: - 'sbg:category': Name inputs id: suffix_string type: string? label: Suffix String doc: Tool string in desired format with extension. - 'sbg:category': Name inputs 'sbg:toolDefaultValue': None id: second_part_of_string type: string? label: String 2 doc: >- Second part of the output name. Overrides the input file. - 'sbg:category': Name inputs id: first_part_of_string type: string? label: String 1 doc: First part of the output name. Overrides the input file. - 'sbg:stageInput': link 'sbg:category': File Inputs id: in_file type: File inputBinding: shellQuote: false position: 1 'sbg:cmdInclude': true label: Input file doc: Input file. - 'sbg:category': Name inputs id: second_part_of_string_file type: File? label: File - second part of name string doc: >- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- bms-images.sbgenomics.com/bristol-myers-squibb/ubuntu:20.04 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672169 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637675017 'sbg:revisionNotes': Updated image to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377464 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377588 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379494 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bms-rename-app/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379494 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672169 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- ae7e3182c2c69c931a451b1260d7e1e222f8fcb82bc614e798a069d2f83080155 label: BMS Rename App 'sbg:x': -362.19635009765625 'sbg:y': -638.3681640625 requirements: - class: InlineJavascriptRequirement - class: StepInputExpressionRequirement 'sbg:toolAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672178 'sbg:revisionNotes': Workflow decomposed - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637681804 'sbg:revisionNotes': Updated tools images to point to BMS repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377483 'sbg:revisionNotes': Workflow decomposed - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377605 'sbg:revisionNotes': Workflow decomposed - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638380359 'sbg:revisionNotes': Updated all decomposed tools 'sbg:image_url': >- https://bms-cwltool-vayu.sbgenomics.com/ns/brood/images/sbguser/wes-alignment-wf/basic-bamqc/4.png 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/basic-bamqc/4 'sbg:revision': 4 'sbg:revisionNotes': Updated all decomposed tools 'sbg:modifiedOn': 1638380359 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672178 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a2672236893c41778ac0e3c27a59609d5851c69fb13b30c0637637a30927f399f label: Basic QC metrics from BAM files 'sbg:x': 325.2393798828125 'sbg:y': 2373.78857421875 - id: picard_collectmultimetrics in: - id: input_BAM source: inputBAM - id: intervals source: picard_bedtointervallist_target/out_picard_interval_list - id: dbsnp source: dbsnp - id: reference_genome source: referenceGenomeSequence out: - id: AlignmentSummaryMetrics - id: BaitBiasDetailMetrics - id: BaitBiasSummaryMetrics - id: BaseDistributionCycleMetrics - id: BaseDistributionCyclePDF - id: ErrorSummaryMetrics - id: GCBiasDetailMetrics - id: GCBiasPDF - id: GCBiasSummaryMetrics - id: PreAdapterDetailMetrics - id: PreAdapterSummaryMetrics - id: QualityCycleMetrics - id: QualityCyclePDF - id: QualityDistributionMetrics - id: QualityDistributionPDF - id: QualityYieldMetrics - id: OxogMetrics run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-collectmultimetrics/5 baseCommand: [] inputs: - id: input_BAM type: File inputBinding: prefix: INPUT= separate: false shellQuote: false position: 0 'sbg:fileTypes': BAM secondaryFiles: - pattern: ^.bai required: true - id: intervals type: File? inputBinding: prefix: INTERVALS= separate: false shellQuote: false position: 0 label: bait intervals doc: >- An optional list of intervals to restrict analysis to. Only pertains to some of the PROGRAMs. Programs whose stand-alone CLP does not have an INTERVALS argument will silently ignore this argument. Default value: null. 'sbg:fileTypes': intervals - id: near_distance type: int? inputBinding: prefix: NEAR_DISTANCE= separate: false shellQuote: false position: 0 label: Near distance doc: >- The maximum distance between a read and the nearest probe/bait/amplicon for the read to be considered 'near probe' and included in percent selected. Default value: 250. This option can be set to 'null' to clear the default value. - id: dbsnp type: File inputBinding: prefix: DB_SNP= separate: false shellQuote: false position: 0 label: dbsnp doc: >- VCF format dbSNP file, used to exclude regions around known polymorphisms from analysis by some PROGRAMs; PROGRAMs whose CLP doesn't allow for this argument will quietly ignore it. Default value: null. secondaryFiles: - pattern: .tbi required: true - id: reference_genome type: File inputBinding: prefix: REFERENCE_SEQUENCE= separate: false shellQuote: false position: 0 label: reference genome (fa) 'sbg:fileTypes': fasta secondaryFiles: - pattern: .fai required: true - 'sbg:category': Execution 'sbg:toolDefaultValue': '16000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). - 'sbg:category': Execution id: mem_overhead_per_job type: int? label: Memory overhead per job (in MB) doc: Memory overhead per job (in MB). - 'sbg:category': Execution id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job outputs: - id: AlignmentSummaryMetrics label: AligmmentSummaryMetrics type: File outputBinding: glob: '*.alignment_summary_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' 'sbg:fileTypes': 'txt, qcstats' - id: BaitBiasDetailMetrics label: Bait Bias Detail Metrics type: File outputBinding: glob: '*.bait_bias_detail_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' 'sbg:fileTypes': 'txt, qcstats' - id: BaitBiasSummaryMetrics label: Summary Bait bias metrics type: File outputBinding: glob: '*.bait_bias_summary_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: BaseDistributionCycleMetrics label: base distribution by cycle metrics type: File outputBinding: glob: '*.base_distribution_by_cycle_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: BaseDistributionCyclePDF label: base_distribution_by_cycle.pdf type: File outputBinding: glob: '*.base_distribution_by_cycle.pdf' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: ErrorSummaryMetrics label: error summary metrics type: File outputBinding: glob: '*.error_summary_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' 'sbg:fileTypes': 'txt, qcstats' - id: GCBiasDetailMetrics label: GC bias detail metrics type: File outputBinding: glob: '*.gc_bias.detail_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: GCBiasPDF label: GC bias plot type: File outputBinding: glob: '*.gc_bias.pdf' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: GCBiasSummaryMetrics label: GC bias summary metrics type: File outputBinding: glob: '*.gc_bias.summary_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: PreAdapterDetailMetrics label: pre adapter detail metrics type: File outputBinding: glob: '*.pre_adapter_detail_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: PreAdapterSummaryMetrics label: pre adapter summary metrics type: File outputBinding: glob: '*.pre_adapter_summary_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: QualityCycleMetrics label: quality by cycle metrics type: File outputBinding: glob: '*.quality_by_cycle_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: QualityCyclePDF label: quality by cycle plot type: File outputBinding: glob: '*.quality_by_cycle.pdf' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: QualityDistributionMetrics label: quality distribution metrics type: File outputBinding: glob: '*.quality_distribution_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: QualityDistributionPDF label: quality distribution plot type: File outputBinding: glob: '*.quality_distribution.pdf' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: QualityYieldMetrics label: quality yield metrics type: File outputBinding: glob: '*.quality_yield_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: OxogMetrics label: oxog metrics type: File outputBinding: glob: '*.oxog_metrics' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' doc: Used to collect multiple metrics from DNA-seq experiments label: Picard CollectMultiMetrics 2.25 arguments: - prefix: '' shellQuote: false position: -2 valueFrom: |- ${ var mem = 16000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } var overhead = 500; if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } return "java -Xmx".concat(mem-overhead, "M -jar /opt/picard/picard.jar"); } - prefix: '' shellQuote: false position: -1 valueFrom: CollectMultipleMetrics - prefix: VERBOSITY= separate: false shellQuote: false position: 0 valueFrom: WARNING - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 0 valueFrom: SILENT - prefix: TMP_DIR= separate: false shellQuote: false position: 0 valueFrom: /tmp - prefix: PROGRAM= separate: false shellQuote: false position: 0 valueFrom: CollectGcBiasMetrics - prefix: PROGRAM= separate: false shellQuote: false position: 0 valueFrom: QualityScoreDistribution - prefix: PROGRAM= separate: false shellQuote: false position: 0 valueFrom: MeanQualityByCycle - prefix: PROGRAM= separate: false shellQuote: false position: 0 valueFrom: CollectBaseDistributionByCycle - prefix: PROGRAM= separate: false shellQuote: false position: 0 valueFrom: CollectQualityYieldMetrics - prefix: PROGRAM= separate: false shellQuote: false position: 0 valueFrom: CollectSequencingArtifactMetrics - prefix: OUTPUT= separate: false shellQuote: false position: 0 valueFrom: >- $(inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') ) - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ var mem = 16000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } var overhead = 500; if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } return "&& java -Xmx".concat(mem-overhead, "M -jar /opt/picard/picard.jar"); } - prefix: '' shellQuote: false position: 21 valueFrom: ConvertSequencingArtifactToOxoG - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 22 valueFrom: SILENT - prefix: REFERENCE_SEQUENCE= separate: false shellQuote: false position: 24 valueFrom: $(inputs.reference_genome.path) - prefix: INPUT_BASE= separate: false shellQuote: false position: 26 valueFrom: >- $(inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') ) requirements: - class: ShellCommandRequirement - class: NetworkAccess networkAccess: true - class: ResourceRequirement ramMin: |- ${ var mem = 16000; var overhead = 500; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } return mem - overhead; } coresMin: |- ${ var cpus = 4; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/picard2.25.0:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:toolkit': picard tools 'sbg:toolkitVersion': '2.25' 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672180 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637679790 'sbg:revisionNotes': Updated image to bms platform repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377485 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377607 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638378845 'sbg:revisionNotes': Back to rev1 - 'sbg:revision': 5 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638462167 'sbg:revisionNotes': Added network access to true 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-collectmultimetrics/5 'sbg:revision': 5 'sbg:revisionNotes': Added network access to true 'sbg:modifiedOn': 1638462167 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672180 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 5 'sbg:publisher': sbg 'sbg:content_hash': a9275aa5b48d62563272c7ea75bef9ec87c6cf0779434f867437d2089d3ca9d85 label: picard CollectMultiMetrics 2.18.14 'sbg:x': 291.5162048339844 'sbg:y': 1134.1297607421875 - id: picard_collecths_CCDS in: - id: input_BAM source: inputBAM - id: bait_intervals source: TargetCCDS - id: bait_set_name default: CCDS - id: target_intervals source: TargetCCDS - id: reference_genome source: referenceGenomeSequence out: - id: outputMetrics - id: outputTargetMetrics run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-collecths-CCDS/1 baseCommand: - java - '-jar' - '-Xmx23G' - /opt/picard/picard.jar - CollectHsMetrics inputs: - id: input_BAM type: File inputBinding: prefix: INPUT= separate: false shellQuote: false position: 0 'sbg:fileTypes': BAM secondaryFiles: - pattern: ^.bai required: true - id: bait_intervals type: File inputBinding: prefix: BAIT_INTERVALS= separate: false shellQuote: false position: 0 label: bait intervals doc: >- An interval list file that contains the locations of the baits used. Default value: null. This option must be specified at least 1 times. 'sbg:fileTypes': intervals - id: bait_set_name type: string? inputBinding: prefix: BAIT_SET_NAME= separate: false shellQuote: false position: 0 valueFrom: $('"'+self+'"') label: Name of exome kit doc: >- Bait set name. If not provided it is inferred from the filename of the bait intervals. Default value: null. - id: min_mapping_quality type: int? inputBinding: prefix: MINIMUM_MAPPING_QUALITY= separate: false shellQuote: false position: 0 label: minimum mapping quality doc: >- Minimum mapping quality for a read to contribute coverage. Default value: 20. This option can be set to 'null' to clear the default value. - id: min_base_quality type: int? inputBinding: prefix: MINIMUM_BASE_QUALITY= separate: false shellQuote: false position: 0 label: minimum base quality doc: >- Minimum base quality for a base to contribute coverage. Default value: 20. This option can be set to 'null' to clear the default value. - id: level type: - 'null' - type: enum symbols: - ALL_READS - SAMPLE - LIBRARY - READ_GROUP name: level inputBinding: prefix: METRIC_ACCUMULATION_LEVEL= separate: false shellQuote: false position: 0 - id: clip_overlapping type: boolean? inputBinding: prefix: CLIP_OVERLAPPING_READS= separate: false shellQuote: false position: 0 label: clip overlapping reads doc: >- True if we are to clip overlapping reads, false otherwise. Default value: true. This option can be set to 'null' to clear the default value. Possible values: {true, false} - id: near_distance type: int? inputBinding: prefix: NEAR_DISTANCE= separate: false shellQuote: false position: 0 label: Near distance doc: >- The maximum distance between a read and the nearest probe/bait/amplicon for the read to be considered 'near probe' and included in percent selected. Default value: 250. This option can be set to 'null' to clear the default value. - id: coverage_cap type: int? inputBinding: prefix: COVERAGE_CAP= separate: false shellQuote: false position: 0 label: coverage cap doc: >- Parameter to set a max coverage limit for Theoretical Sensitivity calculations. Default is 200. Default value: 200. This option can be set to 'null' to clear the default value. - id: sample_size type: int? inputBinding: prefix: SAMPLE_SIZE= separate: false shellQuote: false position: 0 label: sample size doc: >- Sample Size used for Theoretical Het Sensitivity sampling. Default is 10000. Default value: 10000. This option can be set to 'null' to clear the default value. - id: target_intervals type: File inputBinding: prefix: TARGET_INTERVALS= separate: false shellQuote: false position: 0 label: target intervals 'sbg:fileTypes': intervals - id: reference_genome type: File inputBinding: prefix: R= separate: false shellQuote: false position: 0 label: reference sequence (fa) 'sbg:fileTypes': fasta secondaryFiles: - pattern: .fai required: true outputs: - id: outputMetrics type: File? outputBinding: glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + "CollectWESSeqMetrics-picard.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: outputTargetMetrics type: File? outputBinding: glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') + ".trgcov.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_BAM))' label: Picard CollecHsMetrics 2.25 arguments: - prefix: VERBOSITY= separate: false shellQuote: false position: 0 valueFrom: WARNING - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 0 valueFrom: SILENT - prefix: TMP_DIR= separate: false shellQuote: false position: 0 valueFrom: /tmp - prefix: PER_TARGET_COVERAGE= separate: false shellQuote: false position: 0 valueFrom: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') + ".trgcov.qcstats" } - prefix: OUTPUT= separate: false shellQuote: false position: 0 valueFrom: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + "CollectWESSeqMetrics-picard.qcstats" } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: 24000 coresMin: 4 - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/picard2.25.0:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:toolkit': picard tools 'sbg:toolkitVersion': '2.25' 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672181 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637679739 'sbg:revisionNotes': Updated image to bms repo 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-collecths-CCDS/1 'sbg:revision': 1 'sbg:revisionNotes': Updated image to bms repo 'sbg:modifiedOn': 1637679739 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672181 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 1 'sbg:publisher': sbg 'sbg:content_hash': aaa50294f7d684e65134b83a38ee8dc46263b7a1c98166ca00c8cbacde2ebae50 label: picard CollecHsMetrics 2.20.7 'sbg:x': 316.9996337890625 'sbg:y': 564.6114501953125 - id: picard_collecthsmetrics_COSMIC in: - id: input_BAM source: inputBAM - id: bait_intervals source: COSMIC - id: bait_set_name default: COSMIC - id: level default: ALL_READS - id: target_intervals source: COSMIC - id: reference_genome source: referenceGenomeSequence out: - id: outputMetrics - id: outputTargetMetrics run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-collecths-CCDS/1 baseCommand: - java - '-jar' - '-Xmx23G' - /opt/picard/picard.jar - CollectHsMetrics inputs: - id: input_BAM type: File inputBinding: prefix: INPUT= separate: false shellQuote: false position: 0 'sbg:fileTypes': BAM secondaryFiles: - pattern: ^.bai required: true - id: bait_intervals type: File inputBinding: prefix: BAIT_INTERVALS= separate: false shellQuote: false position: 0 label: bait intervals doc: >- An interval list file that contains the locations of the baits used. Default value: null. This option must be specified at least 1 times. 'sbg:fileTypes': intervals - id: bait_set_name type: string? inputBinding: prefix: BAIT_SET_NAME= separate: false shellQuote: false position: 0 valueFrom: $('"'+self+'"') label: Name of exome kit doc: >- Bait set name. If not provided it is inferred from the filename of the bait intervals. Default value: null. - id: min_mapping_quality type: int? inputBinding: prefix: MINIMUM_MAPPING_QUALITY= separate: false shellQuote: false position: 0 label: minimum mapping quality doc: >- Minimum mapping quality for a read to contribute coverage. Default value: 20. This option can be set to 'null' to clear the default value. - id: min_base_quality type: int? inputBinding: prefix: MINIMUM_BASE_QUALITY= separate: false shellQuote: false position: 0 label: minimum base quality doc: >- Minimum base quality for a base to contribute coverage. Default value: 20. This option can be set to 'null' to clear the default value. - id: level type: - 'null' - type: enum symbols: - ALL_READS - SAMPLE - LIBRARY - READ_GROUP name: level inputBinding: prefix: METRIC_ACCUMULATION_LEVEL= separate: false shellQuote: false position: 0 - id: clip_overlapping type: boolean? inputBinding: prefix: CLIP_OVERLAPPING_READS= separate: false shellQuote: false position: 0 label: clip overlapping reads doc: >- True if we are to clip overlapping reads, false otherwise. Default value: true. This option can be set to 'null' to clear the default value. Possible values: {true, false} - id: near_distance type: int? inputBinding: prefix: NEAR_DISTANCE= separate: false shellQuote: false position: 0 label: Near distance doc: >- The maximum distance between a read and the nearest probe/bait/amplicon for the read to be considered 'near probe' and included in percent selected. Default value: 250. This option can be set to 'null' to clear the default value. - id: coverage_cap type: int? inputBinding: prefix: COVERAGE_CAP= separate: false shellQuote: false position: 0 label: coverage cap doc: >- Parameter to set a max coverage limit for Theoretical Sensitivity calculations. Default is 200. Default value: 200. This option can be set to 'null' to clear the default value. - id: sample_size type: int? inputBinding: prefix: SAMPLE_SIZE= separate: false shellQuote: false position: 0 label: sample size doc: >- Sample Size used for Theoretical Het Sensitivity sampling. Default is 10000. Default value: 10000. This option can be set to 'null' to clear the default value. - id: target_intervals type: File inputBinding: prefix: TARGET_INTERVALS= separate: false shellQuote: false position: 0 label: target intervals 'sbg:fileTypes': intervals - id: reference_genome type: File inputBinding: prefix: R= separate: false shellQuote: false position: 0 label: reference sequence (fa) 'sbg:fileTypes': fasta secondaryFiles: - pattern: .fai required: true outputs: - id: outputMetrics type: File? outputBinding: glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + "CollectWESSeqMetrics-picard.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: outputTargetMetrics type: File? outputBinding: glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') + ".trgcov.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_BAM))' label: Picard CollecHsMetrics 2.25 arguments: - prefix: VERBOSITY= separate: false shellQuote: false position: 0 valueFrom: WARNING - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 0 valueFrom: SILENT - prefix: TMP_DIR= separate: false shellQuote: false position: 0 valueFrom: /tmp - prefix: PER_TARGET_COVERAGE= separate: false shellQuote: false position: 0 valueFrom: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') + ".trgcov.qcstats" } - prefix: OUTPUT= separate: false shellQuote: false position: 0 valueFrom: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + "CollectWESSeqMetrics-picard.qcstats" } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: 24000 coresMin: 4 - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/picard2.25.0:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:toolkit': picard tools 'sbg:toolkitVersion': '2.25' 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672181 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637679739 'sbg:revisionNotes': Updated image to bms repo 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-collecths-CCDS/1 'sbg:revision': 1 'sbg:revisionNotes': Updated image to bms repo 'sbg:modifiedOn': 1637679739 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672181 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 1 'sbg:publisher': sbg 'sbg:content_hash': aaa50294f7d684e65134b83a38ee8dc46263b7a1c98166ca00c8cbacde2ebae50 label: picard CollecHsMetrics 2.20.7 'sbg:x': 326.5919494628906 'sbg:y': 136.6065673828125 - id: sexdetermination in: - id: inputBigWig source: wf_bam2bw/outputBW - id: genomeVersion default: hg38 source: genomeVersion - id: Xthreshold default: 0.02 - id: Ythreshold default: 0.02 - id: sampleName source: sampleName out: - id: SexDetermMetrics - id: SexPrediction run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/sexdetermination/1 baseCommand: - Rscript - /usr/local/bin/gender.R inputs: - id: inputBigWig type: File inputBinding: prefix: '--bigwig' shellQuote: false position: 0 label: Bigwig used for input - id: genomeVersion type: - 'null' - type: enum symbols: - hg38 - 1k - hg19 name: genomeVersion inputBinding: prefix: '--genomeversion' shellQuote: false position: 0 label: Version of the human genome to use doc: 1k and hg38 are synonyms - id: Xthreshold type: float? inputBinding: prefix: '--Xthreshold' shellQuote: false position: 0 label: X threshold doc: >- maximum value or Y/X ratio to determine that a sample is female [0.03] - id: Ythreshold type: float? inputBinding: prefix: '--Ythreshold' shellQuote: false position: 0 label: Y threshold doc: >- minimum value of Y/X ratio to determine that a sample is male [0.09] - id: sampleName type: string inputBinding: prefix: '--name' shellQuote: false position: 0 label: sample name - 'sbg:category': Execution id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). - 'sbg:category': Execution id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job outputs: - id: SexDetermMetrics type: File outputBinding: glob: '*.qcstats' outputEval: '$(inheritMetadata(self, inputs.inputBigWig))' - id: SexPrediction type: string? outputBinding: loadContents: true glob: '*.qcstats' outputEval: |- ${ var str = self[0].contents var lines=str.split(/\n+/) var fields=lines[1].split(/\t/) return( fields[4] ) } label: Sex determination arguments: - prefix: '--output' shellQuote: false position: 0 valueFrom: $(inputs.sampleName + ".qcstats") requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 2000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 1; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/gender.v1.0:latest - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:toolAuthor': Konstantinos Mavrommatis 'sbg:toolkit': sex determination 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672182 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682532 'sbg:revisionNotes': Updated image to BMS repo 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/sexdetermination/1 'sbg:revision': 1 'sbg:revisionNotes': Updated image to BMS repo 'sbg:modifiedOn': 1637682532 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672182 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 1 'sbg:publisher': sbg 'sbg:content_hash': ad73f17c2053dc29b0efc3a460aabf018d057de264920134538c4862e0862bf2d label: sexdetermination 'sbg:x': 1716.8399658203125 'sbg:y': 1810.4110107421875 - id: wf_bam2bw in: - id: inputBAM source: inputBAM - id: chromosomeSize source: basic_bamqc/BamIndexMetrics out: - id: outputBW - id: outputBEDGRAPH run: class: Workflow cwlVersion: v1.2 id: sbguser/wes-alignment-wf/wf-bam2bw/4 doc: >- Create a bigwig file from a BAM file. This version of the pipeline keeps the same names of chromosomes as the ones in the BAM file. The resulitng bw file may not be viewable by the UCSC browser due to the chromosome names. label: BAM to bigwig $namespaces: sbg: 'https://sevenbridges.com' inputs: - id: inputBAM 'sbg:fileTypes': bam type: File label: input BAM file secondaryFiles: - pattern: ^.bai required: true 'sbg:x': -607 'sbg:y': -182 - id: chromosomeSize 'sbg:fileTypes': txt type: File label: Chromosome sizes from BamIndex doc: Output file from BamIndex 'sbg:x': -609 'sbg:y': -42 - id: max type: int? label: Max coverage doc: |- Combine all positions with a depth >= max into a single bin in the histogram. Irrelevant for -d and -bedGraph - (INTEGER) 'sbg:exposed': true - id: scale type: string? label: Scaling factor doc: >- Scale the coverage by a constant factor. Each coverage value is multiplied by this factor before being reported. Useful for normalizing coverage by, e.g., reads per million (RPM). - Default is 1.0; i.e., unscaled. In this tool this value can also be added through the mappedReads argument. 'sbg:exposed': true - id: mappedReads type: int? doc: >- Number of mapped reads. This value can be used to calculate the scaling factor, if not directly provided. 'sbg:exposed': true outputs: - id: outputBW outputSource: - bedgraph2bigwig/outputBW type: File? 'sbg:x': 182 'sbg:y': -55 - id: outputBEDGRAPH outputSource: - bedtools/outputBEDGRAPH 'sbg:fileTypes': bedgraph type: File 'sbg:x': 179 'sbg:y': -176 steps: - id: bedtools in: - id: BedGraph default: true - id: max source: max - id: scale source: scale - id: inputFile source: inputBAM - id: split default: true - id: mappedReads source: mappedReads out: - id: outputBEDGRAPH run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bedtools/4 baseCommand: [] inputs: - id: BedGraph type: boolean? inputBinding: prefix: '-bg' shellQuote: false position: 0 label: BedGraph doc: Report depth in BedGraph format. - id: Depth_1_base type: boolean? inputBinding: prefix: '-d' shellQuote: false position: 0 label: Depth 1 base doc: >- Report the depth at each genome position (with one-based coordinates). Default behavior is to report a histogram. - id: Depth_0_base type: boolean? inputBinding: prefix: '-dz' shellQuote: false position: 0 label: Depth 0 based coordinates doc: >- Report the depth at each genome position (with zero-based coordinates). Reports only non-zero positions. Default behavior is to report a histogram. - id: BedGraph_include_0 type: boolean? inputBinding: prefix: '-bgz' shellQuote: false position: 0 label: BedGraph including 0s doc: >- Report depth in BedGraph format, as above (-bg). However with this option, regions with zero coverage are also reported. This allows one to quickly extract all regions of a genome with 0 coverage by applying: "grep -w 0$" to the output. - id: strand type: - 'null' - type: enum symbols: - + - '-' name: strand inputBinding: prefix: '-strand' shellQuote: false position: 0 label: Strand coverage doc: >- Calculate coverage of intervals from a specific strand. With BED files, requires at least 6 columns (strand is column 6). - (STRING): can be + or - - id: paired_fragments type: boolean? inputBinding: prefix: '-pc' shellQuote: false position: 0 label: paired-end coverage doc: Calculate coverage of pair-end fragments. - id: fragment_size type: boolean? inputBinding: prefix: '-fs' shellQuote: false position: 0 label: Fragment size doc: >- Force to use provided fragment size instead of read length. Works with BAM files only - id: change_mate_strand type: boolean? inputBinding: prefix: '-du' shellQuote: false position: 0 label: Change mate strand doc: >- Change strand af the mate read (so both reads from the same strand) useful for strand specific Works for BAM files only - id: five_prime type: boolean? inputBinding: prefix: '-5' shellQuote: false position: 0 label: Five prime only doc: >- Calculate coverage of 5" positions (instead of entire interval). - id: three_prime type: boolean? inputBinding: prefix: '-3' shellQuote: false position: 0 label: Three prime coverage doc: >- Calculate coverage of 3" positions (instead of entire interval). - id: max type: int? inputBinding: prefix: '-max' shellQuote: false position: 0 label: Max coverage doc: |- Combine all positions with a depth >= max into a single bin in the histogram. Irrelevant for -d and -bedGraph - (INTEGER) - id: scale type: string? inputBinding: prefix: '-scale' shellQuote: false position: 0 label: Scaling factor doc: >- Scale the coverage by a constant factor. Each coverage value is multiplied by this factor before being reported. Useful for normalizing coverage by, e.g., reads per million (RPM). - Default is 1.0; i.e., unscaled. In this tool this value can also be added through the mappedReads argument. - id: trackline type: string? inputBinding: prefix: '-trackline' shellQuote: false position: 0 label: Trackline doc: "Adds a UCSC/Genome-Browser track line definition in the first line of the output.\n- See here for more details about track line definition:\n\t\t\t http://genome.ucsc.edu/goldenPath/help/bedgraph.html\n- NOTE: When adding a trackline definition, the output BedGraph can be easily uploaded to the Genome Browser as a custom track,\nBUT CAN NOT be converted into a BigWig file (w/o removing the first line)." - id: trackopts type: string? inputBinding: prefix: '-trackopts' shellQuote: false position: 0 label: Track options doc: >- Writes additional track line definition parameters in the first line. - Example: -trackopts 'name="My Track" visibility=2 color=255,30,30' Note the use of single-quotes if you have spaces in your parameters. - (TEXT) - id: inputFile type: File inputBinding: prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if( inputs.inputFile.nameext === ".bam"){ return( "-ibam " + inputs.inputFile.path) }else{ return( "-i " + inputs.inputFile.path) } } label: Input file doc: |- Input file (VCF,BED. GFF) Use -ibam for BAM file - id: chromosomeSize type: File? inputBinding: prefix: '-g' shellQuote: false position: 0 valueFrom: $(inputs.chromosomeSize.basename) label: Genome doc: >- Needed for bed/gff/vcf files. Tab delimited file with two first columns chromosome and size, or the output of BamIndex. - id: split type: boolean? inputBinding: prefix: '-split' shellQuote: false position: 0 - id: mappedReads type: int? inputBinding: prefix: '-scale' shellQuote: false position: 0 valueFrom: |- ${ if (isNaN(parseInt(inputs.mappedReads))) { return 1 } else{ return 1000000/parseInt( inputs.mappedReads ) } } doc: >- Number of mapped reads. This value can be used to calculate the scaling factor, if not directly provided. - 'sbg:category': Execution 'sbg:toolDefaultValue': '8000' id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB) - 'sbg:category': Execution 'sbg:toolDefaultValue': '4' id: cpu_per_job type: int? label: CPUs per job doc: Number CPUs per job outputs: - id: outputBEDGRAPH doc: output bedgraph label: output BedGraph type: File outputBinding: glob: '*.bedgraph' outputEval: '$(inheritMetadata(self, inputs.inputFile))' 'sbg:fileTypes': bedgraph doc: >- Compute the coverage of a feature file among a genome. The scaling factor that is used in this tool (-scale) is typically 1,000,000/(mapped reads in BAM). used by many ENCODE datasets. label: BEDtools genomeCoverage v2.30.0 arguments: - prefix: '' shellQuote: false position: 10 valueFrom: '| LC_COLLATE=C sort -k1,1 -k2,2n' - prefix: '' shellQuote: false position: -10 valueFrom: |- ${ if(inputs.chromosomeSize !==null){ return ( "awk '{gsub(\"length=\t\",\"\",$0); print $1\"\t\"$2 }' "+ inputs.chromosomeSize.path + "| grep -v '^NoCoordinateCount'" + "> " + inputs.chromosomeSize.basename +" && ") } else{ return "" } } - prefix: '' shellQuote: false position: -5 valueFrom: bedtools genomecov requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 4; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/bedtools_2-30:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; stdout: >- $( inputs.inputFile.basename.replace(/.vcf$|.bam$|.gff$|.gtf$|.coord|.name/g,"")+".bedgraph" ) 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672183 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637681898 'sbg:revisionNotes': Updated image to point to BMS repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377486 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377609 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638378789 'sbg:revisionNotes': Back to rev 1 'sbg:image_url': null 'sbg:toolkit': BEDtools 'sbg:toolkitVersion': 2.30.0 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bedtools/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev 1 'sbg:modifiedOn': 1638378789 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672183 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- ac10e536220c2338c86bd87777b7992742fb97d1576656d35a1390bd5b09759cc label: bedtools genomeCoverage 'sbg:x': -363 'sbg:y': -182 - id: bedgraph2bigwig in: - id: inputBedGraph source: bedtools/outputBEDGRAPH - id: chromosomeSize source: chromosomeSize out: - id: outputBW run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bedgraph2bigwig/4 baseCommand: [] inputs: - id: inputBedGraph type: File inputBinding: shellQuote: false position: 1 label: InputBedGraph doc: Input file in bedgraph format 'sbg:fileTypes': bedgraph - id: chromosomeSize type: File label: Chromosome sizes doc: This is the output from the BamIndex step 'sbg:fileTypes': txt - 'sbg:category': Execution id: mem_per_job type: int? label: Memory per job (in MB) doc: Memory per job (in MB). - 'sbg:category': Execution id: cpu_per_job type: int? label: CPUs per job doc: Number of CPUs per job outputs: - id: outputBW doc: Bigwig file label: output bigwig file type: File outputBinding: glob: '*.bw' outputEval: '$(inheritMetadata(self, inputs.inputBedGraph))' 'sbg:fileTypes': 'bw, bigwig' label: Bedgraph to Bigwig arguments: - prefix: '' shellQuote: false position: 10 valueFrom: >- $( inputs.inputBedGraph.basename.replace(/.bed$|.bedgraph$/, ".bw") ) - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ return ( "awk '{gsub(\"length=\t\",\"\",$0); print $1\"\t\"$2 }' "+ inputs.chromosomeSize.path + "| grep -v '^NoCoordinateCount'" + "> " + inputs.chromosomeSize.basename +" && ") } - prefix: '' shellQuote: false position: 0 valueFrom: bedGraphToBigWig - prefix: '' shellQuote: false position: 4 valueFrom: $(inputs.chromosomeSize.basename) requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 1000; if (inputs.mem_per_job){ mem = inputs.mem_per_job; } return mem; } coresMin: |- ${ var cpus = 1; if (inputs.cpu_per_job){ cpus = inputs.cpu_per_job; } return cpus; } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/ucsc:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672184 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637681971 'sbg:revisionNotes': Updated image to BMS repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377487 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377610 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638378674 'sbg:revisionNotes': Back to rev 1 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/bedgraph2bigwig/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev 1 'sbg:modifiedOn': 1638378674 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672184 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': >- affd4a4c18f82a9cc07f3baa4af7a0cf16e838e8d33be3735e6d8a2e53f0c62c7 label: Bedgraph to Bigwig 'sbg:x': -26 'sbg:y': -57 requirements: - class: InlineJavascriptRequirement - class: StepInputExpressionRequirement 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672185 'sbg:revisionNotes': Workflow decomposed - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682007 'sbg:revisionNotes': Updated images to point to BMS repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377489 'sbg:revisionNotes': Workflow decomposed - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377611 'sbg:revisionNotes': Workflow decomposed - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638381587 'sbg:revisionNotes': Back to rev 1 'sbg:image_url': >- https://bms-cwltool-vayu.sbgenomics.com/ns/brood/images/sbguser/wes-alignment-wf/wf-bam2bw/4.png 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/wf-bam2bw/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev 1 'sbg:modifiedOn': 1638381587 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672185 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a86cdba578cd36dcc2261aa53ce88f34f37f0a1b6b8b3497641db8d89dff8b5df label: BAM to bigwig 'sbg:x': 785.6338500976562 'sbg:y': 2194.32275390625 - id: picard_collecthsmetrics in: - id: input_BAM source: inputBAM - id: bait_intervals source: picard_bedtointervallist_bait/out_picard_interval_list - id: bait_set_name source: bait_set_name - id: target_intervals source: picard_bedtointervallist_target/out_picard_interval_list - id: reference_genome source: referenceGenomeSequence out: - id: outputMetrics - id: outputTargetMetrics run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-collecths-CCDS/1 baseCommand: - java - '-jar' - '-Xmx23G' - /opt/picard/picard.jar - CollectHsMetrics inputs: - id: input_BAM type: File inputBinding: prefix: INPUT= separate: false shellQuote: false position: 0 'sbg:fileTypes': BAM secondaryFiles: - pattern: ^.bai required: true - id: bait_intervals type: File inputBinding: prefix: BAIT_INTERVALS= separate: false shellQuote: false position: 0 label: bait intervals doc: >- An interval list file that contains the locations of the baits used. Default value: null. This option must be specified at least 1 times. 'sbg:fileTypes': intervals - id: bait_set_name type: string? inputBinding: prefix: BAIT_SET_NAME= separate: false shellQuote: false position: 0 valueFrom: $('"'+self+'"') label: Name of exome kit doc: >- Bait set name. If not provided it is inferred from the filename of the bait intervals. Default value: null. - id: min_mapping_quality type: int? inputBinding: prefix: MINIMUM_MAPPING_QUALITY= separate: false shellQuote: false position: 0 label: minimum mapping quality doc: >- Minimum mapping quality for a read to contribute coverage. Default value: 20. This option can be set to 'null' to clear the default value. - id: min_base_quality type: int? inputBinding: prefix: MINIMUM_BASE_QUALITY= separate: false shellQuote: false position: 0 label: minimum base quality doc: >- Minimum base quality for a base to contribute coverage. Default value: 20. This option can be set to 'null' to clear the default value. - id: level type: - 'null' - type: enum symbols: - ALL_READS - SAMPLE - LIBRARY - READ_GROUP name: level inputBinding: prefix: METRIC_ACCUMULATION_LEVEL= separate: false shellQuote: false position: 0 - id: clip_overlapping type: boolean? inputBinding: prefix: CLIP_OVERLAPPING_READS= separate: false shellQuote: false position: 0 label: clip overlapping reads doc: >- True if we are to clip overlapping reads, false otherwise. Default value: true. This option can be set to 'null' to clear the default value. Possible values: {true, false} - id: near_distance type: int? inputBinding: prefix: NEAR_DISTANCE= separate: false shellQuote: false position: 0 label: Near distance doc: >- The maximum distance between a read and the nearest probe/bait/amplicon for the read to be considered 'near probe' and included in percent selected. Default value: 250. This option can be set to 'null' to clear the default value. - id: coverage_cap type: int? inputBinding: prefix: COVERAGE_CAP= separate: false shellQuote: false position: 0 label: coverage cap doc: >- Parameter to set a max coverage limit for Theoretical Sensitivity calculations. Default is 200. Default value: 200. This option can be set to 'null' to clear the default value. - id: sample_size type: int? inputBinding: prefix: SAMPLE_SIZE= separate: false shellQuote: false position: 0 label: sample size doc: >- Sample Size used for Theoretical Het Sensitivity sampling. Default is 10000. Default value: 10000. This option can be set to 'null' to clear the default value. - id: target_intervals type: File inputBinding: prefix: TARGET_INTERVALS= separate: false shellQuote: false position: 0 label: target intervals 'sbg:fileTypes': intervals - id: reference_genome type: File inputBinding: prefix: R= separate: false shellQuote: false position: 0 label: reference sequence (fa) 'sbg:fileTypes': fasta secondaryFiles: - pattern: .fai required: true outputs: - id: outputMetrics type: File? outputBinding: glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + "CollectWESSeqMetrics-picard.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: outputTargetMetrics type: File? outputBinding: glob: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') + ".trgcov.qcstats" } outputEval: '$(inheritMetadata(self, inputs.input_BAM))' label: Picard CollecHsMetrics 2.25 arguments: - prefix: VERBOSITY= separate: false shellQuote: false position: 0 valueFrom: WARNING - prefix: VALIDATION_STRINGENCY= separate: false shellQuote: false position: 0 valueFrom: SILENT - prefix: TMP_DIR= separate: false shellQuote: false position: 0 valueFrom: /tmp - prefix: PER_TARGET_COVERAGE= separate: false shellQuote: false position: 0 valueFrom: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,'') + ".trgcov.qcstats" } - prefix: OUTPUT= separate: false shellQuote: false position: 0 valueFrom: >- ${ return inputs.input_BAM.basename.replace(/.coord|.name|.bam$/gi,"") + "CollectWESSeqMetrics-picard.qcstats" } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: 24000 coresMin: 4 - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/picard2.25.0:0 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:toolkit': picard tools 'sbg:toolkitVersion': '2.25' 'sbg:wrapperAuthor': Konstantinos Mavrommatis 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672181 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637679739 'sbg:revisionNotes': Updated image to bms repo 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-collecths-CCDS/1 'sbg:revision': 1 'sbg:revisionNotes': Updated image to bms repo 'sbg:modifiedOn': 1637679739 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672181 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 1 'sbg:publisher': sbg 'sbg:content_hash': aaa50294f7d684e65134b83a38ee8dc46263b7a1c98166ca00c8cbacde2ebae50 label: picard CollecHsMetrics 2.20.7 'sbg:x': 334.1081848144531 'sbg:y': -202.28823852539062 - id: bms_rename_app in: - id: suffix_string default: .mdup.bw - id: first_part_of_string source: sampleName - id: in_file source: wf_bam2bw/outputBW out: - id: out_file run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bms-rename-app/4 baseCommand: [] inputs: - 'sbg:category': Name inputs id: suffix_string type: string? label: Suffix String doc: Tool string in desired format with extension. - 'sbg:category': Name inputs 'sbg:toolDefaultValue': None id: second_part_of_string type: string? label: String 2 doc: Second part of the output name. Overrides the input file. - 'sbg:category': Name inputs id: first_part_of_string type: string? label: String 1 doc: First part of the output name. Overrides the input file. - 'sbg:stageInput': link 'sbg:category': File Inputs id: in_file type: File inputBinding: shellQuote: false position: 1 'sbg:cmdInclude': true label: Input file doc: Input file. - 'sbg:category': Name inputs id: second_part_of_string_file type: File? label: File - second part of name string doc: >- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: >- File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- The sequence dictionary, or BAM/VCF/IntervalList from which a dictionary can be extracted. 'sbg:fileTypes': DICT - id: output_filename type: string? label: Output filename doc: Output filename. - id: in_intervals type: File inputBinding: prefix: I= separate: false shellQuote: false position: 6 label: The input BED file doc: The input BED file. 'sbg:fileTypes': BED - 'sbg:category': Execution id: mem_overhead_per_job type: int? label: Memory overhead per job (in MB) doc: 'Memory overhead per job (in MB) [platform option]' - 'sbg:category': Execution id: mem_per_job type: int? label: Memory per job (in MB) doc: 'Memory per job (in MB) [platform option]' - 'sbg:category': Execution id: cpu_per_job type: int? label: Number of CPUs per job doc: 'Number of CPUs per job [platform option]' outputs: - id: out_picard_interval_list doc: The output Picard Interval List. label: Interval List type: File outputBinding: glob: '*.intervals' outputEval: '$(inheritMetadata(self, inputs.in_intervals))' 'sbg:fileTypes': intervals label: Picard BedToIntervalList arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.mem_per_job) { return '-Xmx'.concat(inputs.mem_per_job - inputs.mem_overhead_per_job, 'M') } return '-Xmx2048M' } - shellQuote: false position: 1 valueFrom: '-jar' - prefix: '' shellQuote: false position: 2 valueFrom: /opt/picard/picard.jar - shellQuote: false position: 3 valueFrom: BedToIntervalList - prefix: O= separate: false shellQuote: false position: 10 valueFrom: |- ${ if (inputs.output_filename != null) { var filename = inputs.output_filename; } else { var filename = inputs.in_intervals.nameroot; } return filename + ".intervals"; } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ if (inputs.mem_per_job) { return inputs.mem_per_job } return 2048 } coresMin: |- ${ if (inputs.cpu_per_job) { return inputs.cpu_per_job } return 1 } - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/picard-2.23.8:0' - class: InitialWorkDirRequirement listing: [] - class: InlineJavascriptRequirement expressionLib: - | var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:image_url': null 'sbg:cmdPreview': >- java -Xmx2048M -jar /opt/picard/picard.jar BedToIntervalList I=/path/to/bed_file.ext SD=/path/to/sequence_dictionary.ext 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672192 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637679602 'sbg:revisionNotes': Update image to bms repo 'sbg:toolkit': picard 'sbg:toolkitVersion': 2.23.8 'sbg:toolAuthor': Broad Institute 'sbg:license': MIT License 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-bedtointervallist-bait/1 'sbg:revision': 1 'sbg:revisionNotes': Update image to bms repo 'sbg:modifiedOn': 1637679602 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672192 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 1 'sbg:publisher': sbg 'sbg:content_hash': a00dd0d371bbdf31bc8933bc9690fc6d5b6627dd39a153cc90b3575eab914d380 label: Picard BedToIntervalList Bait 'sbg:x': 47.19419860839844 'sbg:y': -248.84375 - id: picard_bedtointervallist_target in: - id: sequence_dictionary source: sequence_dictionary - id: in_intervals source: TargetRegions out: - id: out_picard_interval_list run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/picard-bedtointervallist-bait/1 baseCommand: - java inputs: - id: sequence_dictionary type: File inputBinding: prefix: SD= separate: false shellQuote: false position: 7 label: 'The sequence dictionary, or BAM/VCF/IntervalList' doc: >- The sequence dictionary, or BAM/VCF/IntervalList from which a dictionary can be extracted. 'sbg:fileTypes': DICT - id: output_filename type: string? label: Output filename doc: Output filename. - id: in_intervals type: File inputBinding: prefix: I= separate: false shellQuote: false position: 6 label: The input BED file doc: The input BED file. 'sbg:fileTypes': BED - 'sbg:category': Execution id: mem_overhead_per_job type: int? label: Memory overhead per job (in MB) doc: 'Memory overhead per job (in MB) [platform option]' - 'sbg:category': Execution id: mem_per_job type: int? label: Memory per job (in MB) doc: 'Memory per job (in MB) [platform option]' - 'sbg:category': Execution id: cpu_per_job type: int? label: Number of CPUs per job doc: 'Number of CPUs per job [platform option]' outputs: - id: out_picard_interval_list doc: The output Picard Interval List. label: Interval List type: File outputBinding: glob: '*.intervals' outputEval: '$(inheritMetadata(self, inputs.in_intervals))' 'sbg:fileTypes': intervals label: Picard BedToIntervalList arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.mem_per_job) { return '-Xmx'.concat(inputs.mem_per_job - inputs.mem_overhead_per_job, 'M') } return '-Xmx2048M' } - shellQuote: false position: 1 valueFrom: '-jar' - prefix: '' shellQuote: false position: 2 valueFrom: /opt/picard/picard.jar - shellQuote: false position: 3 valueFrom: BedToIntervalList - prefix: O= separate: false shellQuote: false position: 10 valueFrom: |- ${ if (inputs.output_filename != null) { var filename = inputs.output_filename; } else { var filename = inputs.in_intervals.nameroot; } return filename + ".intervals"; } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ if (inputs.mem_per_job) { return inputs.mem_per_job } return 2048 } coresMin: |- ${ if (inputs.cpu_per_job) { return inputs.cpu_per_job } return 1 } - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/picard-2.23.8:0' - class: InitialWorkDirRequirement listing: [] - class: InlineJavascriptRequirement expressionLib: - | var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:image_url': null 'sbg:cmdPreview': >- java -Xmx2048M -jar /opt/picard/picard.jar BedToIntervalList I=/path/to/bed_file.ext SD=/path/to/sequence_dictionary.ext 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672192 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637679602 'sbg:revisionNotes': Update image to bms repo 'sbg:toolkit': picard 'sbg:toolkitVersion': 2.23.8 'sbg:toolAuthor': Broad Institute 'sbg:license': MIT License 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/picard-bedtointervallist-bait/1 'sbg:revision': 1 'sbg:revisionNotes': Update image to bms repo 'sbg:modifiedOn': 1637679602 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672192 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 1 'sbg:publisher': sbg 'sbg:content_hash': a00dd0d371bbdf31bc8933bc9690fc6d5b6627dd39a153cc90b3575eab914d380 label: Picard BedToIntervalList Target 'sbg:x': -0.9586456418037415 'sbg:y': 601.1773071289062 requirements: - class: SubworkflowFeatureRequirement - class: InlineJavascriptRequirement - class: StepInputExpressionRequirement 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672193 'sbg:revisionNotes': Workflow decomposed - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637676711 'sbg:revisionNotes': Updated rename apps - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682053 'sbg:revisionNotes': Updated all tools images - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637682591 'sbg:revisionNotes': Updated sex determination tool - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638380873 'sbg:revisionNotes': Updated all decomposed tools - 'sbg:revision': 5 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638381729 'sbg:revisionNotes': Updated bam2bw - 'sbg:revision': 6 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638462275 'sbg:revisionNotes': Updated MultiMetrics tool 'sbg:image_url': >- https://bms-cwltool-vayu.sbgenomics.com/ns/brood/images/sbguser/wes-alignment-wf/wes-align-basic/6.png 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/wes-align-basic/6 'sbg:revision': 6 'sbg:revisionNotes': Updated MultiMetrics tool 'sbg:modifiedOn': 1638462275 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672193 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 6 'sbg:publisher': sbg 'sbg:content_hash': aeb6eaca0a203f58a385b26c4e68874e39965c2a488b238a7eae6dc62d282a613 label: WES alignment QC 'sbg:x': 1531.34814453125 'sbg:y': 1277.5 - id: haplotypecaller_genotyping in: - id: GenomeReference source: sbg_fasta_indices/out_reference_and_index - id: inputBAM source: sentieon_markduplicates/MarkDuplicatesBAM - id: emitMode default: GVCF - id: interval source: genotypingSNPs - id: licsrvr_host_and_port source: licsrvr_host_and_port out: - id: output run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/haplotypecaller-genotyping/4 baseCommand: [] inputs: - id: GenomeReference type: File inputBinding: prefix: '-r' shellQuote: false position: 0 label: Genome reference (fasta) secondaryFiles: - pattern: .fai required: true - id: inputBAM type: File inputBinding: prefix: '-i' shellQuote: false position: 0 label: input BAM file 'sbg:fileTypes': BAM secondaryFiles: - pattern: ^.bai required: true - id: ReferenceSNP type: File? inputBinding: prefix: '-d' shellQuote: false position: 6 label: reference SNP (dbSNP) 'sbg:fileTypes': 'VCF.GZ, VCF' secondaryFiles: - pattern: .tbi required: true - id: minBaseQual type: int? inputBinding: prefix: '--min_base_qual' shellQuote: false position: 6 - id: pruneFactor type: int? inputBinding: prefix: '--prune_factor' shellQuote: false position: 6 - id: emitConfidence type: int? inputBinding: prefix: '--emit_conf' shellQuote: false position: 6 - id: callConfidence type: int? inputBinding: prefix: '--call_conf' shellQuote: false position: 6 - 'sbg:category': Algo Options 'sbg:toolDefaultValue': '1 in gvcf mode, 0 otherwise' id: phasing type: - 'null' - type: enum symbols: - Enable - Disable name: phasing inputBinding: shellQuote: false position: 6 valueFrom: |- ${ var expr = ''; if (self == '') { self = null; inputs.phasing = null }; if (inputs.phasing) { if (inputs.phasing == 'Enable') { expr = '--phasing 1'; } else { expr = '--phasing 0'; } } return expr; } label: Phasing doc: Disable/enable phasing (diploid only). - id: emitMode type: - 'null' - type: enum symbols: - VARIANT - CONFIDENT - ALL - GVCF name: emitMode inputBinding: prefix: '--emit_mode' shellQuote: false position: 6 - id: PCRIndelModel type: - 'null' - type: enum symbols: - HOSTILE - AGGRESIVE - CONSERVATIVE - NONE name: PCRIndelModel inputBinding: prefix: '--pcr_indel_model' shellQuote: false position: 6 - id: interval type: File? inputBinding: prefix: '--interval' shellQuote: false position: 0 - id: minMapQuality type: int? inputBinding: prefix: '--min_map_qual' shellQuote: false position: 6 - id: trimSoftClipped type: boolean? inputBinding: prefix: '--trim_soft_clip' shellQuote: false position: 6 - id: ploidy type: int? inputBinding: prefix: '--ploidy' shellQuote: false position: 6 - id: threads type: int? inputBinding: prefix: '-t' shellQuote: false position: 0 label: SentieonHaplotyper threads - 'sbg:category': Execution id: licsrvr_host_and_port type: string label: License server host and port doc: >- License server host and port in the format (HOST:PORT) (parentheses omitted). - 'sbg:category': Execution 'sbg:toolDefaultValue': '1' id: cpu_per_job type: int? label: CPU per job doc: >- Number of CPUs per job. Appropriate instance will be chosen based on this parameter. - 'sbg:category': Execution id: mem_per_job type: int? label: Memory per job doc: >- Memory per job in MB. Appropriate instance will be chosen based on this parameter. outputs: - id: output doc: HaplotypeCaller variants. label: HaplotypeCaller variants type: File outputBinding: glob: '*.vcf.gz' outputEval: '$(inheritMetadata(self, inputs.inputBAM))' secondaryFiles: - pattern: .tbi required: false 'sbg:fileTypes': 'VCF.GZ, VCF' doc: >- **Sentieon Haplotyper** is an algorithm designed to detect germline variants with Haplotype variant calling. It is capable of calling SNPs and indels simultaneously via local de-novo assembly of haplotypes in an active region. In other words, whenever the program encounters a region showing signs of variation, it discards the existing mapping information and completely reassembles the reads in that region. A list of **all inputs and parameters** with corresponding descriptions can be found at the bottom of the page. ### Common Use Cases * The input to the Haplotyper algorithm are BAM file and FASTA reference; its output is a VCF file. _Database dbSNP_ can be added to label found known variants. _BQSR Table_ can be given if one wants to perform recalibration on the fly. * Using _BAM Output_ option, one can output a BAM file with containing modified reads after the local reassembly done by the variant calling. This option should only be used in conjunction with a small BED file for troubleshooting purposes. ### Changes Introduced by Seven Bridges * No modifications to the original tool representation have been made. ### Common Issues and Important Notes * No common issues specific to the tool's execution on the Seven Bridges Platform have been detected. ### Performance Benchmarking In the following table you can find estimates of running time and cost. All samples are aligned against **GRCh37 human reference index**. *Cost can be significantly reduced by using **spot instances**. Visit the [Knowledge Center](https://docs.sevenbridges.com/docs/about-spot-instances) for more details.* | BAM File Size [GB] | Mean coverage |Duration (min) | Cores | Cost ($) | Instance (AWS) | |--------------------------|----------------|----------------|-------|----------|------------| | 1.29 | 6X | 1 | 16 | 0.013 | c4.4xlarge | | 7.45 | 40X | 3 | 16 | 0.039 | c4.4xlarge | | 8.36 | 46X | 3 | 16 | 0.039 | c4.4xlarge | | 181.87 | 42X | 47 | 58 | 1.80 | m5.12xlarge | | 220.17 | 50X | 53 | 53 | 2.03 | m5.12xlarge | | 252.65 | 52X | 32 | 47 | 1.76 | m5.12xlarge | ### References [1 - Sentieon manual](https://support.sentieon.com/manual/_downloads/Sentieon.pdf) label: Sentieon HaplotypeCaller arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ var command = 'export SENTIEON_LICENSE='; var command = command + inputs.licsrvr_host_and_port; return command; } - prefix: '' shellQuote: false position: 0 valueFrom: '&&' - prefix: '' shellQuote: false position: 0 valueFrom: ' $SENTIEON_PATH/bin/sentieon' - prefix: '' shellQuote: false position: 0 valueFrom: driver - prefix: '--algo' shellQuote: false position: 5 valueFrom: Haplotyper - prefix: '' shellQuote: false position: 35 valueFrom: |- ${ var ext=".vcf.gz"; if(inputs.emitMode === 'GVCF'){ ext=".g.vcf.gz" } return inputs.inputBAM.basename.replace(/.coord|.name|.mdup|.bam$/gi, '') + ext; } requirements: - class: ShellCommandRequirement - class: NetworkAccess networkAccess: true - class: ResourceRequirement ramMin: |- ${ if (inputs.mem_per_job) { return inputs.mem_per_job; } else { return 1000; } } coresMin: |- ${ if (inputs.cpu_per_job) { return inputs.cpu_per_job;} else { return 1;} } - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/sentieon20201001:0' - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) file['metadata'] = metadata; else { for (var key in metadata) { file['metadata'][key] = metadata[key]; } } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672198 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637673281 'sbg:revisionNotes': Added network access - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377470 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377594 'sbg:revisionNotes': null - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379180 'sbg:revisionNotes': Back to rev1 'sbg:image_url': null 'sbg:toolkit': Sentieon 'sbg:toolkitVersion': '20201001' 'sbg:categories': - Variant Calling 'sbg:license': Client license 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/haplotypecaller-genotyping/4 'sbg:revision': 4 'sbg:revisionNotes': Back to rev1 'sbg:modifiedOn': 1638379180 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672198 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 4 'sbg:publisher': sbg 'sbg:content_hash': a9a1ae0e1c3bac55aa0c4573445fc76dbaf82d0bf7739542a19516a9a29ed59c8 label: HaplotypeCaller (sentieon) 'sbg:x': 1481.08203125 'sbg:y': 1853.2640380859375 - id: fastqsplit_1 in: - id: inputFastq1 source: fastq_qc/CutadaptTrimmedFastq1 - id: sample_name source: sample_from_file/out_sample_id - id: inputLibrary source: sample_from_file/out_sample_id - id: inputFastq2 source: fastq_qc/CutadaptTrimmedFastq2 - id: readsinfile default: 0 - id: cpu_per_job_fastqsplit default: 32 - id: threads default: 32 out: - id: outputFastq1 - id: outputFastq2 - id: outputRGID - id: outputRGSM - id: outputRGLB - id: outputRGPL run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/fastqsplit-1/3 baseCommand: - fastqSplit inputs: - id: inputFastq1 type: File inputBinding: prefix: '--fastq1' itemSeparator: ',' shellQuote: false position: 0 label: Fastq Paired End 1 doc: Fastq file for paired end 1. 'sbg:fileTypes': 'FASTQ, FQ, FASTQ.GZ, FQ.GZ' - id: sample_name type: string inputBinding: prefix: '--sample' shellQuote: false position: 0 - id: inputLibrary type: string inputBinding: prefix: '--library' shellQuote: false position: 0 - id: inputFastq2 type: File? inputBinding: prefix: '--fastq2' shellQuote: false position: 0 label: Fastq Paired End 2 doc: Fastq file for paired end 2. 'sbg:fileTypes': 'FASTQ, FQ, FASTQ.GZ, FQ.GZ' - id: readsinfile type: int? inputBinding: prefix: '--readsinfile' shellQuote: false position: 0 doc: How many reads to include in each output file - id: inputPlatform type: string? inputBinding: prefix: '--platform' shellQuote: false position: 0 - 'sbg:category': Execution 'sbg:toolDefaultValue': '8000' id: mem_per_job_fastqsplit type: int? label: 'Memory per job (in MB) [fastqSplit]' doc: 'Memory per job (in MB) [fastqSplit]' - 'sbg:category': Execution 'sbg:toolDefaultValue': '8' id: cpu_per_job_fastqsplit type: int? label: 'CPUs per job [fastSplit]' doc: 'Number of CPUs per job [fastSplit]' - 'sbg:toolDefaultValue': '8' id: threads type: int? inputBinding: prefix: '--threads' shellQuote: false position: 1 label: Threads doc: Threads number. outputs: - id: outputFastq1 type: 'File[]' outputBinding: glob: '*_R1.fq.gz' outputEval: '$(inheritMetadata(self, inputs.inputFastq1))' - id: outputFastq2 type: 'File[]' outputBinding: glob: '*_R2.fq.gz' outputEval: '$(inheritMetadata(self, inputs.inputFastq2))' - id: outputRGID type: 'string[]' outputBinding: loadContents: true glob: summary.txt outputEval: | ${ var str = self[0].contents var file=[] var lines=str.split(/\n+/) for( var i = 1 ; i< lines.length; i ++) { if(lines[i] === '' ){continue} var fields=lines[i].split(",") file.push(fields[0]) } return( file ) } - id: outputRGSM type: 'string[]' outputBinding: loadContents: true glob: summary.txt outputEval: | ${ var str = self[0].contents var file=[] var lines=str.split(/\n+/) for( var i = 1 ; i< lines.length; i ++) { if(lines[i] === '' ){continue} var fields=lines[i].split(",") file.push(fields[1]) } return( file ) } - id: outputRGLB type: 'string[]' outputBinding: loadContents: true glob: summary.txt outputEval: | ${ var str = self[0].contents var file=[] var lines=str.split(/\n+/) for( var i = 1 ; i< lines.length; i ++) { if(lines[i] === '' ){continue} var fields=lines[i].split(",") file.push(fields[2]) } return( file ) } - id: outputRGPL type: 'string[]' outputBinding: loadContents: true glob: summary.txt outputEval: | ${ var str = self[0].contents var file=[] var lines=str.split(/\n+/) for( var i = 1 ; i< lines.length; i ++) { if(lines[i] === '' ){continue} var fields=lines[i].split(",") file.push(fields[3]) } return( file ) } doc: >- Tool to split a fastq file to smaller files according to the lane + library information they have embedded in their read names. The output is a directory with all the fastq files it has created and a file named `sumarry.txt` which has the filenames, and read group information for each. The output of the tool is a series of arrays that can be used in a scatter function for downstream analysis. In this case use the scatter `dot product` option. RG ID and RG platform Unit (aka lane) are the same in this case label: fastqSplit arguments: - prefix: '--output' shellQuote: false position: 0 valueFrom: . requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: |- ${ var mem = 8000; if (inputs.mem_per_job_fastqsplit){ mem = inputs.mem_per_job_fastqsplit; } return mem; } coresMin: |- ${ var cpus = 8; if (inputs.cpu_per_job_fastqsplit){ cpus = inputs.cpu_per_job_fastqsplit; } if (inputs.threads){ if (inputs.threads > cpus){ return inputs.threads } else{ return cpus; } } else{ return cpus;} } - class: DockerRequirement dockerPull: >- bms-images.sbgenomics.com/bristol-myers-squibb/celgene/fastqsplit:v1.3 - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) if (o1.secondaryFiles) { o1.secondaryFiles = inheritMetadata(o1.secondaryFiles, o2) } } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) if (o1[i].secondaryFiles) { o1[i].secondaryFiles = inheritMetadata(o1[i].secondaryFiles, o2) } } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672199 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377471 'sbg:revisionNotes': null - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377595 'sbg:revisionNotes': null - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379408 'sbg:revisionNotes': Updated image 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/fastqsplit-1/3 'sbg:revision': 3 'sbg:revisionNotes': Updated image 'sbg:modifiedOn': 1638379408 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672199 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 3 'sbg:publisher': sbg 'sbg:content_hash': a9f7639b32bb777a34c039a337c786c25bcf2b469dadb1f9bdcb741b734f6f346 label: fastqSplit 'sbg:x': 569.6151123046875 'sbg:y': 1622.25 - id: sentieon_markduplicates in: - id: mdup_threads default: 16 - id: input_BAM linkMerge: merge_flattened source: - bwa/output - id: licsrvr_host_and_port source: licsrvr_host_and_port out: - id: MarkDuplicatesMetrics - id: MarkDuplicatesBAM run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/sentieon-markduplicates/4 baseCommand: [] inputs: - id: mdup_threads type: int? inputBinding: prefix: '-t' shellQuote: false position: 1 - id: input_BAM type: 'File[]' inputBinding: itemSeparator: ' -i ' shellQuote: false position: 3 valueFrom: |- ${ var prefix = '-i' var files = [].concat(self); var output = []; for (var i=0; i- License server host and port in the format (HOST:PORT) (parentheses omitted). outputs: - id: MarkDuplicatesMetrics type: File outputBinding: glob: '*.qcstats' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: MarkDuplicatesBAM type: File outputBinding: glob: '*mdup.bam' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' secondaryFiles: - pattern: ^.bai required: false doc: >- **Sentieon Dedup** is an algorithm designed for deduplication of reads. This processing step is performed per-sample and consists of identifying read pairs that are likely to have originated from duplicates of the same original DNA fragments through some artifactual processes. These are considered to be non-independent observations, so the program tags all but of the read pairs within each set of duplicates, causing them to be ignored by default during the variant discovery process. [1] A list of **all inputs and parameters** with corresponding descriptions can be found at the bottom of the page. ### Common Use Cases This tool can be used either to mark duplicates (by default) or remove them with **Remove duplicates** (`--rmdup`) option. Two individual commands are run to remove duplicates on the BAM file after alignment and sorting. The first command collects read information, and the second command performs the deduplication. ### Changes Introduced by Seven Bridges * No modifications to the original tool representation have been made. ### Common Issues and Important Notes * No common issues specific to the tool's execution on the Seven Bridges Platform have been detected. ### Performance Benchmarking In the following table you can find estimates of running time and cost. All samples are aligned against **GRCh37 human reference index**. *Cost can be significantly reduced by using **spot instances**. Visit the [Knowledge Center](https://docs.sevenbridges.com/docs/about-spot-instances) for more details.* | BAM File Size [GB] | Mean coverage |Duration (min) | Cores | Cost ($) | Instance (AWS) | |--------------------------|----------------|----------------|-------|----------|------------| | 0.62 | 6X | 1 | 16 | 0.013 | c4.4xlarge | | 5.14 | 40X | 2 | 16 | 0.029 | c4.4xlarge | | 5.89 | 46X | 2.5 | 16 | 0.033 | c4.4xlarge | | 99.08 | 42X | 18 | 48 | 0.69 | m5.12xlarge | | 117.25 | 50X | 20 | 48 | 0.76 | m5.12xlarge | | 152.91 | 52X | 32 | 48 | 1.23 | m5.12xlarge | ### References [1 - Sentieon manual](https://support.sentieon.com/manual/_downloads/Sentieon.pdf) label: Sentieon Markduplicates arguments: - prefix: '--algo' shellQuote: false position: 4 valueFrom: LocusCollector - prefix: '' shellQuote: false position: 20 valueFrom: '&& $SENTIEON_PATH/bin/sentieon driver' - prefix: '--metrics' shellQuote: false position: 26 valueFrom: |- ${ var output_name = [].concat(inputs.input_BAM)[0].basename; if (inputs.output_name){ output_name = inputs.output_name; } return output_name + ".qcstats" } - prefix: '--fun score_info' shellQuote: false position: 5 valueFrom: SCORE_TXT - prefix: '--score_info' shellQuote: false position: 28 valueFrom: SCORE_TXT - prefix: '' shellQuote: false position: 21 valueFrom: |- ${ var prefix = '-i' var files = [].concat(inputs.input_BAM); var output = []; for (var i=0; i- License server host and port in the format (HOST:PORT) (parentheses omitted). outputs: - id: MarkDuplicatesMetrics type: File outputBinding: glob: '*.qcstats' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' - id: MarkDuplicatesBAM type: File outputBinding: glob: '*mdup.bam' outputEval: '$(inheritMetadata(self, inputs.input_BAM))' secondaryFiles: - pattern: ^.bai required: false doc: >- **Sentieon Dedup** is an algorithm designed for deduplication of reads. This processing step is performed per-sample and consists of identifying read pairs that are likely to have originated from duplicates of the same original DNA fragments through some artifactual processes. These are considered to be non-independent observations, so the program tags all but of the read pairs within each set of duplicates, causing them to be ignored by default during the variant discovery process. [1] A list of **all inputs and parameters** with corresponding descriptions can be found at the bottom of the page. ### Common Use Cases This tool can be used either to mark duplicates (by default) or remove them with **Remove duplicates** (`--rmdup`) option. Two individual commands are run to remove duplicates on the BAM file after alignment and sorting. The first command collects read information, and the second command performs the deduplication. ### Changes Introduced by Seven Bridges * No modifications to the original tool representation have been made. ### Common Issues and Important Notes * No common issues specific to the tool's execution on the Seven Bridges Platform have been detected. ### Performance Benchmarking In the following table you can find estimates of running time and cost. All samples are aligned against **GRCh37 human reference index**. *Cost can be significantly reduced by using **spot instances**. Visit the [Knowledge Center](https://docs.sevenbridges.com/docs/about-spot-instances) for more details.* | BAM File Size [GB] | Mean coverage |Duration (min) | Cores | Cost ($) | Instance (AWS) | |--------------------------|----------------|----------------|-------|----------|------------| | 0.62 | 6X | 1 | 16 | 0.013 | c4.4xlarge | | 5.14 | 40X | 2 | 16 | 0.029 | c4.4xlarge | | 5.89 | 46X | 2.5 | 16 | 0.033 | c4.4xlarge | | 99.08 | 42X | 18 | 48 | 0.69 | m5.12xlarge | | 117.25 | 50X | 20 | 48 | 0.76 | m5.12xlarge | | 152.91 | 52X | 32 | 48 | 1.23 | m5.12xlarge | ### References [1 - Sentieon manual](https://support.sentieon.com/manual/_downloads/Sentieon.pdf) label: Sentieon Markduplicates arguments: - prefix: '--algo' shellQuote: false position: 4 valueFrom: LocusCollector - prefix: '' shellQuote: false position: 20 valueFrom: '&& $SENTIEON_PATH/bin/sentieon driver' - prefix: '--metrics' shellQuote: false position: 26 valueFrom: |- ${ var output_name = [].concat(inputs.input_BAM)[0].basename; if (inputs.output_name){ output_name = inputs.output_name; } return output_name + ".qcstats" } - prefix: '--fun score_info' shellQuote: false position: 5 valueFrom: SCORE_TXT - prefix: '--score_info' shellQuote: false position: 28 valueFrom: SCORE_TXT - prefix: '' shellQuote: false position: 21 valueFrom: |- ${ var prefix = '-i' var files = [].concat(inputs.input_BAM); var output = []; for (var i=0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i- Tool allows creating FASTA dictionary and index simultaneously which is necessary for running GATK tools. This version of tool for indexing uses SAMtools faidx command (toolkit version0.1.19), while for the FASTA dictionary is used Picard CreateFastaDictionary (toolkit version 1.140) label: SBG FASTA Indices arguments: - prefix: '&&' shellQuote: false position: 1 valueFrom: |- ${ var memory = 2048; var overhead = 200; if (inputs.mem_overhead_per_job){ overhead = inputs.mem_overhead_per_job; } if (inputs.mem_per_job) { memory = inputs.mem_per_job; } var filename = inputs.in_reference.basename; var basename = filename.split('.'); if (filename.endsWith('.gz')) { basename.pop(); } basename.pop(); var name = basename.join('.'); return 'java -Xmx' + (memory - overhead).toString() + 'M -jar /opt/picard/picard.jar CreateSequenceDictionary -R ' + inputs.in_reference.path + ' -O ' + name + '.dict'; } requirements: - class: ShellCommandRequirement - class: NetworkAccess networkAccess: true - class: ResourceRequirement ramMin: |- ${ if (inputs.mem_per_job) { return inputs.mem_per_job; } else { return 2048; } } coresMin: 1 - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/picard-2.26.5:0' - class: InitialWorkDirRequirement listing: - $(inputs.in_reference) - class: InlineJavascriptRequirement expressionLib: - | var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:categories': - Indexing 'sbg:image_url': null 'sbg:cmdPreview': >- samtools faidx /path/to/reference.fa.gz && java -Xmx10M -jar /opt/picard.jar CreateSequenceDictionary R=/path/to/reference.fa.gz O=reference.dict 'sbg:license': Apache License 2.0 'sbg:toolkit': SBGTools 'sbg:toolAuthor': >- Sanja Mijalkovic, Seven Bridges Genomics, 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672204 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637675630 'sbg:revisionNotes': Updated docker image - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637754292 'sbg:revisionNotes': Updated command for picard - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637761299 'sbg:revisionNotes': Added network access to true on this tool - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637765368 'sbg:revisionNotes': Output fasta glob divided into separate globs - 'sbg:revision': 5 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637774138 'sbg:revisionNotes': Updated secondary files to be non required - 'sbg:revision': 6 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377504 'sbg:revisionNotes': null - 'sbg:revision': 7 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377624 'sbg:revisionNotes': null - 'sbg:revision': 8 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638378408 'sbg:revisionNotes': Back to rev 5 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/sbg-fasta-indices/8 'sbg:revision': 8 'sbg:revisionNotes': Back to rev 5 'sbg:modifiedOn': 1638378408 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672204 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 8 'sbg:publisher': sbg 'sbg:content_hash': ac9b6320bf11f57e1709a309609e8a2f973289a45372f068b10a434b2478f6a2c label: SBG FASTA Indices 'sbg:x': 855.6577758789062 'sbg:y': 1066.4007568359375 - id: sbg_compressor_cwl1_0 in: - id: input_files source: - wes_align_basic/TargetWESMetrics - wes_align_basic/SexDetermMetrics - wes_align_basic/QualityYieldMetrics - wes_align_basic/QualityDistributionPDF - wes_align_basic/QualityDistributionMetrics - wes_align_basic/QualityCyclePDF - wes_align_basic/QualityCycleMetrics - wes_align_basic/PreAdapterSummaryMetrics - wes_align_basic/PreAdapterDetailMetrics - wes_align_basic/OxogMetrics - wes_align_basic/InsertSizeMetrics - wes_align_basic/InsertSizeChart - wes_align_basic/HsMetrics - wes_align_basic/HsCOSMICMetrics - wes_align_basic/HsCCDSMetrics - wes_align_basic/GCBiasSummaryMetrics - wes_align_basic/GCBiasPDF - wes_align_basic/GCBiasDetailMetrics - wes_align_basic/ErrorSummaryMetrics - wes_align_basic/COSMICWESMetrics - wes_align_basic/CollectAlnMetrics - wes_align_basic/CCDSWESMetrics - wes_align_basic/BaseDistributionCyclePDF - wes_align_basic/BaseDistributionCycleMetrics - wes_align_basic/BamIndexMetrics - wes_align_basic/BaitBiasDetailMetrics - wes_align_basic/BaitBiasSummaryMetrics - wes_align_basic/AlignmentSummaryMetrics - bms_rename_app_duplicate_metrics/out_file - id: output_format default: ZIP out: - id: output_archives run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/sbg-compressor-cwl1-0/8 baseCommand: - python3.9 - sbg_compressor.py inputs: - id: input_files type: 'File[]?' label: Input files doc: The input files to be archived. - 'sbg:altPrefix': '-f' id: output_format type: type: enum symbols: - TAR - TAR.GZ - TAR.BZ2 - ZIP - GZ - BZ2 name: output_format inputBinding: prefix: '--output_format' shellQuote: false position: 0 label: Output format doc: |- Format of the output archive. GZ and BZ2 not applicable to folders. - 'sbg:altPrefix': '-o' id: output_name type: string? label: Output name doc: >- Base name of the output archive. This parameter is not applicable for the GZ and BZ2 file formats. - 'sbg:altPrefix': '-p' id: process type: int? inputBinding: prefix: '--process' shellQuote: false position: 0 label: Number of processes doc: >- A number of processes used for parallel compression. Only valid for GZ and BZ2 (also TAR.GZ, TAR.BZ2) types of compression. outputs: - id: output_archives doc: Newly created archives from the input files. label: Output archives type: File outputBinding: glob: |- ${ var format = inputs.output_format.toLowerCase() return "*." + format } outputEval: |+ ${ function flatten(files){ var a = [] for(var i=0;i 0) { if (!input_files[0].metadata) { return input_files[0].nameroot } else if (!input_files[0].metadata['sample_id']) { return input_files[0].nameroot } else { var flag = 'True' var sample_id = input_files[0].metadata['sample_id'] // check if sample_id is the same for all files for (var i = 0; i < input_files.length; i++) { if ((input_files[i].metadata) && (input_files[i].metadata['sample_id']) && (input_files[i].metadata['sample_id'] !== sample_id)) { flag = 'False' // detected file with different sample_id } } if (flag == 'True') { // sample_id is the same for all input files var filebase = input_files[0].metadata['sample_id'] } else { var filebase = "output_archives" } return filebase } // end else sample_id exists } // else if (input_files.length) else { throw 'Input files or folder must be defined!' } } // end if (!inputs.output_name) else { return inputs.output_name } } requirements: - class: ShellCommandRequirement - class: LoadListingRequirement - class: ResourceRequirement ramMin: 1000 coresMin: 1 - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/python3.9.0:0' - class: InitialWorkDirRequirement listing: - entryname: sbg_compressor.py entry: "#!/usr/bin/python\n\"\"\"\nUsage:\n\tsbg_compressor.py --output_format STR [options]\n\nDescription:\n\tSBG Compressor performs the archiving(and/or compression) of the files provided on the input. The format of the output can be selected.\n\tSupported formats are:\n\t\t1. TAR\n\t\t2. TAR.GZ\n\t\t3. TAR.BZ2\n\t\t4. GZ\n\t\t5. BZ2\n\t\t6. ZIP\n\tFor formats TAR, TAR.GZ, TAR.BAZ2 and ZIP, single archive will be created on the output. For formats GZ and BZ2, one archive per file will be created.\n The tool takes all hard links files from current working dir and compresses them.\n\nOptions:\n\t-h, --help\t\t\t\t\t Show this screen.\n -v, --version \t Show version.\n -f, --output_format STR Format of the output archive.\n -o, --output_name STR \tBase name of the output archive. [Default: output_archive]\n -p, --process INT A number of processes used for parallel compression. Only valid for GZ and BZ2 (also TAR.GZ, TAR.BZ2) types of compression.\n\n\"\"\"\n\nimport sys\nfrom docopt import docopt\nimport os\nimport shlex\n\ndef main(argv):\n args = docopt(__doc__, version='v1.0')\n output_format = args[\"--output_format\"]\n output_name = args[\"--output_name\"]\n procs = args[\"--process\"]\n\n suffix = \".\" + output_format.lower()\n i = 0\n new_output_name = output_name\n while os.path.isfile(new_output_name + suffix):\n i += 1\n new_output_name = output_name + '_' + str(i)\n output_name = new_output_name + suffix\n\n find = ' find . -type f ! -name sbg_compressor.py ! -name job.json ! -name job.err.log ! -name cmd.log; find ./ -type d -mindepth 1 ! -name sbg_compressor.py ! -name job.json ! -name job.err.log ! -name cmd.log; '\n\n if procs and procs.isdigit():\n pigz_p_arg = ' -p ' + procs\n pbzip2_p_arg = ' -p' + procs\n else:\n pigz_p_arg = ''\n pbzip2_p_arg = ''\n\n if output_format == \"TAR\":\n command = 'tar cvf ' + os.path.normpath(shlex.quote(output_name)) + ' $(\"$\")(' + find + ')'\n elif output_format == \"TAR.GZ\":\n command = 'tar cf - $(\"$\")(' + find + ') | pigz' + pigz_p_arg + ' > ' + os.path.normpath(shlex.quote(output_name))\n elif output_format == \"TAR.BZ2\":\n command = 'tar cf - $(\"$\")(' + find + ') | pbzip2' + pbzip2_p_arg + ' > ' + os.path.normpath(shlex.quote(output_name))\n elif output_format == \"ZIP\":\n command = 'zip -r ' + os.path.normpath(shlex.quote(output_name)) + ' $(\"$\")(' + find + ')'\n elif output_format == \"GZ\":\n command = 'pigz -k' + pigz_p_arg + ' -f ' + ' $(\"$\")(' + find + ')'\n elif output_format == \"BZ2\":\n command = 'pbzip2 -k -z' + pbzip2_p_arg + ' -f ' + ' $(\"$\")(' + find + ')'\n else:\n print (\"Format not supported\")\n sys.exit()\n\n print (command)\n os.system(command)\n\n\nif __name__ == \"__main__\":\n main(sys.argv[1:])" writable: false - entry: $(inputs.input_files) writable: false - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) } } return o1; }; 'sbg:toolkitVersion': v1.0 'sbg:toolAuthor': 'Marko Petkovic, Seven Bridges Genomics' 'sbg:cmdPreview': >- python3.7 sbg_compressor.py --output_format TAR --process 1 -o output_name-string-value 'sbg:homepage': 'https://igor.sbgenomics.com/' 'sbg:categories': - Other 'sbg:license': Apache License 2.0 'sbg:image_url': null 'sbg:toolkit': SBGTools 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672205 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637675126 'sbg:revisionNotes': Updated docker to bms repo - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637687486 'sbg:revisionNotes': Output is now single file instead of array - 'sbg:revision': 3 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638190423 'sbg:revisionNotes': '' - 'sbg:revision': 4 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638198914 'sbg:revisionNotes': Removed symlinks from the compression script - 'sbg:revision': 5 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638199187 'sbg:revisionNotes': python script excluded from compression - 'sbg:revision': 6 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638199813 'sbg:revisionNotes': Excluded logs from compression - 'sbg:revision': 7 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638377506 'sbg:revisionNotes': null - 'sbg:revision': 8 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1638379807 'sbg:revisionNotes': Back to rev6 'sbg:expand_workflow': false 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/sbg-compressor-cwl1-0/8 'sbg:revision': 8 'sbg:revisionNotes': Back to rev6 'sbg:modifiedOn': 1638379807 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672205 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 8 'sbg:publisher': sbg 'sbg:content_hash': adfd7ff1e07a635163c457c7da7035b0ac12dbc06c333a293b662188c4de5ab3f label: SBG Compressor CWL1.0 'sbg:x': 2671 'sbg:y': 865.239501953125 - id: bms_rename_app in: - id: suffix_string default: _all_metrics.zip - id: first_part_of_string source: sample_from_file/out_sample_id - id: in_file source: sbg_compressor_cwl1_0/output_archives out: - id: out_file run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/bms-rename-app/4 baseCommand: [] inputs: - 'sbg:category': Name inputs id: suffix_string type: string? label: Suffix String doc: Tool string in desired format with extension. - 'sbg:category': Name inputs 'sbg:toolDefaultValue': None id: second_part_of_string type: string? label: String 2 doc: Second part of the output name. Overrides the input file. - 'sbg:category': Name inputs id: first_part_of_string type: string? label: String 1 doc: First part of the output name. Overrides the input file. - 'sbg:stageInput': link 'sbg:category': File Inputs id: in_file type: File inputBinding: shellQuote: false position: 1 'sbg:cmdInclude': true label: Input file doc: Input file. - 'sbg:category': Name inputs id: second_part_of_string_file type: File? label: File - second part of name string doc: >- File whose name shall be used for the second part of the output name. - 'sbg:category': Name inputs id: first_part_of_string_file type: File? label: File - first part of name string doc: File whose name shall be used for the first part of the output name. outputs: - id: out_file doc: Renamed output file. label: Output file type: File outputBinding: glob: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } outputEval: '$(inheritMetadata(self, inputs.in_file))' secondaryFiles: - pattern: .bai required: false - pattern: ^.bai required: false - pattern: .fai required: false - pattern: ^.fai required: false - pattern: .dict required: false - pattern: ^.dict required: false - pattern: .idx required: false - pattern: ^.idx required: false - pattern: .tbi required: false - pattern: ^.tbi required: false - pattern: .csi required: false - pattern: ^.csi required: false label: BMS Rename App arguments: - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.in_file) { return 'cp'; } else { return 'echo NO input given, skipping... #'; } } - prefix: '' shellQuote: false position: 10 valueFrom: |- ${ if (inputs.first_part_of_string) { var first = inputs.first_part_of_string; } else { if (inputs.first_part_of_string_file){ var first_input_file = [].concat(inputs.first_part_of_string_file)[0]; } else { var first_input_file = [].concat(inputs.in_file)[0]; } if (first_input_file.metadata){ if (first_input_file.metadata['sample_id']){ var first = first_input_file.metadata['sample_id']; } else { var first = first_input_file.nameroot.split('.')[0]; } } else { var first = first_input_file.nameroot.split('.')[0]; } } var junct = '-'; if (inputs.second_part_of_string) { var second = inputs.second_part_of_string; } else if (inputs.second_part_of_string_file){ var second_input_file = [].concat(inputs.second_part_of_string_file)[0]; if (second_input_file.metadata){ if (second_input_file.metadata['sample_id']){ var second = second_input_file.metadata['sample_id']; } else { var second = second_input_file.nameroot.split('.')[0]; } } else { var second = second_input_file.nameroot.split('.')[0]; } } else { junct = ''; var second = ''; } if (inputs.suffix_string) { var last = inputs.suffix_string; } else { var last = ''; } return first + junct + second + last; } - prefix: '' shellQuote: false position: 20 valueFrom: |- ${ if (!inputs.in_file.hasOwnProperty('secondaryFiles')){ return "|| : # No secondary files found"; } if (!inputs.in_file.secondaryFiles){ return "|| : # No secondary files found"; } var secondary_files = []; for (var i = 0; i b.basename){ return 1; } else { return 0 } }); } out: - id: output run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/merge-fastq-r2/2 baseCommand: [] inputs: - id: outputName type: string? label: Output filename doc: >- This is the filename that will be used as output. Do not include the fastq and compressed extension to that e.g. SAMPLE_R1 and will produce a file SAMPLE_R1.fq.gz - id: inputFastq type: 'File[]' inputBinding: shellQuote: false position: 2 valueFrom: |- ${ var files = inputs.inputFastq var file_list = "" for (var i = 0; i 1){ return "*fq.gz" } else { return inputs.inputFastq[0].basename } } outputEval: '$(inheritMetadata(self, inputs.inputFastq))' doc: >- Tool to merge compressed fastq files to one This tool does not handle pairs of files, just a set of fastq files that are concatenated in the order they are provided label: merge_fastq arguments: - prefix: '' shellQuote: false position: 10 valueFrom: '| pigz ' - prefix: '-p' shellQuote: false position: 11 valueFrom: '8' - prefix: '-' shellQuote: false position: 18 valueFrom: ' ' - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.inputFastq.length === 1){ return "echo One file - Skip merging..." } } - prefix: '' shellQuote: false position: 1 valueFrom: zcat - prefix: '' shellQuote: false position: 25 valueFrom: |- ${ if (inputs.fastq_type){ var fastq_type = "_" + inputs.fastq_type } else { var fastq_type = '' } function removeNull(array){ var o = []; for (var i = 0; i 1){ files.sort(function(file1, file2) { var file1_name = file1.basename.toUpperCase(); var file2_name = file2.basename.toUpperCase(); if (file1_name < file2_name) { return -1; } if (file1_name > file2_name) { return 1; } // names must be equal return 0; }); } var in_stats_first = files[0]; if (in_stats_first.metadata && in_stats_first.metadata['sample_id']){ output = in_stats_first.metadata['sample_id'] + fastq_type; } else { output = in_stats_first.basename.split('.')[0]; } } return "> " + output + ".fq.gz"; } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: 16000 coresMin: 8 - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/python3.9.0:0' - class: InitialWorkDirRequirement listing: - $(inputs.inputFastq) - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) if (o1.secondaryFiles) { o1.secondaryFiles = inheritMetadata(o1.secondaryFiles, o2) } } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) if (o1[i].secondaryFiles) { o1[i].secondaryFiles = inheritMetadata(o1[i].secondaryFiles, o2) } } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672207 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637673639 'sbg:revisionNotes': Updated image to bms-images - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637752382 'sbg:revisionNotes': Updated docker image 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/merge-fastq-r2/2 'sbg:revision': 2 'sbg:revisionNotes': Updated docker image 'sbg:modifiedOn': 1637752382 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672207 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 2 'sbg:publisher': sbg 'sbg:content_hash': a3ee77d315b0fa847d05791cba223d41f8199bbf09b1b8b67f958e1d942e50a5e label: merge_fastq_r2 'sbg:x': -75.56785583496094 'sbg:y': 1326.4105224609375 - id: merge_fastq_1 in: - id: inputFastq source: - inputFastq1 valueFrom: |- ${ return self.sort(function(a, b) { if (a.basename < b.basename){ return -1; } else if (a.basename > b.basename){ return 1; } else { return 0 } }); } out: - id: output run: class: CommandLineTool cwlVersion: v1.2 $namespaces: sbg: 'https://sevenbridges.com' id: sbguser/wes-alignment-wf/merge-fastq-r2/2 baseCommand: [] inputs: - id: outputName type: string? label: Output filename doc: >- This is the filename that will be used as output. Do not include the fastq and compressed extension to that e.g. SAMPLE_R1 and will produce a file SAMPLE_R1.fq.gz - id: inputFastq type: 'File[]' inputBinding: shellQuote: false position: 2 valueFrom: |- ${ var files = inputs.inputFastq var file_list = "" for (var i = 0; i 1){ return "*fq.gz" } else { return inputs.inputFastq[0].basename } } outputEval: '$(inheritMetadata(self, inputs.inputFastq))' doc: >- Tool to merge compressed fastq files to one This tool does not handle pairs of files, just a set of fastq files that are concatenated in the order they are provided label: merge_fastq arguments: - prefix: '' shellQuote: false position: 10 valueFrom: '| pigz ' - prefix: '-p' shellQuote: false position: 11 valueFrom: '8' - prefix: '-' shellQuote: false position: 18 valueFrom: ' ' - prefix: '' shellQuote: false position: 0 valueFrom: |- ${ if (inputs.inputFastq.length === 1){ return "echo One file - Skip merging..." } } - prefix: '' shellQuote: false position: 1 valueFrom: zcat - prefix: '' shellQuote: false position: 25 valueFrom: |- ${ if (inputs.fastq_type){ var fastq_type = "_" + inputs.fastq_type } else { var fastq_type = '' } function removeNull(array){ var o = []; for (var i = 0; i 1){ files.sort(function(file1, file2) { var file1_name = file1.basename.toUpperCase(); var file2_name = file2.basename.toUpperCase(); if (file1_name < file2_name) { return -1; } if (file1_name > file2_name) { return 1; } // names must be equal return 0; }); } var in_stats_first = files[0]; if (in_stats_first.metadata && in_stats_first.metadata['sample_id']){ output = in_stats_first.metadata['sample_id'] + fastq_type; } else { output = in_stats_first.basename.split('.')[0]; } } return "> " + output + ".fq.gz"; } requirements: - class: ShellCommandRequirement - class: ResourceRequirement ramMin: 16000 coresMin: 8 - class: DockerRequirement dockerPull: 'bms-images.sbgenomics.com/bristol-myers-squibb/python3.9.0:0' - class: InitialWorkDirRequirement listing: - $(inputs.inputFastq) - class: InlineJavascriptRequirement expressionLib: - |- var setMetadata = function(file, metadata) { if (!('metadata' in file)) { file['metadata'] = {} } for (var key in metadata) { file['metadata'][key] = metadata[key]; } return file }; var inheritMetadata = function(o1, o2) { var commonMetadata = {}; if (!o2) { return o1; }; if (!Array.isArray(o2)) { o2 = [o2] } for (var i = 0; i < o2.length; i++) { var example = o2[i]['metadata']; for (var key in example) { if (i == 0) commonMetadata[key] = example[key]; else { if (!(commonMetadata[key] == example[key])) { delete commonMetadata[key] } } } for (var key in commonMetadata) { if (!(key in example)) { delete commonMetadata[key] } } } if (!Array.isArray(o1)) { o1 = setMetadata(o1, commonMetadata) if (o1.secondaryFiles) { o1.secondaryFiles = inheritMetadata(o1.secondaryFiles, o2) } } else { for (var i = 0; i < o1.length; i++) { o1[i] = setMetadata(o1[i], commonMetadata) if (o1[i].secondaryFiles) { o1[i].secondaryFiles = inheritMetadata(o1[i].secondaryFiles, o2) } } } return o1; }; 'sbg:projectName': WES Alignment wf 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637672207 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637673639 'sbg:revisionNotes': Updated image to bms-images - 'sbg:revision': 2 'sbg:modifiedBy': sbguser 'sbg:modifiedOn': 1637752382 'sbg:revisionNotes': Updated docker image 'sbg:image_url': null 'sbg:appVersion': - v1.2 'sbg:id': sbguser/wes-alignment-wf/merge-fastq-r2/2 'sbg:revision': 2 'sbg:revisionNotes': Updated docker image 'sbg:modifiedOn': 1637752382 'sbg:modifiedBy': sbguser 'sbg:createdOn': 1637672207 'sbg:createdBy': sbguser 'sbg:project': sbguser/wes-alignment-wf 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - sbguser 'sbg:latestRevision': 2 'sbg:publisher': sbg 'sbg:content_hash': a3ee77d315b0fa847d05791cba223d41f8199bbf09b1b8b67f958e1d942e50a5e label: merge_fastq 'sbg:x': -70.29039001464844 'sbg:y': 1615.6591796875 hints: - class: 'sbg:AWSInstanceType' value: c4.8xlarge;ebs-gp2;1024 - class: 'sbg:maxNumberOfParallelInstances' value: '2' requirements: - class: LoadListingRequirement - class: NetworkAccess networkAccess: true - class: SubworkflowFeatureRequirement - class: ScatterFeatureRequirement - class: MultipleInputFeatureRequirement - class: InlineJavascriptRequirement - class: StepInputExpressionRequirement 'sbg:toolAuthor': Konstantinos Mavrommatis 'sbg:projectName': Integrated WES-WGS Production Ready Pipelines 'sbg:revisionsInfo': - 'sbg:revision': 0 'sbg:modifiedBy': bristol-myers-squibb/luka.topalovic 'sbg:modifiedOn': 1622761300 'sbg:revisionNotes': null - 'sbg:revision': 1 'sbg:modifiedBy': bristol-myers-squibb/luka.topalovic 'sbg:modifiedOn': 1622761300 'sbg:revisionNotes': Initial - 'sbg:revision': 2 'sbg:modifiedBy': bristol-myers-squibb/luka.topalovic 'sbg:modifiedOn': 1622761352 'sbg:revisionNotes': Initial - 'sbg:revision': 3 'sbg:modifiedBy': bristol-myers-squibb/luka.topalovic 'sbg:modifiedOn': 1623156099 'sbg:revisionNotes': Updated WES QC - 'sbg:revision': 4 'sbg:modifiedBy': bristol-myers-squibb/luka_test_account 'sbg:modifiedOn': 1627572748 'sbg:revisionNotes': Added merging all metrics - 'sbg:revision': 5 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1628067017 'sbg:revisionNotes': Now takes tar instead of Directory - 'sbg:revision': 6 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1628067696 'sbg:revisionNotes': updated BWAReference input - 'sbg:revision': 7 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1628179139 'sbg:revisionNotes': Updated recalibration - 'sbg:revision': 8 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1632488828 'sbg:revisionNotes': Added merge dedup - 'sbg:revision': 9 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1633693782 'sbg:revisionNotes': Updated tools - 'sbg:revision': 10 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1634632903 'sbg:revisionNotes': Updated RenameApp - 'sbg:revision': 11 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1634824022 'sbg:revisionNotes': removed gVCF from ZIP - 'sbg:revision': 12 'sbg:modifiedBy': bristol-myers-squibb/pavle.marinkovic 'sbg:modifiedOn': 1637242962 'sbg:revisionNotes': Now handles multilanne fqs - 'sbg:revision': 13 'sbg:modifiedBy': bristol-myers-squibb/luka_test_account 'sbg:modifiedOn': 1640355380 'sbg:revisionNotes': cwltool validated 'sbg:image_url': >- https://bms.sbgenomics.com/ns/brood/images/bristol-myers-squibb/integrated-wes-wgs-production-ready-pipelines/wes-alignment-translational/13.png 'sbg:appVersion': - v1.2 'sbg:id': >- bristol-myers-squibb/integrated-wes-wgs-production-ready-pipelines/wes-alignment-translational/13 'sbg:revision': 13 'sbg:revisionNotes': cwltool validated 'sbg:modifiedOn': 1640355380 'sbg:modifiedBy': bristol-myers-squibb/luka_test_account 'sbg:createdOn': 1622761300 'sbg:createdBy': bristol-myers-squibb/luka.topalovic 'sbg:project': bristol-myers-squibb/integrated-wes-wgs-production-ready-pipelines 'sbg:sbgMaintained': false 'sbg:validationErrors': [] 'sbg:contributors': - bristol-myers-squibb/pavle.marinkovic - bristol-myers-squibb/luka_test_account - bristol-myers-squibb/luka.topalovic 'sbg:latestRevision': 13 'sbg:publisher': sbg 'sbg:content_hash': afb98536d1c4989b8e39889068a5a6444c98922211f78844cc54265fb9e744750