|
| 1 | +from abc import ABC |
| 2 | +from datetime import datetime |
| 3 | + |
| 4 | +from janis_bioinformatics.tools.bioinformaticstoolbase import BioinformaticsTool |
| 5 | +from janis_unix import Csv, Tsv |
| 6 | + |
| 7 | +from janis_bioinformatics.data_types import BamBai |
| 8 | +from janis_core import ( |
| 9 | + CommandTool, |
| 10 | + ToolInput, |
| 11 | + ToolOutput, |
| 12 | + File, |
| 13 | + Boolean, |
| 14 | + String, |
| 15 | + Int, |
| 16 | + Double, |
| 17 | + Float, |
| 18 | + InputSelector, |
| 19 | + Filename, |
| 20 | + ToolMetadata, |
| 21 | + InputDocumentation, |
| 22 | + Array, |
| 23 | +) |
| 24 | +from janis_bioinformatics.tools.arriba.base import ArribaBase |
| 25 | + |
| 26 | + |
| 27 | +class ArribaDrawFusionsBase(ArribaBase, ABC): |
| 28 | + @classmethod |
| 29 | + def arriba_command(self): |
| 30 | + return "/usr/local/bin/draw_fusions.R" |
| 31 | + |
| 32 | + def friendly_name(self) -> str: |
| 33 | + return "Arriba: DrawFusions" |
| 34 | + |
| 35 | + def tool(self) -> str: |
| 36 | + return "ArribaDrawFusions" |
| 37 | + |
| 38 | + def inputs(self): |
| 39 | + return [ |
| 40 | + ToolInput( |
| 41 | + tag="annotation", |
| 42 | + input_type=File(), |
| 43 | + prefix="--annotation=", |
| 44 | + separate_value_from_prefix=False, |
| 45 | + doc="exonsFile", |
| 46 | + ), |
| 47 | + ToolInput( |
| 48 | + tag="fusions", |
| 49 | + input_type=File(), |
| 50 | + prefix="--fusions=", |
| 51 | + separate_value_from_prefix=False, |
| 52 | + doc="fusionsFile", |
| 53 | + ), |
| 54 | + ToolInput( |
| 55 | + tag="outputFilename", |
| 56 | + input_type=Filename(extension=".pdf"), |
| 57 | + prefix="--output=", |
| 58 | + separate_value_from_prefix=False, |
| 59 | + doc="outputFile", |
| 60 | + ), |
| 61 | + ToolInput( |
| 62 | + tag="alignments", |
| 63 | + input_type=BamBai(optional=True), |
| 64 | + prefix="--alignments=", |
| 65 | + separate_value_from_prefix=False, |
| 66 | + doc="alignmentsFile", |
| 67 | + ), |
| 68 | + ToolInput( |
| 69 | + tag="cytobands", |
| 70 | + input_type=File(optional=True), |
| 71 | + prefix="--cytobands=", |
| 72 | + separate_value_from_prefix=False, |
| 73 | + doc="cytobandsFile", |
| 74 | + ), |
| 75 | + ToolInput( |
| 76 | + tag="minConfidenceForCircosPlot", |
| 77 | + input_type=String(optional=True), |
| 78 | + prefix="--minConfidenceForCircosPlot=", |
| 79 | + separate_value_from_prefix=False, |
| 80 | + doc="", |
| 81 | + ), |
| 82 | + ToolInput( |
| 83 | + tag="proteinDomains", |
| 84 | + input_type=File(optional=True), |
| 85 | + prefix="--proteinDomains=", |
| 86 | + separate_value_from_prefix=False, |
| 87 | + doc="proteinDomainsFile", |
| 88 | + ), |
| 89 | + ToolInput( |
| 90 | + tag="squishIntrons", |
| 91 | + input_type=Boolean(optional=True), |
| 92 | + prefix="--squishIntrons=", |
| 93 | + separate_value_from_prefix=False, |
| 94 | + doc="", |
| 95 | + ), |
| 96 | + ToolInput( |
| 97 | + tag="printExonLabels", |
| 98 | + input_type=Boolean(optional=True), |
| 99 | + prefix="--printExonLabels=", |
| 100 | + separate_value_from_prefix=False, |
| 101 | + doc="", |
| 102 | + ), |
| 103 | + ToolInput( |
| 104 | + tag="renderThreeDEffect", |
| 105 | + input_type=Boolean(optional=True), |
| 106 | + prefix="--render3dEffect=", |
| 107 | + separate_value_from_prefix=False, |
| 108 | + doc="", |
| 109 | + ), |
| 110 | + ToolInput( |
| 111 | + tag="pdfWidth", |
| 112 | + input_type=Float(optional=True), |
| 113 | + prefix="--pdfWidth=", |
| 114 | + separate_value_from_prefix=False, |
| 115 | + doc="", |
| 116 | + ), |
| 117 | + ToolInput( |
| 118 | + tag="pdfHeight", |
| 119 | + input_type=Float(optional=True), |
| 120 | + prefix="--pdfHeight=", |
| 121 | + separate_value_from_prefix=False, |
| 122 | + doc="", |
| 123 | + ), |
| 124 | + ToolInput( |
| 125 | + tag="color_one", |
| 126 | + input_type=String(optional=True), |
| 127 | + prefix="--color1=", |
| 128 | + separate_value_from_prefix=False, |
| 129 | + doc="", |
| 130 | + ), |
| 131 | + ToolInput( |
| 132 | + tag="color_two", |
| 133 | + input_type=String(optional=True), |
| 134 | + prefix="--color2=", |
| 135 | + separate_value_from_prefix=False, |
| 136 | + doc="", |
| 137 | + ), |
| 138 | + ToolInput( |
| 139 | + tag="mergeDomainsOverlappingBy", |
| 140 | + input_type=Float(optional=True), |
| 141 | + prefix="--mergeDomainsOverlappingBy=", |
| 142 | + separate_value_from_prefix=False, |
| 143 | + doc="", |
| 144 | + ), |
| 145 | + ToolInput( |
| 146 | + tag="optimizeDomainColors", |
| 147 | + input_type=Boolean(optional=True), |
| 148 | + prefix="--optimizeDomainColors=", |
| 149 | + separate_value_from_prefix=False, |
| 150 | + doc="", |
| 151 | + ), |
| 152 | + ToolInput( |
| 153 | + tag="fontSize", |
| 154 | + input_type=Int(optional=True), |
| 155 | + prefix="--fontSize=", |
| 156 | + separate_value_from_prefix=False, |
| 157 | + doc="", |
| 158 | + ), |
| 159 | + ToolInput( |
| 160 | + tag="showIntergenicVicinity", |
| 161 | + input_type=Int(optional=True), |
| 162 | + prefix="--showIntergenicVicinity=", |
| 163 | + separate_value_from_prefix=False, |
| 164 | + doc="", |
| 165 | + ), |
| 166 | + ToolInput( |
| 167 | + tag="transcriptSelection", |
| 168 | + input_type=String(optional=True), |
| 169 | + prefix="--transcriptSelection=", |
| 170 | + separate_value_from_prefix=False, |
| 171 | + doc="", |
| 172 | + ), |
| 173 | + ] |
| 174 | + |
| 175 | + def outputs(self): |
| 176 | + return [ToolOutput("out", File, selector=InputSelector("outputFilename"))] |
| 177 | + |
| 178 | + def bind_metadata(self): |
| 179 | + return ToolMetadata( |
| 180 | + contributors=["Jiaan Yu"], |
| 181 | + dateCreated=datetime(2021, 3, 15), |
| 182 | + dateUpdated=datetime(2021, 3, 15), |
| 183 | + documentation=""" |
| 184 | +Arriba comes with an R script draw_fusions.R that renders publication-quality |
| 185 | +visualizations of the transcripts involved in predicted fusions. It generates |
| 186 | +a PDF file with one page for each predicted fusion. Each page depicts the |
| 187 | +fusion partners, their orientation, the retained exons in the fusion |
| 188 | +transcript, statistics about the number of supporting reads, and - if the |
| 189 | +column fusion_transcript has a value - an excerpt of the sequence around the |
| 190 | +breakpoint. |
| 191 | +""", |
| 192 | + ) |
0 commit comments