-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding rarefy #3
Conversation
Changes Unknown when pulling bb62be7 on antgonza:rarefy into ** on qiita-spots:master**. |
Ready for review! |
qp_qiime2/__init__.py
Outdated
|
||
# Initialize the plugin | ||
plugin = QiitaPlugin( | ||
'qiime2', '4.2017', 'QIIME 2') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change the version string? will this be compatible with 2017.4.x
? also, note, 2017.5
will be coming out this week
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea. Gonna swap values. I guess we need to update the string based on when the final plugin is merged and released in main qiita ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to import the version from qiime2 directly, so we don't have to manually update it? This way it will work with whatever version of q2 is installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea ...
qp_qiime2/__init__.py
Outdated
# Define the rarefy command | ||
req_params = {'i-table': ('artifact', ['BIOM'])} | ||
opt_params = { | ||
'p-sampling-depth': ['integer', '10000'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be 1000 given the dflt_param_set
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works.
if not exists(out_dir): | ||
mkdir(out_dir) | ||
|
||
rarefied = b.subsample(rarefy_level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the function return False
if the resulting table is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, gonna add a test ...
setup.py
Outdated
|
||
from setuptools import setup | ||
|
||
__version__ = "1.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I think this is the default value we are using on all the plugins, @josenavas, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that is a default value for all plugins (in fact, I think it is only used in the deblur plugin because it is matching the deblur version that it implements). Probably using the versioning from Q2 would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
setup.py
Outdated
Topic :: Software Development :: Libraries :: Application Frameworks | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
Programming Language :: Python | ||
Programming Language :: Python :: 2.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
py3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wasade, addressed your comments. @josenavas, could you review?
qp_qiime2/__init__.py
Outdated
|
||
# Initialize the plugin | ||
plugin = QiitaPlugin( | ||
'qiime2', '4.2017', 'QIIME 2') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea. Gonna swap values. I guess we need to update the string based on when the final plugin is merged and released in main qiita ...
qp_qiime2/__init__.py
Outdated
# Define the rarefy command | ||
req_params = {'i-table': ('artifact', ['BIOM'])} | ||
opt_params = { | ||
'p-sampling-depth': ['integer', '10000'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works.
if not exists(out_dir): | ||
mkdir(out_dir) | ||
|
||
rarefied = b.subsample(rarefy_level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, gonna add a test ...
setup.py
Outdated
Topic :: Software Development :: Libraries :: Application Frameworks | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
Programming Language :: Python | ||
Programming Language :: Python :: 2.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changing ...
Changes Unknown when pulling ca97949 on antgonza:rarefy into ** on qiita-spots:master**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments, in general looks good. My question is why is this added to the qiime2 plugin if this is not using qiime2 at all?
.travis.yml
Outdated
- conda install --yes -n qiime2 -c anaconda flake8 | ||
- pip install coveralls | ||
- pip install https://github.com/qiita-spots/qiita_client/archive/master.zip | ||
- pip install https://github.com/qiita-spots/qiita-files/archive/master.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a dependency, remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k, thanks.
qp_qiime2/__init__.py
Outdated
|
||
# Initialize the plugin | ||
plugin = QiitaPlugin( | ||
'qiime2', '4.2017', 'QIIME 2') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to import the version from qiime2 directly, so we don't have to manually update it? This way it will work with whatever version of q2 is installed.
qp_qiime2/__init__.py
Outdated
|
||
# Define the rarefy command | ||
req_params = {'i-table': ('artifact', ['BIOM'])} | ||
opt_params = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put p-sampling-depth as a required parameter and not provide a default value - I think users should decide this value since it is really study dependent. Having a default value may mislead users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
qp_qiime2/__init__.py
Outdated
} | ||
qiime_cmd = QiitaCommand( | ||
"Rarefy", "Rarefy", | ||
rarefy, req_params, opt_params, outputs, dflt_param_set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add analysis_only=True
since we want this to be available only in the analysis pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried but I think this in the latest version of the qiita_client:
Traceback (most recent call last):
File "qp_qiime2/tests/test_qiime2.py", line 21, in <module>
from qp_qiime2 import plugin
File "/Users/antoniog/svn_programs/qp-qiime2/qp_qiime2/__init__.py", line 35, in <module>
analysis_only=True)
TypeError: __init__() got an unexpected keyword argument 'analysis_only'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh - I see. I though the PR was merged. Just checked and there was a test failure on py3 (everything passes on py2). Give me a few minutes and I will update that PR.
setup.py
Outdated
scripts=['scripts/configure_qiime2', 'scripts/start_qiime2'], | ||
extras_require={'test': ["nose >= 0.10.1", "pep8"]}, | ||
install_requires=['click >= 3.3', 'future'], | ||
dependency_links=[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove since qiita-files is not a dependency.
setup.py
Outdated
|
||
from setuptools import setup | ||
|
||
__version__ = "1.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that is a default value for all plugins (in fact, I think it is only used in the deblur plugin because it is matching the deblur version that it implements). Probably using the versioning from Q2 would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @josenavas
.travis.yml
Outdated
- conda install --yes -n qiime2 -c anaconda flake8 | ||
- pip install coveralls | ||
- pip install https://github.com/qiita-spots/qiita_client/archive/master.zip | ||
- pip install https://github.com/qiita-spots/qiita-files/archive/master.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k, thanks.
qp_qiime2/__init__.py
Outdated
|
||
# Initialize the plugin | ||
plugin = QiitaPlugin( | ||
'qiime2', '4.2017', 'QIIME 2') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea ...
qp_qiime2/__init__.py
Outdated
|
||
# Define the rarefy command | ||
req_params = {'i-table': ('artifact', ['BIOM'])} | ||
opt_params = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
qp_qiime2/__init__.py
Outdated
} | ||
qiime_cmd = QiitaCommand( | ||
"Rarefy", "Rarefy", | ||
rarefy, req_params, opt_params, outputs, dflt_param_set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
setup.py
Outdated
|
||
from setuptools import setup | ||
|
||
__version__ = "1.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k
qp_qiime2/__init__.py
Outdated
} | ||
qiime_cmd = QiitaCommand( | ||
"Rarefy", "Rarefy", | ||
rarefy, req_params, opt_params, outputs, dflt_param_set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried but I think this in the latest version of the qiita_client:
Traceback (most recent call last):
File "qp_qiime2/tests/test_qiime2.py", line 21, in <module>
from qp_qiime2 import plugin
File "/Users/antoniog/svn_programs/qp-qiime2/qp_qiime2/__init__.py", line 35, in <module>
analysis_only=True)
TypeError: __init__() got an unexpected keyword argument 'analysis_only'
Changes Unknown when pulling 0e80429 on antgonza:rarefy into ** on qiita-spots:master**. |
|
||
from setuptools import setup | ||
|
||
from qiime2 import __version__ as qiime2_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my only concern about having this like it is right now is that this package assumes that q2 is already installed in order to install this package. Are we ok given that q2 is not pip installable and the recommended installation procedure is conda? If so, can you add a note on the README stating that this package assumes that Q2 is already installed on the active environment, and add a link to q2's installation instructions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that just note that we are doing this based on your suggestion ... pr in a second ...
README.rst
Outdated
@@ -0,0 +1,4 @@ | |||
# qp-qiime2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that by changing the file format from markdown (md) to rst, the formatting of the file has been lost (check on your branch). Can you either leave it as an md file or format it correctly?
Thanks
Changes Unknown when pulling 2aafdea on antgonza:rarefy into ** on qiita-spots:master**. |
k, thanks. change made. |
Changes Unknown when pulling 83dd7ed on antgonza:rarefy into ** on qiita-spots:master**. |
Changes Unknown when pulling 83dd7ed on antgonza:rarefy into ** on qiita-spots:master**. |
I'm 👍 |
This adds the first command of Q2, rarefy (note that we are using the direct biom call), and all the setup for tests and install to run fine.