Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
EdoardoGiussani committed Jun 25, 2024
2 parents b4a575a + 89f29e6 commit 2f26c65
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 23 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/create_new_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Create release

on:
push:
tags:
- "v.*"

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install FluMut
run: |
python -m pip install --upgrade pip
pip install .
- name: Run FluMut
run: |
cp examples/multiple_samples.fa examples/fasta_input_example.fa
flumut -x examples/excel_output_example.xlsm examples/multiple_samples.fa
- name: Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
examples/excel_output_example.xlsm
examples/fasta_input_example.fa
58 changes: 58 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- uses: actions/upload-artifact@v4
with:
name: dist_folder
path: dist

pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist_folder
path: dist
# retrieve your distributions here
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
13 changes: 12 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "FluMut",
"type": "debugpy",
"request": "launch",
"module": "FluMut.FluMut",
"module": "flumut.flumut",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
Expand All @@ -24,6 +24,17 @@
"(?P<sample>.+)_(?P<segment>.+)",
"examples/multiple_samples.fa"
]
},
{
"name": "FluMutUpdate",
"type": "debugpy",
"request": "launch",
"module": "flumut.flumut",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"--update"
]
}
]
}
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

FluMut is an open-source tool designed to search for molecular markers with potential impact on the biological characteristics of Influenza A viruses of the A(H5N1) subtype, starting from complete or partial nucleotide genome sequences.

