@prefix LoadListingRequirement: <http://commonwl.org/cwltool#LoadListingRequirement/> .
@prefix CommandLineBinding: <https://w3id.org/cwl/cwl#CommandLineBinding/> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix DockerRequirement: <https://w3id.org/cwl/cwl#DockerRequirement/> .
@prefix Workflow: <https://w3id.org/cwl/cwl#Workflow/> .
@prefix sld:   <https://w3id.org/cwl/salad#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix CommandOutputBinding: <https://w3id.org/cwl/cwl#CommandOutputBinding/> .
@prefix ns2:   <https://> .
@prefix ns1:   <http://commonwl.org/cwltool#> .
@prefix NetworkAccess: <http://commonwl.org/cwltool#NetworkAccess/> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix cwl:   <https://w3id.org/cwl/cwl#> .
@prefix ResourceRequirement: <https://w3id.org/cwl/cwl#ResourceRequirement/> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba>
        cwl:in   <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/col_num> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/genome_tar> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/genome_untar_path> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/input_fusion_file> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/output_basename> ;
        cwl:out  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/annotated_tsv> ;
        cwl:run  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annofuse_filtered_fusions_tsv>
        rdfs:comment      "Filtered output of formatted and annotated Star Fusion and arriba results" ;
        cwl:outputSource  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/filtered_fusions_tsv> ;
        sld:type          cwl:File , sld:null .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/rsem_expr_file>
        rdfs:comment  "gzipped rsem gene expression file" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/FusionGenome/GRCh38_v39_fusion_annot_custom.tar.gz>
        a         cwl:File ;
        cwl:path  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/63cff818facdd82011c8d6fe> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/rsem_expr_file>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/rsem_expr_file> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/sample_name>
        rdfs:comment  "Sample name to apply. Ought to be one from some kind of clinical database" ;
        sld:type      xsd:string .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf>
        a                        cwl:Workflow ;
        ns1:original_cwlVersion  "v1.0" ;
        Workflow:steps           <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output> ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/v1.2> ;
        cwl:hints                [ a             ns2:sevenbridges.comAWSInstanceType ;
                                   rdfs:comment  "Chosen for speed and lower cost"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/FusionGenome> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/col_num> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/arriba_output_file> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/rsem_expr_file> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/sample_name> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/star_fusion_output_file> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/output_basename> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/genome_untar_path> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annofuse_filtered_fusions_tsv> ;
        cwl:requirements         [ a  cwl:MultipleInputFeatureRequirement ] .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/genome_untar_path>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/genome_untar_path> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/output_basename>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/output_basename> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl#format_arriba_fusion_file/formatted_fusion_tsv>
        cwl:outputBinding  [ CommandOutputBinding:glob
                          "*.tsv" ] ;
        sld:type           cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator>
        a                        cwl:CommandLineTool ;
        ns1:original_cwlVersion  "v1.0" ;
        cwl:arguments            ( [ CommandLineBinding:position    1 ;
                                     CommandLineBinding:shellQuote  false ;
                                     cwl:valueFrom                  "-I pigz -xf $(inputs.genome_tar.path) && /opt/FusionAnnotator/FusionAnnotator --genome_lib_dir ./$(inputs.genome_untar_path) --annotate $(inputs.input_fusion_file.path) --fusion_name_col $(inputs.col_num) > $(inputs.output_basename).annotated.tsv"
                                   ]
                                 ) ;
        cwl:baseCommand          ( "tar" ) ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/v1.2> ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/output_basename> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/col_num> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/genome_tar> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/genome_untar_path> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/input_fusion_file> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/annotated_tsv> ;
        cwl:requirements         [ a  cwl:InlineJavascriptRequirement ] ;
        cwl:requirements         [ a                             cwl:DockerRequirement ;
                                   DockerRequirement:dockerPull  "pgc-images.sbgenomics.com/d3b-bixu/fusionannotator:0.1.1"
                                 ] ;
        cwl:requirements         [ a                             cwl:ResourceRequirement ;
                                   ResourceRequirement:coresMin  4 ;
                                   ResourceRequirement:ramMin    8000
                                 ] ;
        cwl:requirements         [ a  cwl:ShellCommandRequirement ] .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/col_num>
        rdfs:comment  "column number in file of fusion name, use 24 for arriba v1.1, 30 for v2" ;
        cwl:default   30 ;
        sld:type      xsd:int , sld:null .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/input_fusion_file>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output/formatted_fusion_tsv> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/genome_tar>
        sld:type  cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/input_fusion_file>
        rdfs:comment  "Fusion file formatted by format_fusion_file.cwl, likely from arriba input" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/sample_name>
        sld:type  xsd:string .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl#format_arriba_fusion_file>
        a                        cwl:CommandLineTool ;
        ns1:original_cwlVersion  "v1.0" ;
        cwl:arguments            ( [ CommandLineBinding:position    1 ;
                                     CommandLineBinding:shellQuote  false ;
                                     cwl:valueFrom                  "--outputfile $(inputs.sample_name).arriba_formatted.tsv"
                                   ]
                                 ) ;
        cwl:baseCommand          ( "Rscript" "formatArribaFusionCalls.R" ) ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/v1.2> ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl#format_arriba_fusion_file/sample_name> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl#format_arriba_fusion_file/arriba_fusion_file> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl#format_arriba_fusion_file/formatted_fusion_tsv> ;
        cwl:requirements         [ a                             cwl:DockerRequirement ;
                                   DockerRequirement:dockerPull  "pgc-images.sbgenomics.com/d3b-bixu/annofuse:0.92.0"
                                 ] ;
        cwl:requirements         [ a  cwl:InlineJavascriptRequirement ] ;
        cwl:requirements         [ a                             cwl:ResourceRequirement ;
                                   ResourceRequirement:coresMin  2 ;
                                   ResourceRequirement:ramMin    4000
                                 ] ;
        cwl:requirements         [ a            cwl:InitialWorkDirRequirement ;
                                   cwl:listing  [ cwl:entry      "suppressPackageStartupMessages(library(\"readr\"))\nsuppressPackageStartupMessages(library(\"dplyr\"))\nsuppressPackageStartupMessages(library(\"optparse\"))\n\n\noption_list <- list(\n  make_option(c(\"-f\", \"--fusionfile\"),type=\"character\",\n              help=\"Fusion calls from Arriba\"),\n  make_option(c(\"-t\", \"--tumorid\"), type=\"character\",\n              help=\"KF tumor id\"),\n  make_option(c(\"-o\",\"--outputfile\"),type=\"character\",\n              help=\"Formatted fusion calls from [STARfusion | Arriba] (.TSV)\")\n)\n\n# Get command line options, if help option encountered print help and exit,\nopt <- parse_args(OptionParser(option_list=option_list))\ninputfile <- opt$fusionfile\ntumorid <- opt$tumorid\noutputfile <- opt$outputfile\n\ndf<-read_tsv(inputfile,col_types = readr::cols(breakpoint1 = readr::col_character(),breakpoint2 = readr::col_character()))\ndf$`gene1--gene2`<-paste(df$`#gene1`,df$gene2,sep=\"--\")\n\n\n# write to output file\nwrite.table(df,outputfile,sep=\"\\t\",quote=FALSE,row.names = FALSE)\n" ;
                                                  cwl:entryname  "formatArribaFusionCalls.R"
                                                ]
                                 ] ;
        cwl:requirements         [ a  cwl:ShellCommandRequirement ] .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output/sample_name>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/sample_name> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl#format_arriba_fusion_file/arriba_fusion_file>
        rdfs:comment      "Arriba fusion file" ;
        cwl:inputBinding  [ CommandLineBinding:position  1 ;
                            CommandLineBinding:prefix    "--fusionfile"
                          ] ;
        sld:type          cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/filtered_fusions_tsv>
        cwl:outputBinding  [ CommandOutputBinding:glob
                          "*.tsv" ] ;
        sld:type           cwl:File , sld:null .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/col_num>
        rdfs:comment  "0-based column number in file of fusion name, use 24 for arriba v1.1, 30 for v2" ;
        cwl:default   30 ;
        sld:type      xsd:int , sld:null .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/output_basename>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/output_basename> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/arriba_output_file>
        rdfs:comment  "Output from arriba, usually extension arriba.fusions.tsv" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/arriba_formatted_fusions>
        rdfs:comment  "arriba fusion file formatted by format_fusion_file.cwl, and annotated by fusion_annotator.cwl" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/output_basename>
        rdfs:comment  "String to use as basename for outputs" ;
        sld:type      xsd:string .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/starfusion_formatted_fusions>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/star_fusion_output_file> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output>
        cwl:in   <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output/arriba_fusion_file> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output/sample_name> ;
        cwl:out  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output/formatted_fusion_tsv> ;
        cwl:run  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/genome_untar_path>
        rdfs:comment  "This is what the path will be when genome_tar is unpackaged" ;
        cwl:default   "GRCh38_v39_CTAT_lib_Mar242022.CUSTOM" ;
        sld:type      xsd:string , sld:null .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/col_num>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/col_num> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/star_fusion_output_file>
        rdfs:comment  "Output from STAR Fusion, usually extension STAR.fusion_predictions.abridged.coding_effect.tsv" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/arriba_formatted_fusions>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/annotated_tsv> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/sample_name>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/sample_name> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/output_basename>
        sld:type  xsd:string .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/annotated_tsv>
        cwl:outputBinding  [ CommandOutputBinding:glob
                          "*.tsv" ] ;
        sld:type           cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/format_arriba_output/arriba_fusion_file>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/arriba_output_file> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse>
        a                        cwl:CommandLineTool ;
        ns1:original_cwlVersion  "v1.0" ;
        cwl:arguments            ( [ CommandLineBinding:position    1 ;
                                     CommandLineBinding:shellQuote  false ;
                                     cwl:valueFrom                  "A_CT=`wc -l $(inputs.arriba_formatted_fusions.path) | cut -f 1 -d \" \"`\nS_CT=`wc -l $(inputs.starfusion_formatted_fusions.path) | cut -f 1 -d \" \"`\nif [ $A_CT -eq 1 ] && [ $S_CT -eq 1 ]; then\n  echo \"Both inputs are empty, will skip processing as there no fusions.\" >&2;\n  exit 0;\nfi\nRscript annoFusePerSample.R --fusionfileArriba $(inputs.arriba_formatted_fusions.path) --fusionfileStarFusion $(inputs.starfusion_formatted_fusions.path) --expressionFile $(inputs.rsem_expr_file.path) --tumorID $(inputs.sample_name) --outputfile $(inputs.output_basename).annoFuse_filter.tsv"
                                   ]
                                 ) ;
        cwl:baseCommand          () ;
        cwl:cwlVersion           <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/v1.2> ;
        cwl:hints                [ a                            <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/NetworkAccess> ;
                                   NetworkAccess:networkAccess  true
                                 ] ;
        cwl:hints                [ a       <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/LoadListingRequirement> ;
                                   LoadListingRequirement:loadListing
                                           "deep_listing"
                                 ] ;
        cwl:inputs               <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/starfusion_formatted_fusions> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/rsem_expr_file> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/arriba_formatted_fusions> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/sample_name> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/output_basename> ;
        cwl:outputs              <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/filtered_fusions_tsv> ;
        cwl:requirements         [ a                             cwl:ResourceRequirement ;
                                   ResourceRequirement:coresMin  4 ;
                                   ResourceRequirement:ramMin    8000
                                 ] ;
        cwl:requirements         [ a            cwl:InitialWorkDirRequirement ;
                                   cwl:listing  [ cwl:entry      "library(\"annoFuse\")\n\nsuppressPackageStartupMessages(library(\"readr\"))\nsuppressPackageStartupMessages(library(\"tidyverse\"))\nsuppressPackageStartupMessages(library(\"reshape2\"))\nsuppressPackageStartupMessages(library(\"optparse\"))\n\noption_list <- list(\n  make_option(c(\"-a\", \"--fusionfileArriba\"),type=\"character\",\n              help=\"Formatted fusion calls from arriba\"),\n  make_option(c(\"-s\", \"--fusionfileStarFusion\"),type=\"character\",\n              help=\"Formatted fusion calls from starfusion\"),\n  make_option(c(\"-e\", \"--expressionFile\"),type=\"character\",\n              help=\"RSEM file for sample\"),\n  make_option(c(\"-t\", \"--tumorID\"),type=\"character\",\n              help=\"Sample name to rename column in RSEM FPKM column\"),\n  make_option(c(\"-o\",\"--outputfile\"),type=\"character\",\n              help=\"Formatted and filtered fusion calls from [STARfusion | Arriba] (.TSV)\")\n)\n\n#read in caller results\nopt <- parse_args(OptionParser(option_list=option_list))\nArribainputfile <- opt$fusionfileArriba\nSTARFusioninputfile <- opt$fusionfileStarFusion\nexpressionFile<-opt$expressionFile\ntumorID<-opt$tumorID\noutputfile <- opt$outputfile\n\nstandardFusioncalls <- annoFuse::annoFuse_single_sample(\n   # Example files are provided in extdata, at-least 1 fusionfile is required along \n   # with its rsem expression file\n   fusionfileArriba = Arribainputfile,\n   fusionfileStarFusion = STARFusioninputfile,\n   expressionFile = expressionFile,\n   tumorID = tumorID,\n   # multiple read flag values for filtering using FusionAnnotator values\n   artifactFilter = \"GTEx_Recurrent|DGD_PARALOGS|Normal|BodyMap\",\n   # keep all in-frame , frameshift and other types of Fusion_Type\n   readingFrameFilter = \"in-frame|frameshift|other\",\n   # keep all fusions with atleast 1 junction read support\n   junctionReadCountFilter = 1,\n   # keep only fusions where spanningFragCount-junctionReadCountFilter less than equal to 100\n   spanningFragCountFilter = 100,\n   # filter read throughs\n   readthroughFilter = FALSE\n)\n\n\n# write to outputfile\nwrite.table(standardFusioncalls,outputfile,sep=\"\\t\",quote=FALSE,row.names = FALSE)\n" ;
                                                  cwl:entryname  "annoFusePerSample.R"
                                                ]
                                 ] ;
        cwl:requirements         [ a                             cwl:DockerRequirement ;
                                   DockerRequirement:dockerPull  "pgc-images.sbgenomics.com/d3b-bixu/annofuse:0.92.0"
                                 ] ;
        cwl:requirements         [ a  cwl:ShellCommandRequirement ] ;
        cwl:requirements         [ a  cwl:InlineJavascriptRequirement ] .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/FusionGenome>
        rdfs:comment  "Tar ball with fusion_annot_lib.idx and blast_pairs.idx from STAR-Fusion CTAT Genome lib" ;
        ns2:sevenbridges.comsuggestedValue
                <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/FusionGenome/GRCh38_v39_fusion_annot_custom.tar.gz> ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter>
        cwl:in   <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/sample_name> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/arriba_formatted_fusions> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/starfusion_formatted_fusions> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/output_basename> , <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/rsem_expr_file> ;
        cwl:out  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annoFuse_filter/filtered_fusions_tsv> ;
        cwl:run  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/rsem_expr_file>
        rdfs:comment  "gzipped rsem gene expression file" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/output_basename>
        sld:type  xsd:string .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/annotate_arriba/genome_tar>
        cwl:source  <https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/workflow/kfdrc_annoFuse_wf.cwl#kfdrc-annofuse-wf/FusionGenome> .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/annoFuse.cwl#annoFuse/starfusion_formatted_fusions>
        rdfs:comment  "STARFusion file formatted by format_fusion_file.cwl" ;
        sld:type      cwl:File .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/format_arriba_fusion_file.cwl#format_arriba_fusion_file/sample_name>
        rdfs:comment      "Sample name" ;
        cwl:inputBinding  [ CommandLineBinding:position  1 ;
                            CommandLineBinding:prefix    "--tumorid"
                          ] ;
        sld:type          xsd:string .

<https://w3id.org/cwl/view/git/893693621e55c442c22c8fc84934b1767dbaf783/tools/fusion_annotator.cwl#fusion_annotator/genome_untar_path>
        rdfs:comment  "This is what the path will be when genome_tar is unpackaged" ;
        cwl:default   "GRCh38_v39_CTAT_lib_Mar242022.CUSTOM" ;
        sld:type      xsd:string , sld:null .
