Frequently Asked Questions
---------------------------


**CulebrONT report does not show any QUAST results**

- To observe results on CulebrONT final report you have to transfer the whole directory ``FINAL_RESULTS``. It contains a QUAST subdirectory as well as the ``snakemake-report.htlm`` generated by snakemake argument --report.


**Error validating model from --model argument**

- This error is obtained if you did not bind your $HOME directory to your Singularity. It is necessary to launch the snakemake command line using ``--singularity-args '--bind $HOME'`` argument.


**How much space does it take to install the whole CulebrONT dependencies?**

- Built containers singularity.culebront_tools.sif and singularity.report.sig take 5G and 781M respectively.

**Recommended Snakemake command line to launch CulebrONT**

.. code-block:: bash

    snakemake --nolock --use-singularity --singularity-args '--bind $HOME' --cores -p -s Snakefile --latency-wait 6000000 --keep-going --restart-times 0 --rerun-incomplete --configfile config.yaml

- Bind mounts partition to the Singularity environment by using ``--singularity-args '--bind $HOME'``. This allows to detect non-regular mounting points within the Singularity container.


**How to include others SLURM options on cluster_config.yaml**

   When a SLURM profile is created, default slurm options are created in a 'RESOURCE_MAPPING' dictionary by the profiles/CulebrONT/slurm-submit.py script. You can add other keys into this dictionary (ex. nodelist) and populate the ``cluster_config.yaml`` file with these new options.


**The conda command is not available in the shell /bin/bash used by Snakemake**

Please check your conda installation. On our cluster (i-Trop) you can add it in your sbatch script. You have to adapt it to your favorite cluster.

.. code-block:: bash

    module load system/Miniconda3/1.0

    env=/home/$(whoami)/.conda/envs/snakemake
    [ ! -d $env ] && echo -e "## [$(date) - culebrONT]\t Creating conda environment for snakemake" && conda env create -f envs/environment.yaml -n snakemake

    source activate snakemake

**Error in Assemblytics log file**

.. code-block:: bash

    Error in revalue(bed$type, c(Repeat_expansion = "Repeat expansion", Repeat_contraction = "Repeat contraction",  : x is not a factor or a character vector.
    Execution halted

After trying the delta files for the failling Assemblytics rules on the Assemblytics webserver, it seems the problem comes from that Assemblytics does not detect any structural variations between the assembly and the reference and so fails to write some of the (graphical) files in connexion with structural variation. Hence, CulebrONT thrown an error when the output files are not found. You can put False to the ASSEMBLYTICS tool in CulebrONT pipeline to override it.


**QUAST takes to much time to run**

Add  the ``--large`` parameter to the QUAST options


**Problem when building conda environments**

CreateCondaEnvironmentException:
Could not create conda environment from /shared/ifbstor1/home/jorjuela/softs/CulebrONT_pipeline/envs/nanopolish_minimap2_samtools_seqtk.yaml:
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working...
Building graph of deps: 0%| | 0/8 [00:00<?, ?it/s]
Examining minimap2=2.17: 0%| | 0/8 [00:00<?, ?it/s]
Examining seqtk=1.3: 12%|█▎ | 1/8 [00:00<00:00, 138.72it/s]
Examining @/linux-64::__archspec==1=x86_64: 25%|██▌ | 2/8 [00:00<00:00, 149.47it/s]
Examining samtools=1.10: 38%|███▊ | 3/8 [00:00<00:00, 220.81it/s]
Examining python=3.7: 50%|█████ | 4/8 [00:00<00:00, 169.27it/s]
Examining nanopolish=0.13.2: 62%|██████▎ | 5/8 [00:01<00:00, 3.16it/s]
Examining nanopolish=0.13.2: 75%|███████▌ | 6/8 [00:01<00:00, 3.79it/s]
Examining @/linux-64::__unix==0=0: 75%|███████▌ | 6/8 [00:01<00:00, 3.79it/s]
Examining @/linux-64::__unix==0=0: 88%|████████▊ | 7/8 [00:01<00:00, 3.56it/s]
Examining @/linux-64::__glibc==2.17=0: 88%|████████▊ | 7/8 [00:01<00:00, 3.56it/s]

OR test use mamba instead of conda ``--conda-frontend mamba``


**Singularity and my local environments**

Bind mounts partitions to the Singularity environment using ``--singularity-args '--bind $YOURMOUNTDISK'``. It allows to detect non-standard mountpoint into the Singularity container. $YOURMOUNTDISK corresponds to the requested partition or volume, and it could be $HOME or another mount path.

**Hmmsearch path is not found running BUSCO using Singularity.culebront_tools image**

Please check if you don't have another instance of BUSCO installed. BUSCO checks the ``config.ini`` file to find binaries such as hmmsearch. We already have detected conflicts because others BUSCO versions were installed on local computers. You could reinitialise $PATH variable before to launch BUSCO using CulebrONT.

**Assemblers are lauched one after other and not in a parallel way**

If assemblers or jobs are launched one after other (serial) and not in a parallel way, please check if the ``--cores`` parameter is provided to the snakemake command line, and remove it if any. This parameter is set to 1 by default. Don't forget to give to CulebrONT the concurrent allowed jobs value when profiles are created as explained in the section profiles.
