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

Fix the append behavior in normalize-by-median.py (#745) #843

Merged
merged 19 commits into from
Feb 25, 2015

Conversation

drtamermansour
Copy link
Member

Fix #745: in normalize-by-median.py, change to the default behavior to overwrite the sequences output file. Also add a new argument --append to append new reads to the output file.
I also added a test for the --append option in test_scripts.py

@drtamermansour
Copy link
Member Author

  • Is it mergeable?
  • Did it pass the tests?
  • If it introduces new functionality in scripts/ is it tested?
    Check for code coverage with make clean diff-cover
  • Is it well formatted? Look at make pep8, make diff_pylint_report,
    make cppcheck, and make doc output. Use make format and manual
    fixing as needed.
  • Did it change the command-line interface? Only additions are allowed
    without a major version increment. Changing file formats also requires a
    major version number increment.
  • Is it documented in the ChangeLog?
    http://en.wikipedia.org/wiki/Changelog#Format
  • Was a spellchecker run on the source code and documentation after
    changes were made?

@drtamermansour
Copy link
Member Author

jenkins, please test this

@drtamermansour
Copy link
Member Author

ready for review

@@ -514,6 +514,21 @@ def test_normalize_by_median():
assert len(seqs) == 1, seqs
assert seqs[0].startswith('GGTTGACGGGGCTCAGGGGG'), seqs

# Testing for the apppend option
Copy link
Member

Choose a reason for hiding this comment

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

please make a separate test function instead -- more granular tests are generally better. So,

  • copy the test function twice
  • rename both copies
  • remove the outfile/append tests from the original
  • have one copy do the append test
  • have the other copy do the not-append test

thanks!

@drtamermansour
Copy link
Member Author

@ctb please review

@ctb
Copy link
Member

ctb commented Feb 25, 2015

LGTM on a skim - might ask @mr-c to review/merge since I can't get to it 'til much later today or maybe tomorrow.

@@ -192,6 +192,9 @@ def get_parser():
dest='single_output_filename',
default='', help='only output a single'
' file with the specified filename')
parser.add_argument('--append', default=False, action='store_true',
help='append reads to the outputfile. '
'Only with -o specified')
Copy link
Contributor

Choose a reason for hiding this comment

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

I would word the help text this way: "appends reads instead of replacing the output file (only if -o/--out is specified)'

@ctb
Copy link
Member

ctb commented Feb 25, 2015

Nice work; thanks!

ctb added a commit that referenced this pull request Feb 25, 2015
Fix the append behavior in normalize-by-median.py (#745)
@ctb ctb merged commit e816549 into dib-lab:master Feb 25, 2015
@drtamermansour drtamermansour deleted the fix/#745 branch August 25, 2015 01:19
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.

normalize-by-median.py --force default should be 'true'
3 participants