For the complete documentation please visit [FluMut site](TODO).
For the complete documentation please visit [FluMut site](https://izsvenezie-virology.github.io/FluMut/).

## Installation

### Prerequisites
FluMut is available for Windows, Linux and macOS.


#### Pip
FluMut is available on [PyPI](https://pypi.org/flumut).
Before installing FluMut via Pip you need:
Expand Down Expand Up @@ -39,7 +38,7 @@ You can get the output file in an [Excel format](#excel) (user-friendly) running
```
flumut -x excel_output.xlsm your_fasta.fa
```
If you prefer the [text outputs](TODO) (machine-readable format) run:
If you prefer the [text outputs](#text-outputs) (machine-readable format) run:
```
flumut -m markers_output.tsv -M mutations_output.tsv -l literature_output.tsv your_fasta.fa
```
Expand All @@ -59,20 +58,20 @@ Sequences must adhere to the [IUPAC code](https://www.bioinformatics.org/sms/iup
FluMut relies on the FASTA header to assign the sequence to a specific segment and sample.
For this reason, the header must contain both a sample ID (consistent among sequences of the same sample) and one of the the following segment names: `PB2`, `PB1`, `PA`, `HA`, `NP`, `NA`, `MP`, `NS`.

An example of input file can be downloaded [here](TODO).
An example of input file can be downloaded [here](https://github.com/izsvenezie-virology/FluMut/releases/latest/download/fasta_input_example.fa).

## Outputs
FluMut can produce an Excel output or text outputs:
- [Excel](#excel)
- [Text outputs](TODO)
- [Text outputs](#text-outputs)

By default FluMut reports only markers where all mutations are found.
You can report all markers where at least one mutation is found using option `-r`/`--relaxed`.

### Excel
This is the most user-friendly and complete output.
You can obtain this output using the `-x`/`--excel-output` option.
Find out more [here](TODO).
Find out more [here](https://izsvenezie-virology.github.io/FluMut/docs/output#excel-output).

>**_IMPORTANT:_** To enable the navigation feature the exstension of the Excel file must be `.xlsm`.
>If you don't care about navigation, you can use `.xlsx` exstension.
Expand All @@ -82,9 +81,9 @@ Find out more [here](TODO).
You can obtain 3 different text outputs:
| Option | Output | Desctription |
| -- | -- | -- |
| `-m`/`--markers-output` | [Markers output](TODO) | List of detected markers |
| `-M`/`--mutations-output` | [Mutations output](TODO) | List of amino acids present in the positions of mutations of interest for each sample |
| `-l`/`--literature-output` | [Literature output](TODO) | List of all papers present in the database |
| `-m`/`--markers-output` | [Markers output](https://izsvenezie-virology.github.io/FluMut/docs/output#markers-output) | List of detected markers |
| `-M`/`--mutations-output` | [Mutations output](https://izsvenezie-virology.github.io/FluMut/docs/output#mutations-output) | List of amino acids present in the positions of mutations of interest for each sample |
| `-l`/`--literature-output` | [Literature output](https://izsvenezie-virology.github.io/FluMut/docs/output#literature-output) | List of all papers present in the database |

## Cite FluMut
We are currently writing the paper.
Expand All @@ -100,3 +99,6 @@ FluMut is licensed under the GNU Affero v3 license (see [LICENSE](LICENSE)).
This work was supported by FLU-SWITCH Era-Net ICRAD (grant agreement No 862605) and by the NextGeneration EU-MUR PNRR Extended Partnership initiative on Emerging Infectious Diseases (Project no. PE00000007, INF-ACT)

![](docs/images/Logo-Flu-Switch.png) ![](docs/images/Logo-Inf-act.jpg) ![](docs/images/Logo-eu.png)

>Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Health and Digital Executive Agency (HEDEA).
>Neither the European Union nor the granting authority can be held responsible for them
5 changes: 5 additions & 0 deletions docs/docs/aknowledgements.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ permalink: docs/aknowledgements

We are currently writing the paper.
Until the publication please cite the GitHub repository:

[https://github.com/izsvenezie-virology/FluMut](https://github.com/izsvenezie-virology/FluMut)

# Fundings

This work was supported by FLU-SWITCH Era-Net ICRAD (grant agreement No 862605) and by the NextGeneration EU-MUR PNRR Extended Partnership initiative on Emerging Infectious Diseases (Project no. PE00000007, INF-ACT)

| ![](../images/Logo-Flu-Switch.png) | ![](../images/Logo-Inf-act.jpg) | ![](../images/Logo-eu.png) |

{: .note-title}
Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Health and Digital Executive Agency (HEDEA).
Neither the European Union nor the granting authority can be held responsible for them.
4 changes: 2 additions & 2 deletions docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permalink: docs/installation
FluMut is a CLI tool, if you prefer a graphical interface see [FluMut-GUI](#flumut-gui) installation

## Pip
FluMut is available on [PyPI](https://pypi.org/flumutTODO).
FluMut is available on [PyPI](https://pypi.org/flumut).
Before installing FluMut via Pip you need:
- [Python](https://www.python.org/downloads/)
- [Pip](https://pypi.org/project/pip/) (often packed with Python)
Expand All @@ -23,7 +23,7 @@ pip install flumut
When installing via Pip it's strongly recommended to install it in a [virtual environment](https://docs.python.org/3/library/venv.html).

## Bioconda
FluMut is also available on [Bioconda](https://bioconda.github.io/TODO).
FluMut is also available on [Bioconda](https://bioconda.github.io/recipes/flumut/README.html).
You can install using Conda or Mamba.
- [Mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) (recommended)
```
Expand Down
2 changes: 2 additions & 0 deletions docs/docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ permalink: docs/output
# Excel output
This is the most user-friendly and complete output.
You can obtain this output using the [`--excel-output` option](usage/usage-cli#options).
You can download the example file [here](https://github.com/izsvenezie-virology/FluMut/releases/latest/download/excel_output_example.xlsx).

It contains 5 sheets:
- [Markers per sample](#markers-per-sample-sheet)
- [Samples per marker](#samples-per-marker)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/usage/input_file_specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permalink: docs/usage/input-file
# Input File
FluMut can analyze multiple A(H5N1) Influenza virus sequences simultaneously.
It can handle partial and complete genome sequences of multiple samples.
You must provide a single file containing all the nucleotide sequences in FASTA format (an example can be downloaded [here](TODO)).
You must provide a single file containing all the nucleotide sequences in FASTA format (an example can be downloaded [here](https://github.com/izsvenezie-virology/FluMut/releases/latest/download/fasta_input_example.fa)).
Sequences must adhere to the [IUPAC code](https://www.bioinformatics.org/sms/iupac.html).
FluMut relies on the FASTA header to assign the sequence to a specific segment and sample.
For this reason, the header must contain both a sample ID (consistent among sequences of the same sample) and one of the the following segment names: `PB2`, `PB1`, `PA`, `HA`, `NP`, `NA`, `MP`, `NS`.
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = flumut
version = attr: FluMut.FluMut.__version__
version = attr: flumut.flumut.__version__
author = Edoardo Giussani
author_email = [email protected]
description = A tool to easly find mutations of interest in influenza viruses.
Expand All @@ -27,7 +27,7 @@ install_requires =
importlib-resources >= 1.3
entry_points=
[console_scripts]
flumut = FluMut.FluMut:main
flumut = flumut.flumut:main

[options.packages.find]
where = src
Expand Down
8 changes: 4 additions & 4 deletions src/FluMut/FluMut.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
from importlib_resources import files
from Bio.Align import PairwiseAligner

from FluMut.DbReader import close_connection, execute_query, open_connection, to_dict, update_db
from FluMut import OutputFormatter
from FluMut.DataClass import Mutation, Sample
from flumut.DbReader import close_connection, execute_query, open_connection, to_dict, update_db
from flumut import OutputFormatter
from flumut.DataClass import Mutation, Sample

PRINT_ALIGNMENT = False
SKIP_UNMATCH_NAMES_OPT = '--skip-unmatch-names'
SKIP_UNKNOWN_SEGMENTS_OPT = '--skip-unknown-segments'
DB_FILE = files('FluMutData').joinpath('flumut_db.sqlite')
__version__ = '0.5.2'
__version__ = '0.5.3'
__author__ = 'Edoardo Giussani'
__contact__ = '[email protected]'

Expand Down
2 changes: 1 addition & 1 deletion src/FluMut/OutputFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from openpyxl.worksheet.table import Table, TableStyleInfo
from openpyxl.utils.cell import get_column_letter

from FluMut.DataClass import Mutation, Sample
from flumut.DataClass import Mutation, Sample


def mutations_dict(mutations: List[Mutation]) -> Tuple[List[str], List[Dict[str, str]]]:
Expand Down
Empty file added src/FluMut/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion tests/test_name_parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import FluMut.FluMut as fm
import flumut.flumut as fm
import re


Expand Down
2 changes: 1 addition & 1 deletion tests/test_position.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import FluMut.FluMut as fm
import flumut.flumut as fm


class TestPosition(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_translation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import FluMut.FluMut as fm
import flumut.flumut as fm


class TestTranslate(unittest.TestCase):
Expand Down

0 comments on commit 2f26c65

Please sign in to comment.