Skip to content

mismatch filter#30

Open
jklughammer wants to merge 5 commits into
brentp:masterfrom
jklughammer:master
Open

mismatch filter#30
jklughammer wants to merge 5 commits into
brentp:masterfrom
jklughammer:master

Conversation

@jklughammer

Copy link
Copy Markdown
Contributor

I added the functionality of a mismatch filter. There is now a new parameter (mismatch_ratio) which specifies the maximum acceptable ratio of mismatches to alignment length. Reads which have to many mismatches are reported as qc-failed (0x200) and unmapped (0x4). Chromosome and mapping position are set to * and 0 respectively and the originally reported values are stored in two extra fileds MC:Z: (chromosome) and MP:Z: (position). I implemented this, because I need more control over which reads are considered "mapped". Might be useful for others, too.

@brentp

brentp commented Aug 9, 2016

Copy link
Copy Markdown
Owner

can you make this opt-in, so that the default is 1, meaning it has no effect and only do any extra work if the value is < 1?

also, please make the argument "--mismatch-ratio" instead of "--mismatch_ratio".

@jklughammer

Copy link
Copy Markdown
Contributor Author

done.

@brentp

brentp commented Aug 9, 2016

Copy link
Copy Markdown
Owner

what's with the MC and MP tags?

@jklughammer

Copy link
Copy Markdown
Contributor Author

stores the original mapping chromosome and position: MC:Z: (chromosome) and MP:Z: (position) just so-that it's not lost. You think it's problematic for downstream analysis?

@brentp

brentp commented Aug 9, 2016

Copy link
Copy Markdown
Owner

I guess that's fine. I would prefer not to set CHROM and POS to bad values, just leave the originals and set the flag.

@jklughammer

Copy link
Copy Markdown
Contributor Author

I need CHROM and POS to be set to * and 0 for what I do downstream. Also I think some tools might be confused if the flag says "unmapped", but then there's mapping positions.

@brentp

brentp commented Aug 9, 2016

Copy link
Copy Markdown
Owner

I don't think I want to set POS and CHROM. Can you filter on the flag, rather than on the mapping?

@jklughammer

Copy link
Copy Markdown
Contributor Author

I do filter on the flag, but I also summarize mapping positions. And I want the reads with too many mismatches to be counted as unmapped. To me it makes more sense this way. Do you have any specific concerns about changing chrom and pos? If yes I might reconsider.
In any case if you prefer to keep the mapping positions just change it after merging - or don't merge if you think it's not generally useful (:

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