tdayris/fair_cnv_facets
Snakemake workflow designed to call CNV using Facets
Overview
Topics:
Latest release: None, Last update: 2024-12-09
Linting: linting: failed, Formatting:formatting: failed
Deployment
Step 1: Install Snakemake and Snakedeploy
Snakemake and Snakedeploy are best installed via the Mamba package manager (a drop-in replacement for conda). If you have neither Conda nor Mamba, it is recommended to install Miniforge. More details regarding Mamba can be found here.
When using Mamba, run
mamba create -c conda-forge -c bioconda --name snakemake snakemake snakedeploy
to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via
conda activate snakemake
Step 2: Deploy workflow
With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:
mkdir -p path/to/project-workdir
cd path/to/project-workdir
In all following steps, we will assume that you are inside of that directory. Then run
snakedeploy deploy-workflow https://github.com/tdayris/fair_cnv_facets . --tag None
Snakedeploy will create two folders, workflow
and config
. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.
Step 3: Configure workflow
To configure the workflow, adapt config/config.yml
to your needs following the instructions below.
Step 4: Run workflow
The deployment method is controlled using the --software-deployment-method
(short --sdm
) argument.
To run the workflow with automatic deployment of all required software via conda
/mamba
, use
snakemake --cores all --sdm conda
To run the workflow using a combination of conda
and apptainer
/singularity
for software deployment, use
snakemake --cores all --sdm conda apptainer
Snakemake will automatically detect the main Snakefile
in the workflow
subfolder and execute the workflow module that has been defined by the deployment in step 2.
For further options such as cluster and cloud execution, see the docs.
Step 5: Generate report
After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using
snakemake --report report.zip
Configuration
The following section is imported from the workflow’s config/README.md
.
This pipeline requires two configuration file:
A standard Snakemake
configuration, yaml-formatted file containing a list of
all parameters accepted in this workflow:
-
samples
: Path to the file containing link between samples and their fastq file(s) -
params
: Per-tool list of optional parameters
Example:
samples: config/samples.csv
Optional parameters
params:
Optional parameters for pyfaidx (filter/correct fasta format)
pyfaidx: # Filter-out non canonical chromosomes dna: ‘–regex “^[[0-9]+|X|Y|MT]”’ # Keep all cdna sequences cdna: “”
Optional parameters for agat (filter/correct GTF format)
agat: # Optional parameters for agat_convert_sp_gff2gtf.pl gff2gtf: “” # Optional parameters for agat_sq_filter_feature_from_fasta.pl filter_features: “” # Optional parameters for agat_sq_select_feature_by_attribute_value.pl select_feature_by_attribute_value: “–attribute ‘transcript_support_level’ –value ‘“NA”’ –test ‘=’” # Optional parameters for agat_convert_sp_gff2tsv agat_convert_sp_gff2tsv: “”
Optional parameters for GFFRead
gffread: “”
Optional parameters for bedtools
bedtools: # Optional parameters for filtering non-canonical chromosomes over dbSNP filter_non_canonical_chrom: “”
Optional parameters for tabix index VCF
tabix: “-p vcf”
Optional parameters for fastp
fastp: # Optional adapters to remove adapters: “” # Optional command line arguments for fastp extra: “”
Optional parameters for fastqc
fastqc: “”
Optional parameters for bowtie2
bowtie2: # Optional parameters for bowtie2-build build: “” # Optional parameters for bowtie2-align align: “” sambamba: # Optional parameters for sambamba view view: “–format ‘bam’ –filter ‘mapping_quality >= 30 and not (unmapped or mate_is_unmapped)’ “ # Optional parameters for sambamba markdup markdup: “–remove-duplicates –overflow-list-size=500000” picard: # Mapping QC optional parameters metrics: “” # Optional parameters for picard create sequence dictionary createsequencedictionary: “”
Optional parameters for samtools stats
samtools: # Optional parameters for samtools fasta index faidx: “” # Optional parameters for samtools stats stats: “”
Optional parameters for multiqc
multiqc: “–module picard –module fastqc –module fastp –module samtools –module bowtie2 –module sambamba –zip-data-dir –verbose –no-megaqc-upload –no-ansi –force”
Optional parameters for GATK
A CSV-formatted text file containing the following mandatory columns:
- sample_id: Unique name of the sample
- upstream_file: Path to upstream fastq file
- species: The species name, according to Ensembl standards
- build: The corresponding genome build, according to Ensembl standards
- release: The corresponding genome release, according to Ensembl standards
- downstream_file: Optional path to downstream fastq file
Example:
sample_id,upstream_file,downstream_file,species,build,release
sac_a,data/reads/a.scerevisiae.1.fq,data/reads/a.scerevisiae.2.fq,saccharomyces_cerevisiae,R64-1-1,110
sac_a_input,data/reads/a.scerevisiaeI.1.fq,data/reads/a.scerevisiaeI.2.fq,saccharomyces_cerevisiae,R64-1-1,110
While CSV
format is tested and recommended, this workflow uses python
csv.Sniffer()
to detect column separator. Tabulation and semicolumn are
also accepted as field separator. Remember that only comma-separator is
tested.
Linting and formatting
Linting results
WorkflowError in file /tmp/tmpq3l_wlm0/workflow/Snakefile, line 6:
Failed to open source file /tmp/tmpq3l_wlm0/workflow/rules/fair_genome_indexer_pipeline.smk
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpq3l_wlm0/workflow/rules/fair_genome_indexer_pipeline.smk'
Formatting results
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG]
[DEBUG] In file "/tmp/tmpq3l_wlm0/workflow/rules/fair_bowtie2_mapping.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmpq3l_wlm0/workflow/rules/cnv_facets.smk": Formatted content is different from original
[DEBUG]
[DEBUG] In file "/tmp/tmpq3l_wlm0/workflow/rules/common.smk": Formatted content is different from original
[INFO] 3 file(s) would be changed 😬
[INFO] 3 file(s) would be left unchanged 🎉
snakefmt version: 0.10.2