Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
update for release 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sravel committed Feb 25, 2022
1 parent 10b6d4e commit 24bfb8a
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 30 deletions.
44 changes: 44 additions & 0 deletions culebrONT/containers/Dockerfile_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#INFORMATION
#MAINTAINER Julie Orjuela & Francois Sabot (Docker)
#version="1.0"
#software="all Culebront dependencies"
#description="All dependencies used to launch CulebrONT in LOCAL mode"
#website="https://culebront-pipeline.readthedocs.io/en/latest/"

FROM ubuntu:focal
USER root

# ENVIRONMENT

# INSTALL, Global
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt -y install keyboard-configuration git vim curl wget less locate graphviz python3-pip
RUN DEBIAN_FRONTEND=noninteractive apt -y install python3.8 python3.8-dev python3.8-venv python3.8-full python3.8-distutils
RUN DEBIAN_FRONTEND=noninteractive apt -y install python3.9 python3.9-dev python3.9-venv python3.9-full python3.9-distutils
RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime
RUN apt install -y tzdata
RUN dpkg-reconfigure --frontend noninteractive tzdata

# Install for Python
RUN echo 'export LC_ALL=C.UTF-8' >> /environment
RUN echo 'export LANG=C.UTF-8' >> /environment
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN python3.8 -m pip install tox
RUN python3.9 -m pip install tox

# installing Singularity
RUN wget https://dl.google.com/go/go1.16.4.linux-amd64.tar.gz
RUN tar -C /usr/local -xzvf go1.16.4.linux-amd64.tar.gz
RUN rm go1.16.4.linux-amd64.tar.gz
ENV PATH=/usr/local/go/bin:$PATH

## Install Singularity itself
RUN wget https://github.com/sylabs/singularity/releases/download/v3.8.1/singularity-ce-3.8.1.tar.gz
RUN tar -xzf singularity-ce-3.8.1.tar.gz
ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig/
RUN cd /singularity-ce-3.8.1 && ./mconfig -p /usr/local && make -C builddir && make -C builddir install

# Download build singularity
RUN mkdir -p /usr/local/culebrONT/Containers && cd /usr/local/culebrONT/Containers && wget --no-check-certificate -rm -nH --cut-dirs=2 --reject="index.html*" --no-parent https://itrop.ird.fr/culebront_utilities/singularity_build/

1 change: 1 addition & 0 deletions culebrONT/snakeWrapper/usefull_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def check_and_download_singularity():
url, path_install = imgs_list
if not Path(path_install).exists():
SINGULARITY_URL_FILES_DOWNLOAD.append(imgs_list)
click.secho(f" File: {path_install} is download.", fg="yellow", nl=True)
else:
click.secho(f" File: {path_install} already download, done.", fg="yellow", nl=True)
results = multiprocessing_download(SINGULARITY_URL_FILES_DOWNLOAD)
Expand Down
33 changes: 32 additions & 1 deletion culebrONT/snakefiles/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,44 @@ rule stats_assembly:
script:
f"{SNAKEMAKE_SCRIPTS}/assembly-stats.py"


rule copy_final_assemblies:
""" build stats on assembly"""
threads: get_threads('copy_final_assemblies', 1)
input:
fasta_list = rules.preparing_fasta_to_quality.output.renamed
output:
fasta_final = f"{output_dir}ASSEMBLIES/{{fastq}}-{{assemblers}}-{{quality_step}}{f'-{add_circular_name}' if add_circular_name else ''}.fasta"
params:
sample = '{fastq}'
log:
output = f"{output_dir}LOGS/copy_final_assemblies/{{fastq}}_{{assemblers}}_{{quality_step}}.o",
error = f"{output_dir}LOGS/copy_final_assemblies/{{fastq}}_{{assemblers}}_{{quality_step}}.e"
message:
"""
Launching {rule}
threads : {threads}
input:
fasta_list : {input.fasta_list}
output:
fasta_final : {output.fasta_final}
log:
output : {log.output}
error: {log.error}
"""
shell:
"""
cp {input.fasta_list} {output.fasta_final}
"""

def output_final(wildcards):
dico_final = {
"fasta_list" : expand(rules.preparing_fasta_to_quality.output.renamed, fastq=FASTQ, assemblers=culebront.assembly_tools_activated, quality_step=culebront.quality_step),
"bench_list" : expand(rules.run_benchmark_time.output.stat_time,fastq=FASTQ),
"dag" : rules.rule_graph.output.dag,
"versions" : rules.run_get_versions.output.csv,
"stats_assembly": expand(rules.stats_assembly.output.csv, fastq = FASTQ)
"stats_assembly": expand(rules.stats_assembly.output.csv, fastq = FASTQ),
"all_assemblies": expand(rules.copy_final_assemblies.output.fasta_final, fastq=FASTQ,assemblers=culebront.assembly_tools_activated,quality_step=culebront.quality_step)
# "report_snakemake" : rules.run_report_snakemake.output.report_snakemake,
}
if config['QUALITY']['QUAST']:
Expand Down
4 changes: 2 additions & 2 deletions culebrONT/snakefiles/quality.snake
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ rule preparing_fasta_to_quality:
input:
fasta = fasta_to_busco
output:
renamed = f"{output_dir}{{fastq}}/AGGREGATED_QC/DATA/{{assemblers}}-{{quality_step}}-{add_circular_name}.fasta"
renamed = f"{output_dir}{{fastq}}/AGGREGATED_QC/DATA/{{fastq}}-{{assemblers}}-{{quality_step}}{f'-{add_circular_name}' if add_circular_name else ''}.fasta"
params:
index_mmi = f"{output_dir}{{fastq}}/AGGREGATED_QC/DATA/{{assemblers}}-{{quality_step}}-{add_circular_name}.fasta.mmi"
index_mmi = f"{output_dir}{{fastq}}/AGGREGATED_QC/DATA/{{fastq}}-{{assemblers}}-{{quality_step}}{f'-{add_circular_name}' if add_circular_name else ''}.fasta.mmi"
log:
output = f"{output_dir}{{fastq}}/LOGS/QUALITY/AGGREGATED_QC/{{fastq}}-{{assemblers}}-{{quality_step}}-preparing_DATA.o",
error = f"{output_dir}{{fastq}}/LOGS/QUALITY/AGGREGATED_QC/{{fastq}}-{{assemblers}}-{{quality_step}}-preparing_DATA.e",
Expand Down
2 changes: 1 addition & 1 deletion culebrONT/snakemake_scripts/assembly-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def calculate_stats(seq_lens, gc_cont):

