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

ivar consensus: call reference at positions with low coverage #131

Open
alephreish opened this issue Jun 23, 2022 · 1 comment
Open

ivar consensus: call reference at positions with low coverage #131

alephreish opened this issue Jun 23, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@alephreish
Copy link

I'm using ivar consensus to create updated reference sequences in simple cases (i.e. mapping of Sanger contigs to a reference assembly), similar to FastaAlternateReferenceMaker. For this to work, consensus should take reference residues at positions with low (zero) coverage, an option that AFAICT it does not have.

$ cat pile.txt
ref	1	A	0	*	*
ref	2	A	1	T	~
ref	3	T	0	*	*
ref	4	G	0	*	*
ref	5	G	0	*	*
$ ivar consensus -p cons -m 1 < pile.txt 
Minimum Quality: 20
Threshold: 0
Minimum depth: 1
Regions with depth less than minimum depth covered by: N
Reference length: 5
Positions with 0 depth: 4
Positions with depth below 1: 4
$ cat cons.fa 
>Consensus_cons_threshold_0_quality_20
NTNNN

A workaround is to mess with the pileup, forcing zero-depth positions to have the reference residue:

$ awk '!$4{$4=1;$5=".";$6="~"}1' OFS=\\t pile.txt | ivar consensus -p cons -m 1
Minimum Quality: 20
Threshold: 0
Minimum depth: 1
Regions with depth less than minimum depth covered by: N
Reference length: 5
Positions with 0 depth: 0
Positions with depth below 1: 0
$ cat cons.fa 
>Consensus_cons_threshold_0_quality_20
ATTGG

But I think it would be natural to add an argument (or to extend -n) that would indicate that the reference should be called for regions with zero coverage (perhaps in lower case).

@cmaceves
Copy link
Collaborator

got it, yeah that makes a lot of sense to me! could you please provide me some sample data?

@cmaceves cmaceves added the enhancement New feature or request label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants