Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed structure to PyPi package
  • Loading branch information
jenzopr committed Sep 7, 2017
1 parent 67c46b8 commit 520727a
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 91 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -1 +1,5 @@
*.pyc
build/
dist/
*.egg
*.egg-info
7 changes: 7 additions & 0 deletions CHANGES
@@ -1,3 +1,10 @@
## 1.2.1 (2017-09-07)

- Rearranged package structure towards a full Pypi packages
- Renamed summary.R to utils/uropa_summary.R
- Renamed reformat_output.R to utisl/uropa_reformat_output.R
- Reflected changes in documentation

## 1.2.0 (2017-09-05)

- Added an UpSetR plot to summary.R to cancel the need for Vennerable R package
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 MPI for Heart and Lung Research

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,2 @@
include README.md
include LICENSE
25 changes: 25 additions & 0 deletions setup.py
@@ -0,0 +1,25 @@
from setuptools import setup

def readme():
with open('README.md') as f:
return f.read()

setup(name='uropa',
version='1.2.1',
description='UROPA is a command line based tool, intended for genomic region annotation',
long_description=readme(),
url='https://github.molgen.mpg.de/loosolab/UROPA',
author='Jens Preussner',
author_email='jens.preussner@mpi-bn.mpg.de',
license='MIT',
packages=['uropa'],
entry_points = {
'console_scripts': ['uropa = uropa.uropa:main']
},
scripts = ['utils/uropa_summary.R', 'utils/uropa_reformat_output.R', 'utils/uropa2gtf.R'],
install_requires=[
'numpy',
'pysam'
],
zip_safe=False,
include_package_data=True)
75 changes: 37 additions & 38 deletions uropa/config.py
Expand Up @@ -11,48 +11,47 @@
def howtoconfig():
"""Defines the epilog that is given when help is requested."""
epilog = dedent("""\
UROPA is a peak annotation tool facilitating the analysis of next-generation sequencing methods for
chromatin biology, like ChIPseq or ATACseq. There are already different peak annotation tools, like
HOMER or ChIPpeakAnno, but the advantage of UROPA is, that it can easily be fitted to your requirements.
UROPA was developed as an open source analysis pipeline for peaks generated from any peak caller.
UROPA is a peak annotation tool facilitating the analysis of next-generation sequencing methods for
chromatin biology, like ChIPseq or ATACseq. There are already different peak annotation tools, like
HOMER or ChIPpeakAnno, but the advantage of UROPA is, that it can easily be fitted to your requirements.
UROPA was developed as an open source analysis pipeline for peaks generated from any peak caller.
Please cite upon usage:
Kondili M, Fust A, Preussner J, Kuenne C, Braun T, and Looso M.
UROPA: a tool for Universal RObust Peak Annotation.
Kondili M, Fust A, Preussner J, Kuenne C, Braun T and Looso M. UROPA: A tool for Universal RObust Peak Annotation.
Scientific Reports 7 (2017), doi: 10.1038/s41598-017-02464-y
All parameters and paths to input or output files should be reported in a JSON configuration file.
The configuration file should at least contain paths for bed and GTF files:
{
"queries": [],
"bed": "/path/to/bed/file.bed",
"gtf": "/path/to/annotation/file.gtf"
}
Different query types can be defined using the queries key:
{
"queries": [
{...},
{...}],
"bed": "/path/to/bed/file.bed",
"gtf": "/path/to/annotation/file.gtf"
}
Optionally, the priority key can be used to fine tune UROPAs behaviour:
{
"queries": [
{...},
{...}],
"bed": "/path/to/bed/file.bed",
"gtf": "/path/to/annotation/file.gtf",
"priority": "True"
}
Please visit http://uropa-manual.readthedocs.io/config.html for detailed information on configuration.
""")
All parameters and paths to input or output files should be reported in a JSON configuration file.
The configuration file should at least contain paths for bed and GTF files:
{
"queries": [],
"bed": "/path/to/bed/file.bed",
"gtf": "/path/to/annotation/file.gtf"
}
Different query types can be defined using the queries key:
{
"queries": [
{...},
{...}],
"bed": "/path/to/bed/file.bed",
"gtf": "/path/to/annotation/file.gtf"
}
Optionally, the priority key can be used to fine tune UROPAs behaviour:
{
"queries": [
{...},
{...}],
"bed": "/path/to/bed/file.bed",
"gtf": "/path/to/annotation/file.gtf",
"priority": "True"
}
Please visit http://uropa-manual.readthedocs.io/config.html for detailed information on configuration.
""")
return epilog


Expand Down
21 changes: 10 additions & 11 deletions uropa.py → uropa/uropa.py 100755 → 100644
@@ -1,10 +1,9 @@
#!/usr/bin/env python
"""
uropa.py: UROPA - Universal RObust Peak Annotator
@authors: Maria Kondili, Jens Preussner and Annika Fust
@license: MIT
@version: 1.2.0
@version: 1.2.1
@maintainer: Mario Looso
@email: mario.looso@mpi-bn.mpg.de
"""
Expand All @@ -26,14 +25,14 @@

import numpy as np

import uropa.config as cfg
import uropa.overlaps as ovls
import uropa.annotation as ant

if __name__ == "__main__":
import config as cfg
import overlaps as ovls
import annotation as ant

#if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(
prog="uropa.py",
prog="uropa",
description='UROPA - Universal RObust Peak Annotator.',
epilog=cfg.howtoconfig(),
formatter_class=argparse.RawDescriptionHelpFormatter)
Expand Down Expand Up @@ -95,7 +94,7 @@
"--version",
help="prints the version and exits",
action="version",
version="%(prog)s 1.2.0")
version="%(prog)s 1.2.1")
args = parser.parse_args()

config = args.input
Expand Down Expand Up @@ -345,7 +344,7 @@
if args.reformat and len(queries) > 1 and not pr:
logger.info("Reformatting output...")
R_reform_Best = [
'reformat_output.R',
'uropa_reformat_output.R',
'-i',
besthits_outfile,
'-k',
Expand All @@ -370,7 +369,7 @@
#
if args.summary:
logger.info("Creating the Summary graphs of the results...")
summary_script = "summary.R"
summary_script = "uropa_summary.R"
summary_output = outdir + "summary.pdf"

if len(queries) > 1 and not pr and os.path.exists(merged_outfile):
Expand Down

0 comments on commit 520727a

Please sign in to comment.