Merge branch 'dev' of github.com:nf-core/taxprofiler into add-filtlong
commit
310ac6b450
@ -0,0 +1,55 @@
|
||||
name: Fix linting from a comment
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
# Only run if comment is on a PR with the main repo, and if it contains the magic keywords
|
||||
if: >
|
||||
contains(github.event.comment.html_url, '/pull/') &&
|
||||
contains(github.event.comment.body, '@nf-core-bot fix linting') &&
|
||||
github.repository == 'nf-core/taxprofiler'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Use the @nf-core-bot token to check out so we can push later
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.nf_core_bot_auth_token }}
|
||||
|
||||
# Action runs on the issue comment, so we don't get the PR by default
|
||||
# Use the gh cli to check out the PR
|
||||
- name: Checkout Pull Request
|
||||
run: gh pr checkout ${{ github.event.issue.number }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
|
||||
- name: Install Prettier
|
||||
run: npm install -g prettier @prettier/plugin-php
|
||||
|
||||
# Check that we actually need to fix something
|
||||
- name: Run 'prettier --check'
|
||||
id: prettier_status
|
||||
run: |
|
||||
if prettier --check ${GITHUB_WORKSPACE}; then
|
||||
echo "::set-output name=result::pass"
|
||||
else
|
||||
echo "::set-output name=result::fail"
|
||||
fi
|
||||
|
||||
- name: Run 'prettier --write'
|
||||
if: steps.prettier_status.outputs.result == 'fail'
|
||||
run: prettier --write ${GITHUB_WORKSPACE}
|
||||
|
||||
- name: Commit & push changes
|
||||
if: steps.prettier_status.outputs.result == 'fail'
|
||||
run: |
|
||||
git config user.email "core@nf-co.re"
|
||||
git config user.name "nf-core-bot"
|
||||
git config push.default upstream
|
||||
git add .
|
||||
git status
|
||||
git commit -m "[automated] Fix linting with Prettier"
|
||||
git push
|
@ -1,2 +1,10 @@
|
||||
email_template.html
|
||||
.nextflow*
|
||||
work/
|
||||
data/
|
||||
results/
|
||||
.DS_Store
|
||||
testing/
|
||||
testing*
|
||||
tests/
|
||||
*.pyc
|
||||
|
@ -1,111 +1,53 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
<meta name="description" content="nf-core/taxprofiler: Taxonomic profiling of shotgun metagenomic data" />
|
||||
<title>nf-core/taxprofiler Pipeline Report</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="font-family: Helvetica, Arial, sans-serif; padding: 30px; max-width: 800px; margin: 0 auto">
|
||||
<img src="cid:nfcorepipelinelogo" />
|
||||
<meta name="description" content="nf-core/taxprofiler: Taxonomic profiling of shotgun metagenomic data">
|
||||
<title>nf-core/taxprofiler Pipeline Report</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="font-family: Helvetica, Arial, sans-serif; padding: 30px; max-width: 800px; margin: 0 auto;">
|
||||
|
||||
<h1>nf-core/taxprofiler v${version}</h1>
|
||||
<h2>Run Name: $runName</h2>
|
||||
<img src="cid:nfcorepipelinelogo">
|
||||
|
||||
<% if (!success){ out << """
|
||||
<div
|
||||
style="
|
||||
color: #a94442;
|
||||
background-color: #f2dede;
|
||||
border-color: #ebccd1;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
"
|
||||
>
|
||||
<h4 style="margin-top: 0; color: inherit">nf-core/taxprofiler execution completed unsuccessfully!</h4>
|
||||
<h1>nf-core/taxprofiler v${version}</h1>
|
||||
<h2>Run Name: $runName</h2>
|
||||
|
||||
<% if (!success){
|
||||
out << """
|
||||
<div style="color: #a94442; background-color: #f2dede; border-color: #ebccd1; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
|
||||
<h4 style="margin-top:0; color: inherit;">nf-core/taxprofiler execution completed unsuccessfully!</h4>
|
||||
<p>The exit status of the task that caused the workflow execution to fail was: <code>$exitStatus</code>.</p>
|
||||
<p>The full error message was:</p>
|
||||
<pre style="white-space: pre-wrap; overflow: visible; margin-bottom: 0">${errorReport}</pre>
|
||||
</div>
|
||||
""" } else { out << """
|
||||
<div
|
||||
style="
|
||||
color: #3c763d;
|
||||
background-color: #dff0d8;
|
||||
border-color: #d6e9c6;
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
"
|
||||
>
|
||||
<pre style="white-space: pre-wrap; overflow: visible; margin-bottom: 0;">${errorReport}</pre>
|
||||
</div>
|
||||
"""
|
||||
} else {
|
||||
out << """
|
||||
<div style="color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px;">
|
||||
nf-core/taxprofiler execution completed successfully!
|
||||
</div>
|
||||
""" } %>
|
||||
</div>
|
||||
"""
|
||||
}
|
||||
%>
|
||||
|
||||
<p>The workflow was completed at <strong>$dateComplete</strong> (duration: <strong>$duration</strong>)</p>
|
||||
<p>The command used to launch the workflow was as follows:</p>
|
||||
<pre
|
||||
style="
|
||||
white-space: pre-wrap;
|
||||
overflow: visible;
|
||||
background-color: #ededed;
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 30px;
|
||||
"
|
||||
>
|
||||
$commandLine</pre
|
||||
>
|
||||
<p>The workflow was completed at <strong>$dateComplete</strong> (duration: <strong>$duration</strong>)</p>
|
||||
<p>The command used to launch the workflow was as follows:</p>
|
||||
<pre style="white-space: pre-wrap; overflow: visible; background-color: #ededed; padding: 15px; border-radius: 4px; margin-bottom:30px;">$commandLine</pre>
|
||||
|
||||
<h3>Pipeline Configuration:</h3>
|
||||
<table
|
||||
style="
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
border: 0;
|
||||
margin-bottom: 30px;
|
||||
"
|
||||
>
|
||||
<tbody style="border-bottom: 1px solid #ddd">
|
||||
<% out << summary.collect{ k,v -> "
|
||||
<tr>
|
||||
<th
|
||||
style="
|
||||
text-align: left;
|
||||
padding: 8px 0;
|
||||
line-height: 1.42857143;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid #ddd;
|
||||
"
|
||||
>
|
||||
$k
|
||||
</th>
|
||||
<td
|
||||
style="
|
||||
text-align: left;
|
||||
padding: 8px;
|
||||
line-height: 1.42857143;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid #ddd;
|
||||
"
|
||||
>
|
||||
<pre style="white-space: pre-wrap; overflow: visible">$v</pre>
|
||||
</td>
|
||||
</tr>
|
||||
" }.join("\n") %>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Pipeline Configuration:</h3>
|
||||
<table style="width:100%; max-width:100%; border-spacing: 0; border-collapse: collapse; border:0; margin-bottom: 30px;">
|
||||
<tbody style="border-bottom: 1px solid #ddd;">
|
||||
<% out << summary.collect{ k,v -> "<tr><th style='text-align:left; padding: 8px 0; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'>$k</th><td style='text-align:left; padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #ddd;'><pre style='white-space: pre-wrap; overflow: visible;'>$v</pre></td></tr>" }.join("\n") %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>nf-core/taxprofiler</p>
|
||||
<p><a href="https://github.com/nf-core/taxprofiler">https://github.com/nf-core/taxprofiler</a></p>
|
||||
</div>
|
||||
</body>
|
||||
<p>nf-core/taxprofiler</p>
|
||||
<p><a href="https://github.com/nf-core/taxprofiler">https://github.com/nf-core/taxprofiler</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Nextflow config file for running minimal tests
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Defines input files and everything required to run a fast and simple pipeline test.
|
||||
|
||||
Use as follows:
|
||||
nextflow run nf-core/taxprofiler -profile test,<docker/singularity> --outdir <OUTDIR>
|
||||
|
||||
----------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
params {
|
||||
config_profile_name = 'Test profile'
|
||||
config_profile_description = 'Minimal test dataset skipping all preprocessing to check pipeline function'
|
||||
|
||||
// Limit resources so that this can run on GitHub Actions
|
||||
max_cpus = 2
|
||||
max_memory = '6.GB'
|
||||
max_time = '6.h'
|
||||
|
||||
// Input data
|
||||
// TODO nf-core: Specify the paths to your test data on nf-core/test-datasets
|
||||
// TODO nf-core: Give any required params for the test so that command line flags are not needed
|
||||
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv'
|
||||
databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database.csv'
|
||||
perform_shortread_clipmerge = false
|
||||
perform_longread_clip = false
|
||||
perform_shortread_complexityfilter = false
|
||||
perform_shortread_hostremoval = false
|
||||
perform_longread_hostremoval = false
|
||||
perform_runmerging = false
|
||||
hostremoval_reference = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta'
|
||||
run_kaiju = true
|
||||
run_kraken2 = true
|
||||
run_malt = true
|
||||
run_metaphlan3 = true
|
||||
run_centrifuge = true
|
||||
run_diamond = true
|
||||
}
|
||||
|
||||
process {
|
||||
withName: MALT_RUN {
|
||||
maxForks = 1
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Nextflow config file for running minimal tests
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Defines input files and everything required to run a fast and simple pipeline test.
|
||||
|
||||
Use as follows:
|
||||
nextflow run nf-core/taxprofiler -profile test,<docker/singularity> --outdir <OUTDIR>
|
||||
|
||||
----------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
params {
|
||||
config_profile_name = 'Test profile'
|
||||
config_profile_description = 'Minimal test dataset without performing any profiling to check pipeline function'
|
||||
|
||||
// Limit resources so that this can run on GitHub Actions
|
||||
max_cpus = 2
|
||||
max_memory = '6.GB'
|
||||
max_time = '6.h'
|
||||
|
||||
// Input data
|
||||
// TODO nf-core: Specify the paths to your test data on nf-core/test-datasets
|
||||
// TODO nf-core: Give any required params for the test so that command line flags are not needed
|
||||
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/samplesheet.csv'
|
||||
databases = 'https://raw.githubusercontent.com/nf-core/test-datasets/taxprofiler/database.csv'
|
||||
perform_shortread_clipmerge = true
|
||||
perform_longread_clip = true
|
||||
perform_shortread_complexityfilter = true
|
||||
perform_shortread_hostremoval = true
|
||||
perform_longread_hostremoval = true
|
||||
perform_runmerging = true
|
||||
hostremoval_reference = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta'
|
||||
run_kaiju = false
|
||||
run_kraken2 = false
|
||||
run_malt = false
|
||||
run_metaphlan3 = false
|
||||
run_centrifuge = false
|
||||
run_diamond = false
|
||||
}
|
||||
|
||||
process {
|
||||
withName: MALT_RUN {
|
||||
maxForks = 1
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
process MINIMAP2_ALIGN {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
|
||||
conda (params.enable_conda ? 'bioconda::minimap2=2.21 bioconda::samtools=1.12' : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0' :
|
||||
'quay.io/biocontainers/mulled-v2-66534bcbb7031a148b13e2ad42583020b9cd25c4:1679e915ddb9d6b4abda91880c4b48857d471bd8-0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(reads)
|
||||
path reference
|
||||
val bam_format
|
||||
val cigar_paf_format
|
||||
val cigar_bam
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.paf"), optional: true, emit: paf
|
||||
tuple val(meta), path("*.bam"), optional: true, emit: bam
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def input_reads = meta.single_end ? "$reads" : "${reads[0]} ${reads[1]}"
|
||||
def bam_output = bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf"
|
||||
def cigar_paf = cigar_paf_format && !bam_format ? "-c" : ''
|
||||
def set_cigar_bam = cigar_bam && bam_format ? "-L" : ''
|
||||
"""
|
||||
minimap2 \\
|
||||
$args \\
|
||||
-t $task.cpus \\
|
||||
$reference \\
|
||||
$input_reads \\
|
||||
$cigar_paf \\
|
||||
$set_cigar_bam \\
|
||||
$bam_output
|
||||
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
minimap2: \$(minimap2 --version 2>&1)
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
name: minimap2_align
|
||||
description: A versatile pairwise aligner for genomic and spliced nucleotide sequences
|
||||
keywords:
|
||||
- align
|
||||
- fasta
|
||||
- fastq
|
||||
- genome
|
||||
- paf
|
||||
- reference
|
||||
tools:
|
||||
- minimap2:
|
||||
description: |
|
||||
A versatile pairwise aligner for genomic and spliced nucleotide sequences.
|
||||
homepage: https://github.com/lh3/minimap2
|
||||
documentation: https://github.com/lh3/minimap2#uguide
|
||||
licence: ["MIT"]
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- reads:
|
||||
type: file
|
||||
description: |
|
||||
List of input FASTA or FASTQ files of size 1 and 2 for single-end
|
||||
and paired-end data, respectively.
|
||||
- reference:
|
||||
type: file
|
||||
description: |
|
||||
Reference database in FASTA format.
|
||||
- bam_format:
|
||||
type: boolean
|
||||
description: Specify that output should be in BAM format
|
||||
- cigar_paf_format:
|
||||
type: boolean
|
||||
description: Specify that output CIGAR should be in PAF format
|
||||
- cigar_bam:
|
||||
type: boolean
|
||||
description: |
|
||||
Write CIGAR with >65535 ops at the CG tag. This is recommended when
|
||||
doing XYZ (https://github.com/lh3/minimap2#working-with-65535-cigar-operations)
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- paf:
|
||||
type: file
|
||||
description: Alignment in PAF format
|
||||
pattern: "*.paf"
|
||||
- bam:
|
||||
type: file
|
||||
description: Alignment in BAM format
|
||||
pattern: "*.bam"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
authors:
|
||||
- "@heuermh"
|
||||
- "@sofstam"
|
||||
- "@sateeshperi"
|
||||
- "@jfy133"
|
@ -0,0 +1,33 @@
|
||||
process MINIMAP2_INDEX {
|
||||
label 'process_medium'
|
||||
|
||||
conda (params.enable_conda ? 'bioconda::minimap2=2.21' : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/minimap2:2.21--h5bf99c6_0' :
|
||||
'quay.io/biocontainers/minimap2:2.21--h5bf99c6_0' }"
|
||||
|
||||
input:
|
||||
path fasta
|
||||
|
||||
output:
|
||||
path "*.mmi" , emit: index
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
"""
|
||||
minimap2 \\
|
||||
-t $task.cpus \\
|
||||
-d ${fasta.baseName}.mmi \\
|
||||
$args \\
|
||||
$fasta
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
minimap2: \$(minimap2 --version 2>&1)
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
name: minimap2_index
|
||||
description: Provides fasta index required by minimap2 alignment.
|
||||
keywords:
|
||||
- index
|
||||
- fasta
|
||||
- reference
|
||||
tools:
|
||||
- minimap2:
|
||||
description: |
|
||||
A versatile pairwise aligner for genomic and spliced nucleotide sequences.
|
||||
homepage: https://github.com/lh3/minimap2
|
||||
documentation: https://github.com/lh3/minimap2#uguide
|
||||
licence: ["MIT"]
|
||||
input:
|
||||
- fasta:
|
||||
type: file
|
||||
description: |
|
||||
Reference database in FASTA format.
|
||||
output:
|
||||
- mmi:
|
||||
type: file
|
||||
description: Minimap2 fasta index.
|
||||
pattern: "*.mmi"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
authors:
|
||||
- "@yuukiiwa"
|
||||
- "@drpatelh"
|
@ -0,0 +1,56 @@
|
||||
process SAMTOOLS_BAM2FQ {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' :
|
||||
'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(inputbam)
|
||||
val split
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.fq.gz"), emit: reads
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
|
||||
if (split){
|
||||
"""
|
||||
samtools \\
|
||||
bam2fq \\
|
||||
$args \\
|
||||
-@ $task.cpus \\
|
||||
-1 ${prefix}_1.fq.gz \\
|
||||
-2 ${prefix}_2.fq.gz \\
|
||||
-0 ${prefix}_other.fq.gz \\
|
||||
-s ${prefix}_singleton.fq.gz \\
|
||||
$inputbam
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
} else {
|
||||
"""
|
||||
samtools \\
|
||||
bam2fq \\
|
||||
$args \\
|
||||
-@ $task.cpus \\
|
||||
$inputbam | gzip --no-name > ${prefix}_interleaved.fq.gz
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
name: samtools_bam2fq
|
||||
description: |
|
||||
The module uses bam2fq method from samtools to
|
||||
convert a SAM, BAM or CRAM file to FASTQ format
|
||||
keywords:
|
||||
- bam2fq
|
||||
- samtools
|
||||
- fastq
|
||||
tools:
|
||||
- samtools:
|
||||
description: Tools for dealing with SAM, BAM and CRAM files
|
||||
homepage: None
|
||||
documentation: http://www.htslib.org/doc/1.1/samtools.html
|
||||
tool_dev_url: None
|
||||
doi: ""
|
||||
licence: ["MIT"]
|
||||
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- inputbam:
|
||||
type: file
|
||||
description: BAM/CRAM/SAM file
|
||||
pattern: "*.{bam,cram,sam}"
|
||||
- split:
|
||||
type: boolean
|
||||
description: |
|
||||
TRUE/FALSE value to indicate if reads should be separated into
|
||||
/1, /2 and if present other, or singleton.
|
||||
Note: choosing TRUE will generate 4 different files.
|
||||
Choosing FALSE will produce a single file, which will be interleaved in case
|
||||
the input contains paired reads.
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
- reads:
|
||||
type: file
|
||||
description: |
|
||||
FASTQ files, which will be either a group of 4 files (read_1, read_2, other and singleton)
|
||||
or a single interleaved .fq.gz file if the user chooses not to split the reads.
|
||||
pattern: "*.fq.gz"
|
||||
|
||||
authors:
|
||||
- "@lescai"
|
@ -0,0 +1,56 @@
|
||||
process SAMTOOLS_VIEW {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/samtools:1.15.1--h1170115_0' :
|
||||
'quay.io/biocontainers/samtools:1.15.1--h1170115_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(input), path(index)
|
||||
path fasta
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.bam") , emit: bam , optional: true
|
||||
tuple val(meta), path("*.cram"), emit: cram, optional: true
|
||||
path "versions.yml" , emit: versions
|
||||
|
||||
when:
|
||||
task.ext.when == null || task.ext.when
|
||||
|
||||
script:
|
||||
def args = task.ext.args ?: ''
|
||||
def args2 = task.ext.args2 ?: ''
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
def reference = fasta ? "--reference ${fasta} -C" : ""
|
||||
def file_type = input.getExtension()
|
||||
if ("$input" == "${prefix}.${file_type}") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
|
||||
"""
|
||||
samtools \\
|
||||
view \\
|
||||
--threads ${task.cpus-1} \\
|
||||
${reference} \\
|
||||
$args \\
|
||||
$input \\
|
||||
$args2 \\
|
||||
> ${prefix}.${file_type}
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
|
||||
stub:
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
"""
|
||||
touch ${prefix}.bam
|
||||
touch ${prefix}.cram
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
name: samtools_view
|
||||
description: filter/convert SAM/BAM/CRAM file
|
||||
keywords:
|
||||
- view
|
||||
- bam
|
||||
- sam
|
||||
- cram
|
||||
tools:
|
||||
- samtools:
|
||||
description: |
|
||||
SAMtools is a set of utilities for interacting with and post-processing
|
||||
short DNA sequence read alignments in the SAM, BAM and CRAM formats, written by Heng Li.
|
||||
These files are generated as output by short read aligners like BWA.
|
||||
homepage: http://www.htslib.org/
|
||||
documentation: hhttp://www.htslib.org/doc/samtools.html
|
||||
doi: 10.1093/bioinformatics/btp352
|
||||
licence: ["MIT"]
|
||||
input:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- input:
|
||||
type: file
|
||||
description: BAM/CRAM/SAM file
|
||||
pattern: "*.{bam,cram,sam}"
|
||||
- index:
|
||||
type: optional file
|
||||
description: BAM.BAI/CRAM.CRAI file
|
||||
pattern: "*.{.bai,.crai}"
|
||||
- fasta:
|
||||
type: optional file
|
||||
description: Reference file the CRAM was created with
|
||||
pattern: "*.{fasta,fa}"
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
- bam:
|
||||
type: file
|
||||
description: filtered/converted BAM/SAM file
|
||||
pattern: "*.{bam,sam}"
|
||||
- cram:
|
||||
type: file
|
||||
description: filtered/converted CRAM file
|
||||
pattern: "*.cram"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
authors:
|
||||
- "@drpatelh"
|
||||
- "@joseespinosa"
|
||||
- "@FriederikeHanssen"
|
@ -0,0 +1,47 @@
|
||||
//
|
||||
// Remove host reads via alignment and export off-target reads
|
||||
//
|
||||
|
||||
include { MINIMAP2_INDEX } from '../../modules/nf-core/modules/minimap2/index/main'
|
||||
include { MINIMAP2_ALIGN } from '../../modules/nf-core/modules/minimap2/align/main'
|
||||
include { SAMTOOLS_VIEW } from '../../modules/nf-core/modules/samtools/view/main'
|
||||
include { SAMTOOLS_BAM2FQ } from '../../modules/nf-core/modules/samtools/bam2fq/main'
|
||||
|
||||
workflow LONGREAD_HOSTREMOVAL {
|
||||
take:
|
||||
reads // [ [ meta ], [ reads ] ]
|
||||
reference // /path/to/fasta
|
||||
index // /path/to/index
|
||||
|
||||
main:
|
||||
ch_versions = Channel.empty()
|
||||
ch_multiqc_files = Channel.empty()
|
||||
|
||||
if ( !params.longread_hostremoval_index ) {
|
||||
ch_minimap2_index = MINIMAP2_INDEX ( reference ).index
|
||||
ch_versions = ch_versions.mix( MINIMAP2_INDEX.out.versions )
|
||||
} else {
|
||||
ch_minimap2_index = index
|
||||
}
|
||||
|
||||
MINIMAP2_ALIGN ( reads, ch_minimap2_index, true, false, false )
|
||||
ch_versions = ch_versions.mix( MINIMAP2_ALIGN.out.versions.first() )
|
||||
ch_minimap2_mapped = MINIMAP2_ALIGN.out.bam
|
||||
.map {
|
||||
meta, reads ->
|
||||
[ meta, reads, [] ]
|
||||
}
|
||||
|
||||
|
||||
SAMTOOLS_VIEW ( ch_minimap2_mapped , [] )
|
||||
ch_versions = ch_versions.mix( SAMTOOLS_VIEW.out.versions.first() )
|
||||
|
||||
SAMTOOLS_BAM2FQ ( SAMTOOLS_VIEW.out.bam, false )
|
||||
ch_versions = ch_versions.mix( SAMTOOLS_BAM2FQ.out.versions.first() )
|
||||
|
||||
|
||||
emit:
|
||||
reads = SAMTOOLS_BAM2FQ.out.reads // channel: [ val(meta), [ reads ] ]
|
||||
versions = ch_versions // channel: [ versions.yml ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue