Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix create dir and container image #59

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 90 additions & 57 deletions bandage/bandage-image.cwl
Original file line number Diff line number Diff line change
@@ -1,96 +1,129 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool

hints:
DockerRequirement:
dockerPull: biocontainers/bandage:v0.8.1-1-deb_cv1

requirements:
EnvVarRequirement:
envDef:
XDG_RUNTIME_DIR: $(runtime.tmpdir)
QT_QPA_PLATFORM: minimal

label: Bandage image
doc: |
an hybrid assembly pipeline for bacterial genomes
*Bandage Overview**
Bandage is a GUI program that allows users to interact with the assembly graphs made by de novo assemblers
such as Velvet, SPAdes, MEGAHIT and others.
De novo assembly graphs contain not only assembled contigs but also the connections between those contigs,
which were previously not easily accessible. Bandage visualises assembly graphs, with connections, using graph layout algorithms.
Nodes in the drawn graph, which represent contigs, can be automatically labelled with their ID, length or depth. Users can interact
with the graph by moving, labelling and colouring nodes. Sequence information can also be extracted directly from the graph viewer.
By displaying connections between contigs, Bandage opens up new possibilities for analysing and improving de novo assemblies
that are not possible by looking at contigs alone.
Bandage works with Graphical Fragment Assembly (GFA) files.
For more information about this file format, see https://gfa-spec.github.io/GFA-spec/GFA2.html

baseCommand: [ Bandage, image ]

id: bandage-image
inputs:
graph:

- id: graph
type: File
doc: |
Graphical Fragment Assembly
Supports multiple assembly graph formats:
LastGraph (Velvet), FASTG (SPAdes), Trinity.fasta, ASQG and GFA.
inputBinding:
position: 1

format:
type:
- 'null'
- type: enum
symbols:
- jpg
- png
- svg


- id: format
type: string
default: jpg
inputBinding:
position: 2
valueFrom: $(inputs.graph.nameroot).$(self)
doc: |
Produce jpg, png or svg file

height:
type: int

- id: height
type: int
default: 1000
inputBinding:
prefix: --height
doc: |
Image height.If only height or width is set,
the other will be determined automatically.
If both are set, the image will be exactly that size.

width:
inputBinding:
prefix: --width

- id: width
type: int?
doc: |
Image width. If only height or width is set, the other will be determined automatically.
If both are set, the image will be exactly that size.

node_name:

- id: node_name
type: boolean
default: true
doc: |
If true, define Node labels as name

node_length:
- id: node_length
type: boolean
default: true
inputBinding:
prefix: --names
valueFrom: --length
doc: |
If true, define Node labels as length


outputs:
image:


# - id: all_script
# type:
# - type: array
# items: File
# outputBinding:
# glob: "*.sh"
# doc: "generated script to run bandage. for learning purpose"


- id: image
type: File
outputBinding:
glob: $(inputs.graph.nameroot).$(inputs.format)
glob: "*.$(inputs.format)"
doc: "Assembly Graph Image"




baseCommand: bash

arguments: [bandage_image_launch.sh]

hints:
DockerRequirement:
dockerPull: "fjrmore/bandage"


requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entryname: bandage_image_launch.sh
entry: |
#!/bin/bash
###########################
# Bandage image wrapper
export QT_QPA_PLATFORM=minimal
TMPDIR=$PWD"/tmp_runtime-bandage"
mkdir -p $TMPDIR
export XDG_RUNTIME_DIR=$TMPDIR
GRAPH="$(inputs.graph.path)"
IMAGE="$(inputs.graph.nameroot).$(inputs.format)"
Bandage image $GRAPH $IMAGE \\
${
var opt=""
if(inputs.height!=null){
opt+=" --height "+inputs.height+ " "
}
if(inputs.width!=null){
opt+=" --width "+inputs.width +" "
}
if(inputs.node_length==true){
opt+=" --names "
}
if(inputs.node_length==true){
opt+=" --lengths "
}
return opt
}


doc: |
CWL tool for Bandage-info.
an hybrid assembly pipeline for bacterial genomes
*Bandage Overview**
Bandage is a GUI program that allows users to interact with the assembly graphs made by de novo assemblers
such as Velvet, SPAdes, MEGAHIT and others.
De novo assembly graphs contain not only assembled contigs but also the connections between those contigs,
which were previously not easily accessible. Bandage visualises assembly graphs, with connections, using graph layout algorithms.
Nodes in the drawn graph, which represent contigs, can be automatically labelled with their ID, length or depth. Users can interact
with the graph by moving, labelling and colouring nodes. Sequence information can also be extracted directly from the graph viewer.
By displaying connections between contigs, Bandage opens up new possibilities for analysing and improving de novo assemblies
that are not possible by looking at contigs alone.
Bandage works with Graphical Fragment Assembly (GFA) files.
For more information about this file format, see https://gfa-spec.github.io/GFA-spec/GFA2.html

103 changes: 70 additions & 33 deletions bandage/bandage-info.cwl
Original file line number Diff line number Diff line change
@@ -1,19 +1,83 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
id: bandage-info
inputs:

- id: graph
type: File
doc: |
Graphical Fragment Assembly.
Supports multiple
assembly graph formats:
LastGraph (Velvet), FASTG (SPAdes), Trinity.fasta, ASQG and GFA.


- id: tsv
type: boolean
default: false
doc: |
If true, output the information in a single tab-delimited line
starting with the graph file





outputs:

# - id: all_script
# type:
# - type: array
# items: File
# outputBinding:
# glob: "*.sh"
# doc: "generated script to run bandage. for learning purpose"

- id: assembly_graph_info
type: File
outputBinding:
glob: "assembly_graph_info.txt"
doc: "Assembly Graph Information"




baseCommand: bash

arguments: [bandage_info_launch.sh]

hints:
DockerRequirement:
dockerPull: biocontainers/bandage:v0.8.1-1-deb_cv1
dockerPull: "fjrmore/bandage"


requirements:
EnvVarRequirement:
envDef:
XDG_RUNTIME_DIR: $(runtime.tmpdir)
QT_QPA_PLATFORM: minimal
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entryname: bandage_info_launch.sh
entry: |
#!/bin/bash
###########################
# Bandage info wrapper
export QT_QPA_PLATFORM=minimal
TMPDIR=$PWD"/tmp_runtime-bandage"
mkdir -p $TMPDIR
export XDG_RUNTIME_DIR=$TMPDIR
Bandage info '$(inputs.graph.path)' \\
${
var opt=""
if(inputs.tsv==true){
opt+=" --tsv "
}
return opt
} \\
> assembly_graph_info.txt


label: Bandage info
doc: |
CWL tool for Bandage-info.
an hybrid assembly pipeline for bacterial genomes
*Bandage Overview**
Bandage is a GUI program that allows users to interact with the assembly graphs made by de novo assemblers
Expand All @@ -27,30 +91,3 @@ doc: |
Bandage works with Graphical Fragment Assembly (GFA) files.
For more information about this file format, see https://gfa-spec.github.io/GFA-spec/GFA2.html

baseCommand: [ Bandage, info ]

inputs:
graph:
type: File
doc: |
Graphical Fragment Assembly
Supports multiple assembly graph formats:
LastGraph (Velvet), FASTG (SPAdes), Trinity.fasta, ASQG and GFA.
inputBinding:
position: 1

tsv:
type: boolean
inputBinding:
prefix: --tsv
doc: |
If true, output the information in a single tab-delimited line
starting with the graph file

stdout: assembly_graph_info.txt

outputs:
assembly_graph_info:
type: stdout
doc: "Assembly Graph Information"