Skip to content

Commit 4b6187a

Browse files
authored
Merge pull request #133 from assemblerflow/dev
1.3.1
2 parents e4affbe + 07083f2 commit 4b6187a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+599
-54
lines changed

changelog.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## Changes in upcoming release (`dev` branch)
4+
5+
### Features
6+
7+
- Added a new `clearInput` parameter to components that change their input.
8+
The aim of this option is to allow the controlled removal of temporary files,
9+
which is particularly useful in very large workflows.
10+
11+
### Components changes
12+
13+
- Updated images for components `mash_dist`, `mash_screen` and
14+
`mapping_patlas`.
15+
16+
### New components
17+
- Added component `fast_ani`.
18+
19+
### Minor/Other changes
20+
21+
- Added `--export-directives` option to `build` mode to export component's
22+
directives in JSON format to standard output.
23+
- Added more date information in `inspect` mode, including the year and the
24+
locale of the executing system.
25+
326
## 1.3.0
427

528
### Features

docker/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:3.6-alpine3.7
2+
MAINTAINER Bruno Gonçalves <bfgoncalves@medicina.ulisboa.pt>
3+
4+
RUN apk add --no-cache git
5+
6+
WORKDIR /flowcraft
7+
8+
# Clone FlowCraft
9+
RUN git clone https://github.com/assemblerflow/flowcraft.git
10+
WORKDIR ./flowcraft
11+
12+
# Install flowcraft
13+
RUN python setup.py install
14+
15+
WORKDIR /flowcraft
16+
17+
# Remove unnecessary packages
18+
RUN apk del git

docs/user/available_components.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ Distance Estimation
9999
plasmid database and generates a JSON input file for pATLAS. This component
100100
searches for containment of a given sequence in read sequencing data.
101101
However if a different database is provided it can use mash screen for other
102-
purporses.
102+
purposes.
103+
104+
- :doc:`components/fast_ani`: Performs pairwise comparisons between fastas,
105+
given a multifasta as input for fastANI. It will split the multifasta into
106+
single fastas that will then be provided as a matrix. The output will be the
107+
all pairwise comparisons that pass the minimum of 50 aligned sequences with a
108+
default length of 200 bp.
103109

104110
- :doc:`components/mash_sketch_fasta`: Performs mash sketch for fasta files.
105111

docs/user/components/fast_ani.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
fast_ani
2+
========
3+
4+
Purpose
5+
-------
6+
7+
This component performs pairwise comparisons between fastas,
8+
given a multifasta as input for fastANI. It will split the multifasta into
9+
single fastas that will then be provided as a matrix. The output will be the
10+
all pairwise comparisons that pass the minimum of 50 aligned sequences with a
11+
default length of 200 bp.
12+
13+
Input/Output type
14+
------------------
15+
16+
- Input type: ``fasta``
17+
- Output type: ``None``
18+
19+
20+
Parameters
21+
----------
22+
23+
- ``fragLen``: Sets the minimum size of the fragment to be passed to
24+
`--fragLen` argument of fastANI.
25+
26+
27+
Published results
28+
-----------------
29+
30+
- ``results/fast_ani/``: A text file with the extension `.out`, which has all
31+
the pairwise comparisons between sequences, reporting ANI.
32+
33+
34+
Published reports
35+
-----------------
36+
37+
None.
38+
39+
40+
Default directives
41+
------------------
42+
43+
- ``fastAniMatrix``:
44+
- ``container``: flowcraft/fast_ani
45+
- ``version``: 1.1.0-2
46+
- ``cpus``: 20
47+
- ``memory``: { 30.GB * task.attempt }

docs/user/components/mapping_patlas.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ Default directives
6060

6161
- ``mappingBowtie``:
6262
- ``container``: flowcraft/mapping-patlas
63-
- ``version``: 1.4.1
63+
- ``version``: 1.6.0-1
6464
- ``samtoolsView``:
6565
- ``container``: flowcraft/mapping-patlas
66-
- ``version``: 1.4.1
66+
- ``version``: 1.6.0-1
6767
- ``jsonDumpingMapping``:
6868
- ``container``: flowcraft/mapping-patlas
69-
- ``version``: 1.4.1
69+
- ``version``: 1.6.0-1

docs/user/components/mash_dist.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Default directives
6565

6666
- ``runMashDist``:
6767
- ``container``: flowcraft/mash-patlas
68-
- ``version``: 1.4.1
68+
- ``version``: 1.6.0-1
6969
- ``mashDistOutputJson``:
7070
- ``container``: flowcraft/mash-patlas
71-
- ``version``: 1.4.1
71+
- ``version``: 1.6.0-1

docs/user/components/mash_screen.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Default directives
6060

6161
- ``mashScreen``:
6262
- ``container``: flowcraft/mash-patlas
63-
- ``version``: 1.4.1
63+
- ``version``: 1.6.0-1
6464
- ``mashOutputJson``:
6565
- ``container``: flowcraft/mash-patlas
66-
- ``version``: 1.4.1
66+
- ``version``: 1.6.0-1

