-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding back my work * adding more tests - fixing bug - more tests * Final test added * Update CHANGELOG.md * minor change - license name - help file * small changes on config * small changes * adding more links * Update script.sh * Adding $TMPDIR to test.sh --------- Co-authored-by: Emma Rousseau <[email protected]> Co-authored-by: Robrecht Cannoodt <[email protected]>
- Loading branch information
1 parent
11118fb
commit f96bd72
Showing
7 changed files
with
390 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: bedtools_bamtobed | ||
namespace: bedtools | ||
description: Converts BAM alignments to BED6 or BEDPE format. | ||
keywords: [Converts, BAM, BED, BED6, BEDPE] | ||
links: | ||
documentation: https://bedtools.readthedocs.io/en/latest/content/tools/bamtobed.html | ||
repository: https://github.com/arq5x/bedtools2 | ||
homepage: https://bedtools.readthedocs.io/en/latest/# | ||
issue_tracker: https://github.com/arq5x/bedtools2/issues | ||
references: | ||
doi: 10.1093/bioinformatics/btq033 | ||
license: MIT | ||
requirements: | ||
commands: [bedtools] | ||
authors: | ||
- __merge__: /src/_authors/theodoro_gasperin.yaml | ||
roles: [ author, maintainer ] | ||
|
||
argument_groups: | ||
- name: Inputs | ||
arguments: | ||
- name: --input | ||
alternatives: -i | ||
type: file | ||
description: Input BAM file. | ||
required: true | ||
|
||
- name: Outputs | ||
arguments: | ||
- name: --output | ||
alternatives: -o | ||
required: true | ||
type: file | ||
direction: output | ||
description: Output BED file. | ||
|
||
- name: Options | ||
arguments: | ||
- name: --bedpe | ||
type: boolean_true | ||
description: | | ||
Write BEDPE format. Requires BAM to be grouped or sorted by query. | ||
- name: --mate1 | ||
type: boolean_true | ||
description: | | ||
When writing BEDPE (-bedpe) format, always report mate one as the first BEDPE "block". | ||
- name: --bed12 | ||
type: boolean_true | ||
description: | | ||
Write "blocked" BED format (aka "BED12"). Forces -split. | ||
See http://genome-test.cse.ucsc.edu/FAQ/FAQformat#format1 | ||
- name: --split | ||
type: boolean_true | ||
description: | | ||
Report "split" BAM alignments as separate BED entries. | ||
Splits only on N CIGAR operations. | ||
- name: --splitD | ||
type: boolean_true | ||
description: | | ||
Split alignments based on N and D CIGAR operators. | ||
Forces -split. | ||
- name: --edit_distance | ||
alternatives: -ed | ||
type: boolean_true | ||
description: | | ||
Use BAM edit distance (NM tag) for BED score. | ||
- Default for BED is to use mapping quality. | ||
- Default for BEDPE is to use the minimum of | ||
the two mapping qualities for the pair. | ||
- When -ed is used with -bedpe, the total edit | ||
distance from the two mates is reported. | ||
- name: --tag | ||
type: string | ||
description: | | ||
Use other NUMERIC BAM alignment tag for BED score. | ||
Default for BED is to use mapping quality. Disallowed with BEDPE output. | ||
example: "SM" | ||
|
||
- name: --color | ||
type: string | ||
description: | | ||
An R,G,B string for the color used with BED12 format. | ||
Default is (255,0,0). | ||
example: "250,250,250" | ||
|
||
- name: --cigar | ||
type: boolean_true | ||
description: | | ||
Add the CIGAR string to the BED entry as a 7th column. | ||
resources: | ||
- type: bash_script | ||
path: script.sh | ||
|
||
test_resources: | ||
- type: bash_script | ||
path: test.sh | ||
- path: test_data | ||
|
||
engines: | ||
- type: docker | ||
image: debian:stable-slim | ||
setup: | ||
- type: apt | ||
packages: [bedtools, procps] | ||
- type: docker | ||
run: | | ||
echo "bedtools: \"$(bedtools --version | sed -n 's/^bedtools //p')\"" > /var/software_versions.txt | ||
runners: | ||
- type: executable | ||
- type: nextflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
```bash | ||
bedtools bamtobed | ||
``` | ||
|
||
Tool: bedtools bamtobed (aka bamToBed) | ||
Version: v2.30.0 | ||
Summary: Converts BAM alignments to BED6 or BEDPE format. | ||
|
||
Usage: bedtools bamtobed [OPTIONS] -i <bam> | ||
|
||
Options: | ||
-bedpe Write BEDPE format. | ||
- Requires BAM to be grouped or sorted by query. | ||
|
||
-mate1 When writing BEDPE (-bedpe) format, | ||
always report mate one as the first BEDPE "block". | ||
|
||
-bed12 Write "blocked" BED format (aka "BED12"). Forces -split. | ||
|
||
http://genome-test.cse.ucsc.edu/FAQ/FAQformat#format1 | ||
|
||
-split Report "split" BAM alignments as separate BED entries. | ||
Splits only on N CIGAR operations. | ||
|
||
-splitD Split alignments based on N and D CIGAR operators. | ||
Forces -split. | ||
|
||
-ed Use BAM edit distance (NM tag) for BED score. | ||
- Default for BED is to use mapping quality. | ||
- Default for BEDPE is to use the minimum of | ||
the two mapping qualities for the pair. | ||
- When -ed is used with -bedpe, the total edit | ||
distance from the two mates is reported. | ||
|
||
-tag Use other NUMERIC BAM alignment tag for BED score. | ||
- Default for BED is to use mapping quality. | ||
Disallowed with BEDPE output. | ||
|
||
-color An R,G,B string for the color used with BED12 format. | ||
Default is (255,0,0). | ||
|
||
-cigar Add the CIGAR string to the BED entry as a 7th column. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
## VIASH START | ||
## VIASH END | ||
|
||
set -eo pipefail | ||
|
||
# Unset parameters | ||
unset_if_false=( | ||
par_bedpe | ||
par_mate1 | ||
par_bed12 | ||
par_split | ||
par_splitD | ||
par_edit_distance | ||
par_tag | ||
par_color | ||
par_cigar | ||
) | ||
|
||
for par in ${unset_if_false[@]}; do | ||
test_val="${!par}" | ||
[[ "$test_val" == "false" ]] && unset $par | ||
done | ||
|
||
# Execute bedtools sort with the provided arguments | ||
bedtools bamtobed \ | ||
${par_bedpe:+-bedpe} \ | ||
${par_mate1:+-mate1} \ | ||
${par_bed12:+-bed12} \ | ||
${par_split:+-split} \ | ||
${par_splitD:+-splitD} \ | ||
${par_edit_distance:+-ed} \ | ||
${par_tag:+-tag "$par_tag"} \ | ||
${par_cigar:+-cigar} \ | ||
${par_color:+-color "$par_color"} \ | ||
-i "$par_input" \ | ||
> "$par_output" | ||
|
Oops, something went wrong.