This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Working on new walker and window system. * Updated README and prepared for release. * Updated version tag. * Added shields. * Added line break. * Fixed link.
- Loading branch information
Showing
5 changed files
with
95 additions
and
5 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 |
---|---|---|
@@ -1,3 +1,34 @@ | ||
# iFISH Probe Design (II) | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolor odit, dolorem, quia eum excepturi unde quis ab, adipisci illum aperiam laborum. Dolore sit perferendis consequatur eum obcaecati et ipsum placeat. | ||
![](https://img.shields.io/github/license/ggirelli/ifpd2.svg?style=flat) ![](https://github.com/ggirelli/ifpd2/workflows/Python%20package/badge.svg?branch=main&event=push) | ||
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ifpd2) ![PyPI - Format](https://img.shields.io/pypi/format/ifpd2) ![PyPI - Status](https://img.shields.io/pypi/status/ifpd2) | ||
![](https://img.shields.io/github/release/ggirelli/ifpd2.svg?style=flat) ![](https://img.shields.io/github/release-date/ggirelli/ifpd2.svg?style=flat) ![](https://img.shields.io/github/languages/code-size/ggirelli/ifpd2.svg?style=flat) | ||
![](https://img.shields.io/github/watchers/ggirelli/ifpd2.svg?label=Watch&style=social) ![](https://img.shields.io/github/stars/ggirelli/ifpd2.svg?style=social) | ||
|
||
[PyPi](https://pypi.org/project/ifpd2/) | [docs](https://ggirelli.github.io/ifpd2/) | ||
|
||
`ifpd2` is a Python3.7+ package containing tools for selection of complementary oligonucleotides to build iFISH probes. It is based on our previous `ifpd` package, but works with a different and more detailed database format, allowing for more precise control on the probe design process. Read the online [documentation](https://ggirelli.github.io/ifpd2/) for more details. | ||
|
||
## Requirements | ||
|
||
`ifpd2` is fully implemented in Python3.7+, thus you need the corresponding Python version to run it. Check out [here](https://realpython.com/installing-python/) how to install Python+ on your machine if you don't have it yet. | ||
|
||
`ifpd2` has been tested with Python 3.7 and 3.8. We recommend installing it using `pipx` (see [below](https://github.com/ggirelli/ifpd2#installation)) to avoid dependency conflicts with other packages. The packages it depends on are listed in our [dependency graph](https://github.com/ggirelli/ifpd2/network/dependencies). We use [`poetry`](https://github.com/python-poetry/poetry) to handle our dependencies. | ||
|
||
## Installation | ||
|
||
We recommend installing `ifpd2` 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 `ifpd2` by running: `pipx install ifpd2`. If you see the stars (✨ 🌟 ✨), then the installation went well! | ||
|
||
## Usage | ||
|
||
All `ifpd2` commands are accessible via the `ifpd2` keyword on the terminal. For each command, you can access its help page by using the `-h` option. More details on how to run `ifpd2` are available in the online [documentation](https://ggirelli.github.io/ifpd2). | ||
|
||
## Contributing | ||
|
||
We welcome any contributions to `ifpd2`. 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](https://github.com/ggirelli/ifpd2/blob/main/CONTRIBUTING.md) if this is your first time contributing! Also, check out our [code of conduct](https://github.com/ggirelli/ifpd2/blob/main/CODE_OF_CONDUCT.md). | ||
|
||
## License | ||
|
||
`MIT License - Copyright (c) 2021 Gabriele Girelli` |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
@contact: gigi.ga90@gmail.com | ||
""" | ||
|
||
__version__ = "2.0.5" | ||
__version__ = "1.0.0-alpha" |
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,59 @@ | ||
""" | ||
@author: Gabriele Girelli | ||
@contact: gigi.ga90@gmail.com | ||
""" | ||
|
||
import logging | ||
import pandas as pd # type: ignore | ||
from typing import Tuple, Union | ||
|
||
|
||
class GenomicWindowSet(object): | ||
_window_data: pd.DataFrame = pd.DataFrame( | ||
columns=[ | ||
"set_id", | ||
"window_id", | ||
"start", | ||
"end", | ||
"focus_start", | ||
"focus_end", | ||
] | ||
) | ||
_window_id: int = -1 | ||
|
||
feature: str # Chromosome | ||
region: Tuple[int, int] | ||
|
||
n_probes: int | ||
window_size: int | ||
window_shift: float | ||
|
||
# Either in nt (x>1) or fraction of window_size (0<x<=1) | ||
focus_size: Union[int, float] | ||
# Either in nt (x>1) or fraction of focus_size (0<x<=1) | ||
focus_step: Union[int, float] | ||
|
||
_growing: bool = False | ||
|
||
def __init__(self, region: Tuple[int, int]): | ||
super(GenomicWindowSet, self).__init__() | ||
self.region = region | ||
assert self.region[0] <= self.region[1] | ||
|
||
@property | ||
def growing(self) -> bool: | ||
return self._growing | ||
|
||
@property | ||
def reached_last_window(self) -> bool: | ||
return (self._window_id + 1) == self._window_data.shape[0] | ||
|
||
def init_windows_for_n_probes(self, n_probes: int) -> None: | ||
if 0 < self._window_data.shape[0]: | ||
logging.warning("cannot re-initalize windows.") | ||
return | ||
|
||
def init_windows_by_size(self, size: int, shift: float) -> None: | ||
if 0 < self._window_data.shape[0]: | ||
logging.warning("cannot re-initalize windows.") | ||
return |
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