# Terra

Instructions for running STAR-Fusion on [Terra](https://support.terra.bio/). A featured Terra workspace that illustrates running STAR-Fusion is available [here](https://app.terra.bio/#workspaces/ctat-firecloud/STAR-Fusion).

1.  Upload your FASTQ files to your workspace bucket.
    > Example:
    > 
    >     gsutil -m cp /foo/bar/projects/*.fastq.gz gs://fc-e0000000/

    Please see [here](https://support.terra.bio/hc/en-us/articles/360024056512-Uploading-to-a-workspace-Google-bucket) for additional documentation.

1.  Import *CTAT/star_fusion_workflow* workflow to your workspace.
    > See the Terra documentation for [adding a workflow](https://support.terra.bio/hc/en-us/articles/360025674392-Finding-the-workflow-method-you-need-in-the-Methods-Repository). 


1.  In your workspace, open `star_fusion_workflow` in the `WORKFLOWS` tab. 
    If you are running a single sample, select
    `Run workflow with inputs defined by file paths`, otherwise select `Run workflow(s) with inputs defined by data table`.
    Terra uses a [workspace data table](https://support.terra.bio/hc/en-us/articles/360025758392) to run a workflow over multiple samples.
    Enter the workflow parameters and and click the `Save` button. 
-----

## Inputs

Please see the description of important inputs below.

| Column      | Description  
| ----------- | ------------ |
| left_fq   | FASTQ file for read1        
| right_fq     | FASTQ file for read2                                                                  
| genome  | An acronym (either grch38_gencode_v32_1.8 or mouse_gencode_m23_1.8), or a gs:// URL to a custom tar.gz2 genome bundle archive.   
| chimeric_out_junction       | In lieu of FASTQ files, provide previous STAR output. For [kickstart mode](https://github.com/STAR-Fusion/STAR-Fusion/wiki#KickstartMode)                                                  
| sample_id     | Sample id                                                                              
| fusion_inspector    | inspect or validate. Runs FusionInspector in either 'inspect' or 'validate' mode                                                                          
| additional_flags  |  e.g  --no_annotation_filter --min_FFPM 0                            


## Outputs

| Column      | Description                            
| ----------- | ---------------
| bam   | Aligned BAM             
| star_log_final     | STAR aligner log file.                                                                       
| junction       | Chimeric alignments                                                  
| sj     | High confidence collapsed splice junctions in tab-delimited format  
| fusion_predictions  | Tab-delimited file containing predicted fusions.   
| fusion_predictions_abridged    | Same as fusion_predictions file but excludes the identification of the evidence fusion reads                                                                                
| fusion_inspector_inspect_web    | Interactive html report from FusionInspector inspect
| fusion_inspector_inspect_fusions_abridged    | Abridged output from FusionInspector inspect    
| fusion_inspector_validate_web    | Interactive html report from FusionInspector validate    
| fusion_inspector_validate_fusions_abridged     | Abridged output from FusionInspector validate       
| extract_fusion_reads    | Optional FASTQ output if --extract_fusion_reads is provided as part of additional_flags input

Please see [here](https://github.com/STAR-Fusion/STAR-Fusion/wiki#Outputs) for a detailed description of STAR-Fusion outputs and
[here](https://github.com/FusionInspector/FusionInspector/wiki/FusionInspector-Outputs-Described), for a detailed description of FusionInspector outputs.

