Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add agat convert mfannot2gff #112

Merged
merged 17 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* `agat`:
- `agat_convert_sp_gff2gtf`: convert any GTF/GFF file into a proper GTF file (PR #76).
- `/agat_convert_bed2gff`: convert bed file to gff format (PR #97).
- `agat_convert_mfannot2gff`: convert MFannot "masterfile" annotation to gff format (PR #112).

* `bedtools`:
- `bedtools/bedtools_intersect`: Allows one to screen for overlaps between two sets of genomic features (PR #94).
Expand Down
64 changes: 64 additions & 0 deletions src/agat/agat_convert_mfannot2gff/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: agat_convert_mfannot2gff
namespace: agat
description: |
Conversion utility for MFannot "masterfile" annotation produced by the
[MFannot pipeline](http://megasun.bch.umontreal.ca/RNAweasel/). Reports
GFF3 format.
keywords: [gene annotations, GFF conversion]
Leila011 marked this conversation as resolved.
Show resolved Hide resolved
links:
homepage: https://github.com/NBISweden/AGAT
documentation: https://agat.readthedocs.io/en/latest/tools/agat_convert_mfannot2gff.html
issue_tracker: https://github.com/NBISweden/AGAT/issues
repository: https://github.com/NBISweden/AGAT
references:
doi: 10.5281/zenodo.3552717
Leila011 marked this conversation as resolved.
Show resolved Hide resolved
license: GPL-3.0
authors:
- __merge__: /src/_authors/leila_paquay.yaml
roles: [ author, maintainer ]
argument_groups:
- name: Inputs
arguments:
- name: --mfannot
alternatives: [-m, -i]
description: The mfannot input file.
type: file
required: true
direction: input
example: input.mfannot
- name: Outputs
arguments:
- name: --gff
alternatives: [-g, -o]
description: The GFF output file.
type: file
direction: output
required: true
example: output.gff
- name: Arguments
arguments:
- name: --config
alternatives: [-c]
description: |
Input AGAT config file. By default, AGAT takes as input agat_config.yaml file from the working directory if any, otherwise it takes the original agat_config.yaml shipped with AGAT. To get the agat_config.yaml locally type: `agat config --expose`. The `--config` option gives you the possibility to use your own AGAT config file (located elsewhere or named differently).
Leila011 marked this conversation as resolved.
Show resolved Hide resolved
type: file
required: false
example: custom_agat_config.yaml
resources:
- type: bash_script
path: script.sh
test_resources:
- type: bash_script
path: test.sh
- type: file
path: test_data
engines:
- type: docker
image: quay.io/biocontainers/agat:1.4.0--pl5321hdfd78af_0
setup:
- type: docker
run: |
agat --version | sed 's/AGAT\s\(.*\)/agat: "\1"/' > /var/software_versions.txt
runners:
- type: executable
- type: nextflow
67 changes: 67 additions & 0 deletions src/agat/agat_convert_mfannot2gff/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
```sh
agat_convert_mfannot2gff.pl --help
```

------------------------------------------------------------------------------
| Another GFF Analysis Toolkit (AGAT) - Version: v1.4.0 |
| https://github.com/NBISweden/AGAT |
| National Bioinformatics Infrastructure Sweden (NBIS) - www.nbis.se |
------------------------------------------------------------------------------


Name:
agat_convert_mfannot2gff.pl

Description:
Conversion utility for MFannot "masterfile" annotation produced by the
MFannot pipeline (http://megasun.bch.umontreal.ca/RNAweasel/). Reports
GFF3 format.

Usage:
agat_convert_mfannot2gff.pl -m <mfannot> -o <gff>
agat_convert_mfannot2gff.pl --help

Copyright and License:
Copyright (C) 2015, Brandon Seah ([email protected]) ... GPL-3 ...
modified by jacques dainat 2017-11

Options:
-m or -i or --mfannot
The mfannot input file

-g or -o or --gff
the gff output file

-c or --config
String - Input agat config file. By default AGAT takes as input
agat_config.yaml file from the working directory if any,
otherwise it takes the orignal agat_config.yaml shipped with
AGAT. To get the agat_config.yaml locally type: "agat config
--expose". The --config option gives you the possibility to use
your own AGAT config file (located elsewhere or named
differently).

-h or --help
Display this helpful text.

Feedback:
Did you find a bug?:
Do not hesitate to report bugs to help us keep track of the bugs and
their resolution. Please use the GitHub issue tracking system available
at this address:

https://github.com/NBISweden/AGAT/issues

Ensure that the bug was not already reported by searching under Issues.
If you're unable to find an (open) issue addressing the problem, open a new one.
Try as much as possible to include in the issue when relevant:
- a clear description,
- as much relevant information as possible,
- the command used,
- a data sample,
- an explanation of the expected behaviour that is not occurring.

Do you want to contribute?:
You are very welcome, visit this address for the Contributing
guidelines:
https://github.com/NBISweden/AGAT/blob/master/CONTRIBUTING.md
9 changes: 9 additions & 0 deletions src/agat/agat_convert_mfannot2gff/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

## VIASH START
## VIASH END

rcannood marked this conversation as resolved.
Show resolved Hide resolved
agat_convert_mfannot2gff.pl \
--mfannot "$par_mfannot" \
--gff "$par_gff" \
${par_config:+--config "${par_config}"}
27 changes: 27 additions & 0 deletions src/agat/agat_convert_mfannot2gff/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

## VIASH START
## VIASH END

test_dir="${meta_resources_dir}/test_data"
out_dir="${meta_resources_dir}/out_data"
Leila011 marked this conversation as resolved.
Show resolved Hide resolved

echo "> Run $meta_name with test data"
"$meta_executable" \
--mfannot "$test_dir/test.mfannot" \
--gff "$out_dir/output.gff"

echo ">> Checking output"
[ ! -f "$out_dir/output.gff" ] && echo "Output file output.gff does not exist" && exit 1

echo ">> Check if output is empty"
[ ! -s "$out_dir/output.gff" ] && echo "Output file output.gff is empty" && exit 1

echo ">> Check if output matches expected output"
diff "$out_dir/output.gff" "$test_dir/agat_convert_mfannot2gff_1.gff"
if [ $? -ne 0 ]; then
echo "Output file output.gff does not match expected output"
exit 1
fi

echo "> Test successful"
Loading