Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
v0.0.1-dev-4 (#13)
Browse files Browse the repository at this point in the history
* Added community files.

* Minor README change

* License in pre block

* Updated classifiers.

* Added black formatting step (#12)

* Renamed fastx_barber for consistency and switched to poetry.

* Minor edit.

* Switching from pip to poetry in github actions

* Added missing step arguments.

* Added pip steps and split flake8 install and run

* Switched to different poetry action.

* Merged pip upgrade and flake8 install steps.
  • Loading branch information
ggirelli authored Aug 1, 2020
1 parent 82a20b0 commit 4357029
Show file tree
Hide file tree
Showing 22 changed files with 166 additions and 99 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
pull_request:
branches:
- master
- dev
release:
types:
- created

jobs:
build:
Expand All @@ -22,8 +18,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
Expand All @@ -35,18 +30,22 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
- name: Upgrade pip and install flake8
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install flake8
- uses: dschep/[email protected]
- name: Install package with poetry
run: poetry install
- uses: lgeiger/[email protected]
with:
args: ". --check"
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=5 --max-line-length=88 --ignore=E203 --statistics
- name: Check with Mypy
uses: jpetrucciani/[email protected]
- uses: jpetrucciani/[email protected]
with:
path: '.'
45 changes: 45 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# fastx-barber Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior brought to their.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][contributor_covenant_homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[contributor_covenant_homepage]: https://www.contributor-covenant.org
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Introduction

Hi there, and thank you for considering contributing to `fastx-barber` to help us make our code a better version of itself!

`fastx-barber` is an open source project, and as such any kind of contribution is welcome! There are many ways in which you can contribute: improve the code or the documentation, submit bug reports, request new features or write tutorials or blog posts.

# Ground Rules

To see what kinds of behavior are acceptable when contributing to `fastx-barber`, please refer to our [code of conduct](https://github.com/ggirelli/fastx-barber/blob/master/CODE_OF_CONDUCT.md).

# Getting started

We host `fastx-barber` on GitHub, where we also track issues and feature requests, as well as handle pull requests.

Please, note that any contributions you make will be under the MIT Software License. In other words, all your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the `fastx-barber` project. Feel free to contact us if that's a concern.

## How to submit a contribution

To process code change, we follow the [Github Flow](https://guides.github.com/introduction/flow/index.html). All code changes to our `master` branch happen through pull requests from the `dev` branch. We actively welcome your pull requests to the `dev` branch!

## How to report a bug

If you want to report a **bug**, please use the github [issue tracker](https://github.com/ggirelli/fastx-barber/issues) and follow the issue template that should automatically show up.

## How to suggest a feature or enhancement

If you would like to see a new feature implemented in `fastx-barber`, or to have an already existing feature improved, please use the github [issue tracker](https://github.com/ggirelli/fastx-barber/issues) and follow the template that should automatically show up.

# Style your contributions

We like to have `fastx-barber` code styled with [`black`](https://github.com/psf/black) and checked with `mypy`. `mypy` and `flake8` conforming checks are automatically ran on all pull requests through GitHub Actions.
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# fastx-barber

Python package for trimming and sequence extraction from FASTA and FASTQ files.
Python package to trim and extract flags from FASTA and FASTQ files.

## Requirements

`fastx-barber` has been tested with Python 3.6, 3.7, and 3.8. We recommend installing it using `pipx` (see [below](#install)) to avoid dependency conflicts with other packages. The packages it depends on are listed in our [dependency graph](https://github.com/ggirelli/fastx-barber/network/dependencies). We use [`poetry`](https://github.com/python-poetry/poetry) to handle our dependencies.

## Install

We recommend installing `fastx-barber` using [`pipx`](https://github.com/pipxproject/pipx). Check how to install `pipx` [here](https://github.com/pipxproject/pipx#install-pipx) if you don't have it yet!

Once you have `pipx` ready on your system, install the latest stable release of `fastx-barber` by running: `pipx install fastx-barber`. If you see the stars (✨ 🌟 ✨), then the installation went well!

# Contribute
## Contributing

We welcome any contributions to `fastx-barber`. In short, we use [`black`](https://github.com/psf/black) to standardize code format. Any code change also needs to pass `mypy` checks. For more details, please refer to our [contribution guidelines](CONTRIBUTING.md) if this is your first time contributing! Also, check out our [code of conduct](CODE_OF_CONDUCT.md).

## License

We use [`black`](https://github.com/psf/black) to standardize code format. Any code change also needs to pass `mypy` checks.
`MIT License - Copyright (c) 2020 Gabriele Girelli`
11 changes: 11 additions & 0 deletions fastx_barber/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
@author: Gabriele Girelli
@contact: [email protected]
"""

from fastx_barber.const import __version__
from fastx_barber import const, scripts
from fastx_barber import io, seqio
from fastx_barber import extract, match, trim

__all__ = ["__version__", "const", "scripts", "io", "seqio", "extract", "match", "trim"]
File renamed without changes.
4 changes: 2 additions & 2 deletions fbarber/extract.py → fastx_barber/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

from abc import ABCMeta, abstractmethod
from fbarber.seqio import FastxSimpleRecord
from fbarber.const import FastxFormats
from fastx_barber.seqio import FastxSimpleRecord
from fastx_barber.const import FastxFormats
from typing import Any, Dict, List, Match, Optional, Tuple, Type

"""Flag data, contains matched str, start, and end position"""
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion fbarber/match.py → fastx_barber/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

from abc import ABCMeta, abstractmethod
from fbarber.seqio import FastxSimpleRecord
from fastx_barber.seqio import FastxSimpleRecord
import regex # type: ignore
from typing import Any, Match, Pattern, Tuple

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@contact: [email protected]
"""

from fbarber.scripts import common
from fbarber.scripts import extract, match, trim
from fastx_barber.scripts import common
from fastx_barber.scripts import extract, match, trim

__all__ = ["common", "extract", "match", "trim"]
4 changes: 2 additions & 2 deletions fbarber/scripts/barber.py → fastx_barber/scripts/barber.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

import argparse
from fbarber.const import __version__
from fbarber import scripts
from fastx_barber.const import __version__
from fastx_barber import scripts
import sys


Expand Down
6 changes: 3 additions & 3 deletions fbarber/scripts/common.py → fastx_barber/scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"""

import argparse
from fbarber.const import __version__, logfmt, FastxFormats
from fbarber.seqio import get_fastx_parser, get_fastx_writer
from fbarber.seqio import FastXParser, SimpleFastxWriter
from fastx_barber.const import __version__, logfmt, FastxFormats
from fastx_barber.seqio import get_fastx_parser, get_fastx_writer
from fastx_barber.seqio import FastXParser, SimpleFastxWriter
import logging
import os
import sys
Expand Down
10 changes: 5 additions & 5 deletions fbarber/scripts/extract.py → fastx_barber/scripts/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"""

import argparse
from fbarber.scripts import common as com
from fbarber.const import logfmt, log_datefmt
from fbarber.extract import FastqFlagExtractor, get_fastx_flag_extractor
from fbarber.match import FastxMatcher
from fbarber.trim import get_fastx_trimmer
from fastx_barber.scripts import common as com
from fastx_barber.const import logfmt, log_datefmt
from fastx_barber.extract import FastqFlagExtractor, get_fastx_flag_extractor
from fastx_barber.match import FastxMatcher
from fastx_barber.trim import get_fastx_trimmer
import logging
import regex # type: ignore
from tqdm import tqdm # type: ignore
Expand Down
6 changes: 3 additions & 3 deletions fbarber/scripts/match.py → fastx_barber/scripts/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"""

import argparse
from fbarber.scripts import common as com
from fbarber.const import logfmt, log_datefmt
from fbarber.match import FastxMatcher
from fastx_barber.scripts import common as com
from fastx_barber.const import logfmt, log_datefmt
from fastx_barber.match import FastxMatcher
import logging
import regex # type: ignore
from tqdm import tqdm # type: ignore
Expand Down
8 changes: 4 additions & 4 deletions fbarber/scripts/trim.py → fastx_barber/scripts/trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"""

import argparse
from fbarber.scripts import common as com
from fbarber.const import logfmt, log_datefmt
from fbarber.match import FastxMatcher
from fbarber.trim import get_fastx_trimmer
from fastx_barber.scripts import common as com
from fastx_barber.const import logfmt, log_datefmt
from fastx_barber.match import FastxMatcher
from fastx_barber.trim import get_fastx_trimmer
import logging
import regex # type: ignore
from tqdm import tqdm # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions fbarber/seqio.py → fastx_barber/seqio.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from abc import ABCMeta, abstractmethod
from Bio import SeqIO # type: ignore
from fbarber.io import is_gzipped
from fbarber.const import FastxFormats, FastxExtensions
from fastx_barber.io import is_gzipped
from fastx_barber.const import FastxFormats, FastxExtensions
import gzip
import os
from typing import Any, IO, Optional, Tuple, Type, Union
Expand Down
4 changes: 2 additions & 2 deletions fbarber/trim.py → fastx_barber/trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

from abc import ABCMeta, abstractmethod
from fbarber.const import FastxFormats
from fbarber.seqio import FastxSimpleRecord
from fastx_barber.const import FastxFormats
from fastx_barber.seqio import FastxSimpleRecord
import regex # type: ignore
from typing import Any, Match, Type

Expand Down
11 changes: 0 additions & 11 deletions fbarber/__init__.py

This file was deleted.

32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[tool.poetry]
name = "fastx-barber"
version = "0.0.1"
description = "FASTX trimming tools"
authors = ["Gabriele Girelli <[email protected]>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/ggirelli/fastx-barber"
repository = "https://github.com/ggirelli/fastx-barber"
keywords = ["fasta", "fastq", "trimming", "bioinformatics"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Operating System :: Unix",
"Operating System :: POSIX :: Linux",
]
include = ["CHANGELOG.md", "LICENSE"]

[tool.poetry.dependencies]
python = "^3.6"
biopython = "^1.77"
regex = "^2020.7.14"
tqdm = "^4.48.0"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.poetry.scripts]
"fbarber" = "fastx_barber.scripts.barber:main"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

0 comments on commit 4357029

Please sign in to comment.