Skip to content

Conversation

@nrkssa
Copy link
Contributor

@nrkssa nrkssa commented Sep 13, 2018

Include optional flags to pileup.py/load_pileup

  • min_mapq=0
  • min_baseq=0
  • no_del=False
  • no_dup=False

This allows for the use of these flags in all pysamsstats.load_* calls

Include optional flags to pileup.py/load_pileup

- min_mapq=0
- min_baseq=0
- no_del=False
- no_dup=False

This allows for the use of these flags in  all pysamsstats.load_* calls
@alimanfoo alimanfoo added this to the v1.1 milestone Sep 13, 2018
@alimanfoo
Copy link
Owner

alimanfoo commented Sep 13, 2018

Great, thank you!

For a test, something like this added to the pysamstats/test/test_pileup.py module would be fine I think:

def test_pileup_kwargs():
    # check that keyword arguments are being passed through
    kwargs = {
        'chrom': 'Pf3D7_01_v3',
        'start': 2000,
        'end': 2100,
        'min_mapq': 1,
        'min_baseq': 1,
        'no_del': True,
        'no_dup': True
    }
    for f, needs_ref in pileup_functions:
        if needs_ref:
            a = f(Samfile('fixture/test.bam'), Fastafile('fixture/ref.fa'), **kwargs)
        else:
            a = f(Samfile('fixture/test.bam'), **kwargs)
        assert isinstance(a, np.ndarray)
        assert a.dtype.names is not None

Added function pysamstats/test/test_pileup.py:test_pileup_kwargs()
@nrkssa
Copy link
Contributor Author

nrkssa commented Sep 13, 2018

Great, thank you!

For a test, something like this added to the pysamstats/test/test_pileup.py module would be fine I think:

def test_pileup_kwargs():
    # check that keyword arguments are being passed through
    kwargs = {
        'chrom': 'Pf3D7_01_v3',
        'start': 2000,
        'end': 2100,
        'min_mapq': 1,
        'min_baseq': 1,
        'no_del': True,
        'no_dup': True
    }
    for f, needs_ref in pileup_functions:
        if needs_ref:
            a = f(Samfile('fixture/test.bam'), Fastafile('fixture/ref.fa'), **kwargs)
        else:
            a = f(Samfile('fixture/test.bam'), **kwargs)
        assert isinstance(a, np.ndarray)
        assert a.dtype.names is not None

Thanks. I have included this function in test/test_pileup.py. The latest commit contains this change.

@alimanfoo alimanfoo merged commit 8f7fb48 into alimanfoo:master Sep 13, 2018
@alimanfoo
Copy link
Owner

Awesome, 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.

2 participants