Skip to content
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

Faith pd cli #70

Merged
merged 18 commits into from
Jun 19, 2019
Merged

Faith pd cli #70

merged 18 commits into from
Jun 19, 2019

Conversation

gwarmstrong
Copy link
Member

@gwarmstrong gwarmstrong commented May 15, 2019

Resolves #66 and resolves #69

Introduces a cli for Faith's PD with the following signature:

$ faithpd
usage: faithpd -i <biom> -o <out.dm> -t <newick> 

    -i          The input BIOM table.
    -t          The input phylogeny in newick.
    -o          The output series.

Citations: 
    For Faith's PD, please see:
        Faith Biological Conservation 1992; DOI: 10.1016/0006-3207(92)91201-3

This PR should probably wait for #68 so I can include the osx compatibility for the Faith PD cli compatibility for mac in this PR.

@gwarmstrong
Copy link
Member Author

gwarmstrong commented May 16, 2019

Seems like there is some conflict due to the updated requirements that is causing the compile step to fail. Maybe coming from Cython? I do not experience this issue on Mac

@gwarmstrong
Copy link
Member Author

gwarmstrong commented Jun 18, 2019

@ElDeveloper @wasade re: #71
I should probably do something similar here too.
Does something like:

#SampleID	faith_pd
10084.PC.481	8.268050017119094
10084.PC.593	6.256320004780719
10084.PC.356	7.2537400212168
...

seem reasonable?

@ElDeveloper
Copy link
Member

That is very reasonable! It is both QIIME1 and QIIME2 compatible, so we should be good to go for the most part.

Copy link
Member

@ElDeveloper ElDeveloper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple of comments.

sucpp/api.cpp Show resolved Hide resolved
sucpp/api.cpp Outdated Show resolved Hide resolved
sucpp/api.hpp Outdated
* The following error codes are returned:
*
* write_okay : no problems
* open_error : could not open the file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this error is actually returned, am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah good catch, copypasta again. Open error is used to prevent opening multiple files at one time when writing partials. since we aren't supporting parallel execution at this point, we do not need it. I've removed this line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore, it is not returned by write_mat so I have removed it there as well.

sucpp/faithpd.cpp Outdated Show resolved Hide resolved
const std::string &tree_filename = input.getCmdOption("-t");
const std::string &output_filename = input.getCmdOption("-o");

faith_cli_one_off(table_filename, tree_filename, output_filename);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be:

return faith_cli_one_off(table_filename, tree_filename, output_filename);

And also, now you should be able to remove line 82.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine as is. Error handling is taken care of here:
https://github.com/gwarmstrong/unifrac/blob/f6ac379ecf80625ed2ab91211d71f2e80e44c9a9/sucpp/faithpd.cpp#L57-L66
And follows the convention previously set in sucpp/su.cpp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it!

const std::string &tree_filename = input.getCmdOption("-t");
const std::string &output_filename = input.getCmdOption("-o");

faith_cli_one_off(table_filename, tree_filename, output_filename);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it!

@ElDeveloper ElDeveloper merged commit 4a71b50 into biocore:master Jun 19, 2019
@ElDeveloper
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compute status messages off in su.cpp CLI interface for Faith PD
2 participants