for assembly_file in sorted(files_list):
assembly_file_path = Path(assembly_file)
assembler, step, _ = assembly_file_path.stem.split("-")
sample, assembler, step, _ = assembly_file_path.stem.split("-")
step = replace_all({"STEP_": "", "_STARTFIXED": ""}, step)
contig_lens, scaffold_lens, gc_cont = read_genome(assembly_file)
scaffold_stats = calculate_stats(scaffold_lens, gc_cont)
Expand Down
17 changes: 2 additions & 15 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
sphinx_copybutton==0.4.0
sphinx_copybutton
snakemake
sphinx_click==3.0.2
setuptools>=45
wheel>=0.37.1
setuptools_scm>=6.2
sphinx-rtd-theme==1.0.0
sphinx==4.4.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-mermaid==0.7.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
docutils==0.17.1
sphinx_click
12 changes: 3 additions & 9 deletions docs/source/ABOUT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Due to the daily deluge of data sequences and the increasing number of released

However a huge question remains:

"\ *But which assembly tool will provide the best result for your favorite organism?*\ "
*"But which assembly tool will provide the best result for your favorite organism?"*

To that anguishing idea, we can answer: **CulebrONT can help you!**

Expand All @@ -22,11 +22,12 @@ Assembly, circularisation, polishing and correction steps are all included withi
:depth: 2
:backlinks: entry


From assembly to correction
---------------------------

CulebrONT is a really flexible tool to assemble, circularise (or not), polish and correct assemblies. You can give your own parameters in the *config.yaml* file to CulebrONT to generate a modular, dedicated pipeline for your own data.

.. warning::
You must launch at least one of the assemblers included in CulebrONT to pipe it with the potential circularisation, polishing and correction steps or with the quality control pipeline.

Expand Down Expand Up @@ -83,7 +84,6 @@ Fixstart is always performed on the last draft sequenced obtained in the pipelin
* Fixstart is launched after the polishing step if assembly+polishing are activated.
* Fixstart is launched after the correction step if assembly+polishing+correction or assembly+correction are activated


.. warning::
In any case, Fixstart will be deactivated if CIRCULAR is set to False

Expand All @@ -100,12 +100,9 @@ Polishing step is ensured by Racon, that corrects raw contigs generated by rapid

.. note::
* Minipolish includes a Racon polishing round, so if polishing is deactivated for the other assemblers (Flye, Shasta, Raven, Smartdenovo and Canu), Miniasm will still polish anyway. Please take it into account when you are doing pipeline comparisons.

* Raven parameter -p (for polishing) is by default of 0.

* A control rotation of circular molecule is performed before every Racon step.


Included tools :

* Racon version >= 1.4.13 https://github.com/isovic/racon
Expand All @@ -122,7 +119,6 @@ Correction can improve the consensus sequence for a draft genome assembly coming
* Polished segments are merged subsequently.
* CulebrONT implemented parallelism following the `Medaka documentation <https://nanoporetech.github.io/medaka/installation.html#improving-parallelism>`_ and the `Nanopolish practices <https://nanopolish.readthedocs.io/en/latest/quickstart_consensus.html#compute-a-new-consensus-sequence-for-a-draft-assembly>`_.


**If you have short reads, you can now use *Pilon* to correct assemblies. As for Racon, several recursive rounds of Pilon can be run.**

Included tools :
Expand Down Expand Up @@ -153,11 +149,9 @@ CulebrONT checks the quality of the assemblies with using these optional tools:
* Samtools flagstats: calculates remapping stats using Illumina reads over assemblies
* Mauve: allows multiple alignment of several assembles (for small genome only).


.. danger::
Please, activate Mauve only for small genomes.


Included tools :

* BUSCO version >= 4.0.5
Expand Down
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=45", "wheel>=0.37.1", "setuptools_scm>=6.2"]
requires = ["setuptools", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
Expand All @@ -18,15 +18,23 @@ envlist = py{38,39}
skip_missing_interpreters = True
skipsdist=False
[gh-actions]
python = 3.8: py38
[testenv:py{38,39}]
description = Run the install in Python 3.8
skip_install = False
changedir={envdir}
whitelist_externals =
bash
echo
envdir =
py38: {toxworkdir}/py38
py39: {toxworkdir}/py39
commands =
culebrONT --help
#culebrONT --help
bash -ec 'echo `pwd`'
bash -ec 'CPDIR="./lib/python3.8/site-packages/culebrONT/containers/"; DIR="/usr/local/culebrONT/Containers"; if [[ -d $DIR ]]; then ls $DIR; echo "copy Containers files in $DIR to $CPDIR"; ln -sf $DIR/* $CPDIR; fi'
culebrONT install_local
Expand Down

0 comments on commit 24bfb8a

Please sign in to comment.