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

-t option for headers with molten #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matt-sd-watson
Copy link

I thought it may be useful to have the option for the output/output file generated with molten format to be able to have column headers. I use snp-dists in COVID-19 analysis pipelines and often use the snp-dists molten output to filter for sample subsets based on SNP distance. Having defined column headers may make it easier to read in and filter these molten outputs.

The column headers can be added with '-t' when '-m' is also enabled.

Let me know if the PR is not appreciated, thanks for the tool!

main.c Outdated
@@ -57,8 +58,8 @@ void show_help(int retcode)
int main(int argc, char* argv[])
{
// parse command line parameters
int opt, quiet = 0, csv = 0, corner = 1, allchars = 0, keepcase = 0, molten = 0;
while ((opt = getopt(argc, argv, "hj:qcakmbv")) != -1) {
int opt, quiet = 0, csv = 0, corner = 1, allchars = 0, keepcase = 0, moltenheader = 0, molten = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like an autoindentation error here.

Copy link
Author

Choose a reason for hiding this comment

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

Hi Fabian, thanks for the review. I double checked my changes and fixed the auto-indentation by using 2 space indentation, as it appears to be the convention for this repo. Please let me know if any other changes are found to be necessary.

@matt-sd-watson
Copy link
Author

Hi @kloetzl, let me know if any other changes should be made for this PR, thanks!

@kloetzl
Copy link
Contributor

kloetzl commented Oct 25, 2021

I leave it to Thorsten to make the call whether to merge this. I'm only wondering if -t is the right option. Maybe -H for header is better? Or combine it with one of the others?

@matt-sd-watson
Copy link
Author

Thanks for the feedback, I appreciate it! I wasn't entirely sure which option would be best since -h was already used. I guess my intuition was that -t could be associated with "top" or "title" for the molten header, but I am happy to change it if another option seems more appropriate. Generally I thought that it would be nice to have the option for a header or not with molten, but if it's not appreciated I understand!

@kloetzl
Copy link
Contributor

kloetzl commented Oct 25, 2021

I agree, a header is nice, but is also easy to add one via standard unix tools:

snp-dists foo.fa | cat <(echo "seq_1\tseq_2\tdist") -

@matt-sd-watson
Copy link
Author

Fair enough! If you and Torsten feel that it's not necessary then I can close the PR.

@kloetzl
Copy link
Contributor

kloetzl commented Oct 26, 2021

Generally I thought that it would be nice to have the option for a header or not with molten, but if it's not appreciated I understand!

If that is the impression you got I need to apologize. I would have merged this pull request almost straight away, I just don't have the permissions to do it. We need to wait for @tseemann to do that.

@matt-sd-watson
Copy link
Author

Generally I thought that it would be nice to have the option for a header or not with molten, but if it's not appreciated I understand!

If that is the impression you got I need to apologize. I would have merged this pull request almost straight away, I just don't have the permissions to do it. We need to wait for @tseemann to do that.

No problem at all @kloetzl! I know that it's a very trivial PR so I understand that there is no specific need to merge this in now.

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.

2 participants