@@ -45,7 +45,7 @@ A report html file is generated at the end of the workflow with [MultiQC](https:
The pipeline is built using [Nextflow,](https://www.nextflow.io/docs/latest/index.html#) a bioinformatics workflow tool to run tasks across multiple compute infrastructures in a very portable manner.
Two[Singularity](https://sylabs.io/docs/) containers are available making installation trivial and results highly reproducible.
Three[Singularity](https://sylabs.io/docs/) containers are available making installation trivial and results highly reproducible.
2. Make sure you are in the directory where you downloaded `metagwgs` source files and added the three mandatory Singularity images in `metagwgs/env`
3. Make sure you downloaded all the required data files for metagwgs. If not, they will be downloaded by the pipeline each time you run it in a different folder.
3. Make sure you downloaded all the required data files for metagwgs. If not, they will be downloaded by the pipeline each time you run it in a new project.
4. Download the expected results directory for test files from [link-to-exp-dir]
4. Download the test datasets (expected results + test fastq) from [link-to-test-datasets].
## II. Launch test
## II. Functional tests
The script can be used alongside a homemade script containing the launching command of MetagWGS on the computational cluster of your choice.
Each step of metagwgs produces a series of files. We want to be able to determine if the modifications we perform on metagwgs have an impact on any of these files (presence, contents, format, ...).
If you want to, you can
Two datasets are currently available for these functional tests: test (from [metagwgs/test](https://forgemia.inra.fr/genotoul-bioinfo/metagwgs/-/tree/master/test)) and MAG (from [nf-core/test-datasets](https://github.com/nf-core/test-datasets/tree/mag/test_data))
When launching the functional test script, the files contained in *exp_dir* (in ./test_expected_logs) are scanned and, for each possible file extension, a test if performed on an expected file against it's observed version (in ./results).
### Test methods
5 simple test methods are used:
diff: simple bash difference between two files
`diff exp_path obs_path`
zdiff: simple bash difference between two gzipped files
`zdiff exp_path obs_path`
no_header_diff: remove the headers of .annotations and .seed_orthologs files
Nextflow metagwgs can be launched on any cluster manager (sge, slurm, ...). The script for functional tests can use a provided script containing the command to launch Nextflow on a cluster.
Exemples below use the slurm job manager and launche all 7 steps of metagwgs to ensure all parts of main.nf work as intended.
### Launch with script
### Launch without script
\ No newline at end of file
Create a new directory (project-directory) containing a shell script to be used by functional tests:
If a test resulted in 'Failed' instead of 'Passed', the stdout is printed in log.
Sometimes, files are not tested because present in exp_dir but not in obs_dir. Then a log ft_\[step\].not_tested if created containing names of missing files. In 02_assembly, there are two possible assembly programs that can be used: metaspades and megahit, resulting in this .not_tested log file. Not tested files are not counted in missed count.