8000 VCFRecord.filter doesn't return correct set of filters · Issue #139 · blachlylab/dhtslib · GitHub
[go: up one dir, main page]

Skip to content

VCFRecord.filter doesn't return correct set of filters #139

Open

Description

@charlesgregory

The VCFRecord.filter function incorrectly returns the first filter repeated for the number of filters, instead of all filters.

    /* FILTER */
    /// Get FILTER column (nothing in htslib sadly)
    @property string filter()
    {
        const(char)[] ret;

        this.unpack(UnpackLevel.Filter);

        if (this.line.d.n_flt) {
            for(int i; i< this.line.d.n_flt; i++
8DF4
) {
                if (i) ret ~= ";";
                ret ~= fromStringz(this.vcfheader.hdr.id[BCF_DT_ID][ this.line.d.flt[0] ].key);
            }
        } else {
            ret = ".";
        }

        return ret.idup;
    }

Fix is below:

                                                    this should be i |
                                                                     v
ret ~= fromStringz(this.vcfheader.hdr.id[BCF_DT_ID][ this.line.d.flt[0] ].key);

Activity

  1. jblachly commented on Aug 30, 2022

    @jblachly
    Member

    Heh, this was probably my code. This was before I found religion in unit testing everything.

  2. jblachly commented on Aug 30, 2022

    @jblachly
    Member

    Heh, this was probably my code. This was before I found religion in unit testing everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0