Skip to content

Commit

Permalink
1.5.0 (#36)
Browse files Browse the repository at this point in the history
* Created setup.py and MANIFEST.in

* Now setup.py and scoary --test work from anywhere

* Version 1.5.0

-Scoary is now installable by pip: pip install git+https://github.com/AdmiralenOla/Scoary.git
-This installs scoary as an executable in your PATH. scoary.py is deprecated

* 1.5.0

* Give a warning message that scoary.py is deprecated when ran directly.

* Fixed indentation

* Change version

* Added filtration options output

* 1.5.0 changes
  • Loading branch information
AdmiralenOla authored Sep 13, 2016
1 parent 0518542 commit 31b96d5
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 4 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft scoary/exampledata
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Scoary is designed to take the gene_presence_absence.csv file from [Roary] (http
- [Contact] (#contact)

## What's new?
v1.5.0 (13th Sep 2016)
- Scoary is now installable via pip! (Thanks go to Anders Goncalves da Silva). The scoary.py script will now be deprecated, but is still available for legacy use. See [Installation] (#installation)
- The program now also prints out the filtration options being used for the current analysis.

v1.4.2 (13th Sep 2016)
- Fixed a bug that would cause Scoary to crash if ran without any -c options.

Expand Down Expand Up @@ -113,6 +117,20 @@ v1.1 (29th Mar 2016)

## Installation

The easiest way to install Scoary is through the pip package manager:

pip install git+https://github.com/AdmiralenOla/Scoary.git

OR, if you need a local (user) installation:

pip install --user git+https://github.com/AdmiralenOla/Scoary.git

Finally, to specify a local directory in your user installation:

pip install --user --install-option="--install-scripts=$HOME/bin" git+https://github.com/AdmiralenOla/Scoary.git

##### Legacy installation

Scoary is a standalone python script and does not require any installation. Simply download and extract the zip archive or clone the git repository:

git clone https://github.com/AdmiralenOla/Scoary
Expand All @@ -125,7 +143,11 @@ If you want to add it to your $PATH variable:

## Usage

scoary.py -g gene_presence_absence.csv -t traits.csv
scoary -g <gene_presence_absence.csv> -t <traits.csv>

##### Legacy usage

scoary.py -g <gene_presence_absence.csv> -t <traits.csv>

## Input
Scoary requires two input files: The gene_presence_absence.csv file from [Roary] (https://sanger-pathogens.github.io/Roary/) and a list of traits to test associations to.
Expand Down Expand Up @@ -346,6 +368,7 @@ Please feel free to suggest improvements, point out bugs or methods that could b

## Acknowledgements
- Marco Galardini cleaned my code and made many nifty improvements.
- Anders Goncalves da Silva made Scoary installable by pip
- The QuadTree and UPGMA implementation was heavily based on code by Christian Storm Pedersen.
- Inês Mendes pointed out a number of bugs related adjusted p-values and isolate restriction.
- Eric Deveaud added versioning.
Expand Down
3 changes: 3 additions & 0 deletions scoary.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@
from scoary import methods

if __name__ == '__main__':
print("Warning. Since 1.5.0 scoary.py is deprecated. " \
"Install Scoary using 'pip install git+https://github.com/AdmiralenOla/" \
"Scoary.git' instead")
methods.main()
2 changes: 1 addition & 1 deletion scoary/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.4.2'
__version__ = '1.5.0'
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 12 additions & 2 deletions scoary/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
from .classes import PhyloTree
import scoary

import os
from pkg_resources import resource_string, resource_filename

SCOARY_VERSION = scoary.__version__

# Python 2/3 annoyances
Expand Down Expand Up @@ -139,12 +142,12 @@ def main():
if args.test:
args.correction = ['I','EPW']
args.delimiter = ','
args.genes = './exampledata/Gene_presence_absence.csv'
args.genes = os.path.join(resource_filename(__name__, 'exampledata'), 'Gene_presence_absence.csv')
args.max_hits = None
args.p_value_cutoff = [0.05]
args.restrict_to = None
args.start_col = 15
args.traits = './exampledata/Tetracycline_resistance.csv'
args.traits = os.path.join(resource_filename(__name__, 'exampledata'), 'Tetracycline_resistance.csv')
args.upgma_tree = True
args.write_reduced = False
args.no_time = False
Expand Down Expand Up @@ -203,6 +206,7 @@ def main():
traitsdic = Csv_to_dic(traits, args.delimiter, allowed_isolates)

print("Finished loading files into memory.")
print(filtrationoptions(cutoffs))
print("Tallying genes and performing statistical analyses")

RES_and_GTC = Setup_results(genedic, traitsdic)
Expand Down Expand Up @@ -726,6 +730,12 @@ def StoreUPGMAtreeToFile(upgmatree, no_time=False):
Tree = Tree.replace("]", ")")
treefile.write(Tree)
print("Wrote the UPGMA tree to file: %s" % treefilename)

def filtrationoptions(cutoffs):
translation = {"I": "Individual (Naive)", "B": "Bonferroni", "BH":"Benjamini-Hochberg",
"PW":"Pairwise comparison (Best)", "EPW": "Pairwise comparison (Entire range)"}
filters = [str(translation[k]) + ": " + str(v) for k,v in cutoffs.items()]
return "Filtration options: \n" + "\n".join(filters)

if __name__ == '__main__':
pass
38 changes: 38 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

from setuptools import setup


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


setup(name='Scoary',
version='1.5.0',
description='Microbial pan-GWAS using the output from Roary',
long_description=readme(),
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: GPLv3',
'Programming Language :: Python :: 2.7',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Medical Science Apps.',
'Intended Audience :: Science/Research',
],
keywords='microbial genomics GWAS Roary',
url='https://github.com/AdmiralenOla/Scoary',
author='Ola Brynildsrud',
author_email='[email protected]',
license='GPLv3',
packages=['scoary'],
install_requires=[
'scipy>=0.16',
'argparse'
],
test_suite='nose.collector',
tests_require=[],
entry_points={
'console_scripts': ['scoary=scoary.methods:main'],
},
include_package_data=True,
zip_safe=False)

0 comments on commit 31b96d5

Please sign in to comment.