flowcraft/flowcraft.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ def get_args(args=None):
9797
"components (via -t option) in JSON format to stdout. "
9898
"No pipeline will be generated with this option."
9999
)
100+
build_parser.add_argument(
101+
"--export-directives", dest="export_directives", action="store_const",
102+
const=True, help="Only export the directives for the provided "
103+
"components (via -t option) in JSON format to stdout. "
104+
"No pipeline will be generated with this option."
105+
)
100106

101107
# GENERAL OPTIONS
102108
parser.add_argument(
@@ -177,7 +183,7 @@ def validate_build_arguments(args):
177183

178184
# Skill all checks when exporting parameters AND providing at least one
179185
# component
180-
if args.export_params:
186+
if args.export_params or args.export_directives:
181187
# Check if components provided
182188
if not args.tasks:
183189
logger.error(colored_print(
@@ -266,8 +272,9 @@ def copy_project(path):
266272

267273
def build(args):
268274

269-
# Disable standard logging for stdout when the following modes are executed:
270-
if args.export_params:
275+
# Disable standard logging for stdout when the following modes are
276+
# executed:
277+
if args.export_params or args.export_directives:
271278
logger.setLevel(logging.ERROR)
272279

273280
welcome = [
@@ -330,6 +337,9 @@ def build(args):
330337
if args.export_params:
331338
nfg.export_params()
332339
sys.exit(0)
340+
elif args.export_directives:
341+
nfg.export_directives()
342+
sys.exit(0)
333343
else:
334344
# building the actual pipeline nf file
335345
nfg.build()

flowcraft/generator/components/assembly.py

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ def __init__(self, **kwargs):
5050
"If 'auto' the SPAdes k-mer lengths will be determined "
5151
"from the maximum read length of each assembly. If "
5252
"'default', SPAdes will use the default k-mer lengths. "
53+
},
54+
"clearInput": {
55+
"default": "false",
56+
"description":
57+
"Permanently removes temporary input files. This option "
58+
"is only useful to remove temporary files in large "
59+
"workflows and prevents nextflow's resume functionality. "
60+
"Use with caution."
5361
}
5462
}
5563

@@ -81,6 +89,18 @@ def __init__(self, **kwargs):
8189
"scratch": "true"
8290
}}
8391

92+
self.params = {
93+
"clearInput": {
94+
"default": "false",
95+
"description":
96+
"Permanently removes temporary input files. This option "
97+
"is only useful to remove temporary files in large "
98+
"workflows and prevents nextflow's resume functionality. "
99+
"Use with caution."
100+
}
101+
}
102+
103+
84104
class ViralAssembly(Process):
85105
"""
86106
Process to assemble viral genomes, based on SPAdes and megahit
@@ -95,7 +115,8 @@ def __init__(self, **kwargs):
95115

96116
self.dependencies = ["integrity_coverage"]
97117

98-
self.status_channels = ["va_spades" , "va_megahit", "report_viral_assembly"]
118+
self.status_channels = ["va_spades", "va_megahit",
119+
"report_viral_assembly"]
99120

100121
self.link_end.append({"link": "SIDE_max_len", "alias": "SIDE_max_len"})
101122

@@ -105,7 +126,7 @@ def __init__(self, **kwargs):
105126
"container": "flowcraft/viral_assembly",
106127
"version": "0.1-1",
107128
"scratch": "true"
108-
},"va_megahit": {
129+
}, "va_megahit": {
109130
"cpus": 4,
110131
"memory": "{ 5.GB * task.attempt }",
111132
"container": "flowcraft/viral_assembly",
@@ -146,5 +167,13 @@ def __init__(self, **kwargs):
146167
"from the maximum read length of each assembly. If "
147168
"'default', megahit will use the default k-mer lengths. "
148169
"(default: $params.megahitKmers)"
170+
},
171+
"clearInput": {
172+
"default": "false",
173+
"description":
174+
"Permanently removes temporary input files. This option "
175+
"is only useful to remove temporary files in large "
176+
"workflows and prevents nextflow's resume functionality. "
177+
"Use with caution."
149178
}
150-
}
179+
}

flowcraft/generator/components/assembly_processing.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ def __init__(self, **kwargs):
204204
self.link_end.append({"link": "SIDE_BpCoverage",
205205
"alias": "SIDE_BpCoverage"})
206206

207+
self.params = {
208+
"clearInput": {
209+
"default": "false",
210+
"description":
211+
"Permanently removes temporary input files. This option "
212+
"is only useful to remove temporary files in large "
213+
"workflows and prevents nextflow's resume functionality. "
214+
"Use with caution."
215+
}
216+
}
217+
207218
self.directives = {
208219
"pilon": {
209220
"cpus": 4,

0 commit comments

Comments
 (0)