Skip to content

Commit 9e18bbb

Browse files
committed
increment to v0.9.0 synchronized with sequana 0.11.0.
Fixes logger issue and add --pacbio option to fill automatically the config file
1 parent 2522fde commit 9e18bbb

File tree

6 files changed

+40
-22
lines changed

6 files changed

+40
-22
lines changed

README.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
This is is the **mapper** pipeline from the `Sequana <https://sequana.readthedocs.org>`_ projet
22

33
:Overview: This is a simple pipeline to map several FastQ files onto a reference using different mappers/aligners
4-
:Input: A set of FastQ files.
5-
:Output: A set of BAM files (and/or bigwig)
4+
:Input: A set of FastQ files (illumina, pacbio, etc).
5+
:Output: A set of BAM files (and/or bigwig) and HTML report
66
:Status: Production
77
:Citation: Cokelaer et al, (2017), ‘Sequana’: a Set of Snakemake NGS pipelines, Journal of Open Source Software, 2(16), 352, JOSS DOI doi:10.21105/joss.00352
88

@@ -60,7 +60,10 @@ Details
6060
~~~~~~~~~
6161

6262
This pipeline runs **mapper** in parallel on the input fastq files (paired or not).
63-
A brief sequana summary report is also produced.
63+
A brief sequana summary report is also produced. When using **--pacbio** option,
64+
*-x map-pb* options ia automatically added to the config.yaml file and the
65+
readtag is set to None.
66+
6467

6568

6669
Rules and configuration details
@@ -76,6 +79,9 @@ Changelog
7679
========= ====================================================================
7780
Version Description
7881
========= ====================================================================
82+
0.9.0 * fix issue with logger and increments requirements
83+
* add new option --pacbio to automatically set the options for
84+
pacbio data (-x map-pb and readtag set to None)
7985
0.8.13 * add the thread option in minimap2 case
8086
0.8.12 * factorise multiqc rule
8187
0.8.11 * Implemente the --from-project option and new framework

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
sequana>=0.8.4
2-
sequana_pipetools>=0.2.2
1+
sequana>=0.11.0
2+
sequana_pipetools>=0.5.2

sequana_pipelines/mapper/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ general:
1919
reference_file:
2020
annotation_file:
2121
create_bigwig: false
22+
2223

2324

2425
bwa_mem_mapping:

sequana_pipelines/mapper/main.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,19 @@ def __init__(self, prog=NAME, epilog=None):
3434

3535
pipeline_group = self.add_argument_group("pipeline")
3636
pipeline_group.add_argument("--mapper", default='bwa',
37-
choices=['bwa', 'minimap2', 'bowtie2'])
37+
choices=['bwa', 'minimap2', 'bowtie2'],
38+
help="Choose one of the valid mapper")
3839
pipeline_group.add_argument("--reference-file", required=True,
39-
)
40+
help="You input reference file in fasta format")
4041
pipeline_group.add_argument("--annotation-file",
4142
help="Used by the sequana_coverage tool if provided" )
4243

4344
pipeline_group.add_argument("--do-coverage", action="store_true",
4445
help="Use sequana_coverage (prokaryotes)" )
4546

47+
pipeline_group.add_argument("--pacbio", action="store_true",
48+
help="If set, automatically set the input-readtag to None and set minimap2 options to -x map-pb" )
49+
4650
pipeline_group.add_argument("--create-bigwig", action="store_true",
4751
help="create the bigwig files from the BAM files" )
4852

@@ -104,6 +108,11 @@ def main(args=None):
104108
if options.create_bigwig:
105109
cfg.general.create_bigwig = True
106110

111+
if options.pacbio:
112+
cfg.minimap2.options = " -x map-pb "
113+
cfg.input_readtag = ""
114+
115+
107116

108117
# finalise the command and save it; copy the snakemake. update the config
109118
# file and save it.

sequana_pipelines/mapper/mapper.rules

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ exec(open(sequana.modules["bowtie2_index_dynamic"], "r").read())
4040

4141
# A convenient manager
4242
manager = sm.PipelineManager("mapper", config)
43+
4344
manager.setup(globals(), mode="warning")
4445

4546

@@ -197,7 +198,7 @@ onsuccess:
197198
shell("chmod -R g+w .")
198199

199200
from sequana import logger
200-
logger.level = "INFO"
201+
logger.setLevel("INFO")
201202

202203
# This should create the stats plot and the Makefile
203204
manager.teardown()
@@ -218,22 +219,23 @@ If coverage was selected, you should also have HTML reports for each sample with
218219
intro += """<h2>Coverage plots overview</h2>"""
219220
import glob
220221
filenames = glob.glob("*/sequana_coverage/*/coverage.png")
221-
if len(filenames)<100:
222-
for filename in filenames:
223-
parts = filename.split("/")
224-
image = SummaryModule2.png_to_embedded_png("self_dummy",
222+
for count, filename in enumerate(filenames):
223+
parts = filename.split("/")
224+
image = SummaryModule2.png_to_embedded_png("self_dummy",
225225
filename,
226226
#style="align:center; width:30%; height:30%",
227227
style="align:center; width:95%; height:95%",
228228
alt=parts[0])
229-
parts = filename.split("/")
230-
link = "/".join(parts[0:-1] + [parts[-2] + ".cov.html"])
231-
232-
intro += """
233-
<div class="box_1_3" ><a href="{}">{}</a><hr>
234-
<a href="{}">{}</a>
235-
</div>
236-
""".format(link, image, link, parts[0])
229+
parts = filename.split("/")
230+
link = "/".join(parts[0:-1] + [parts[-2] + ".cov.html"])
231+
232+
intro += """
233+
<div class="box_1_3" ><a href="{}">{}</a><hr>
234+
<a href="{}">{}</a>
235+
</div>
236+
""".format(link, image, link, parts[0])
237+
if count > 0:
238+
break
237239

238240

239241
s = SummaryModule2(data, intro=intro)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import subprocess
77

88
_MAJOR = 0
9-
_MINOR = 8
10-
_MICRO = 13
9+
_MINOR = 9
10+
_MICRO = 0
1111
version = '%d.%d.%d' % (_MAJOR, _MINOR, _MICRO)
1212
release = '%d.%d' % (_MAJOR, _MINOR)
1313

0 commit comments

Comments
 (0)