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

bugfix: ReviewConsensusVariants should not require grouped raw reads to #860

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

nh13
Copy link
Member

@nh13 nh13 commented Jul 20, 2022

overlap each variant.

In some cases, the consensus call may change the span of the alignment
to cover a base that's not covered by any grouped raw read used in that
consensus.

Fixed #604

overlap each variant.

In some cases, the consensus call may change the span of the alignment
to cover a base that's not covered by any grouped raw read used in that
consensus.
@nh13 nh13 requested a review from tfenne July 20, 2022 05:05
@nh13
Copy link
Member Author

nh13 commented Jul 20, 2022

I used the test case found in #604 .

The below shows the error with some more debug information, where it's reviewing a variant position of 1101 , where there's are no raw grouped R2 reads covering that position, where the code expects some, since it did fined consensus R2 reads covering that position. This is due to differences in alignment between grouped and consensus reads. The fix is to just return a zero count for the raw grouped reads.

# grouped BAM
$samtools view -f 128 NEB5.ds.group.csort.bam | grep 54796
MN01352:2:000H33NT7:1:12108:17698:4526	147	pUC57_CTNNB1_WT	1102	60	29S117M	=	1097	-122	CCCTACACGACGCTCTTCAGATCTCAACTGTCTTACCTGGACTCTGGAATCCATTCTGGTGCCACTACCACAGCTCCTTCTCTGTGTGGTAAAGGCAATCCTGAGGAAGAGGATGTGGATACCTCCCAAGTCCTGTATTAGTGGGA	FFF6/FFFFFFFFAFFF//=FF/FA6AF/FFAFFFFFA/FFFFFFFFFFF//FAFFFFFFFFFFFFAF/FFFFFFFFFF6FFFA/FFFFF/FFF///FFFAFAAFFFAAFFFA/F=AFFFFF6FA/F/FAFF/FFFFF//FFFFFF	MC:Z:123M23S	MD:Z:55A53G7	MI:Z:54796	NM:i:2	MQ:i:60	AS:i:107	XS:i:0	RX:Z:TTGTCGAACCAGCGGAC

# consensus BAM
$ samtools view -f 128 NEB5.ds.cons.filtered.csort.bam | grep 54796
:54796	99	pUC57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GGANGNGGATACNTCNCNAGTCNTGTATNNGTGGGA	@#@C#CC@CCCCC@#CCCCCCCCCCC##C@CCCCCCCCCCCC@C#CCCCCCCCCC#CCC@#CCCCC#CCC###CCC@C@@CCC@@CCC@#C#@CCCCC#C@#C#C@CC#CCCCC##CCCCCC	MC:Z:122M	MD:Z:1a2a9g11c0c16c10c4a5a3g0c0a16t1t6c2c1a4c5g0a6	cD:i:1	cE:f:0	PG:Z:bwa	RG:Z:A	MI:Z:54796	NM:i:20	cM:i:1	MQ:i:60	UQ:i:40	AS:i:107	RX:Z:TTGTCGAACCAGCGGAC	cd:B:s,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1	ce:B:s,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

$ java -Xmx8g -jar ~/work/git/fgbio/target/scala-2.13/fgbio-2.0.3-7326a777-SNAPSHOT.jar ReviewConsensusVariants -i CTNNB1_WT_interval_list -c NEB5.ds.cons.filtered.csort.bam -g NEB5.ds.group.csort.bam -r CTNNB1_WT.fa -o out
...
Exception in thread "main" java.lang.IllegalStateException: Could not find reads with MI 54796 for R2 at locus Variant(pUC57_CTNNB1_WT,1101,A,None,None)

@codecov-commenter
Copy link

Codecov Report

Merging #860 (a3340b0) into main (7326a77) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #860   +/-   ##
=======================================
  Coverage   95.64%   95.64%           
=======================================
  Files         125      125           
  Lines        7238     7238           
  Branches      480      479    -1     
=======================================
  Hits         6923     6923           
  Misses        315      315           
Flag Coverage Δ
unittests 95.64% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../fulcrumgenomics/umi/ReviewConsensusVariants.scala 97.58% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7326a77...a3340b0. Read the comment docs.

@tfenne tfenne merged commit bd78e53 into main Jul 26, 2022
@tfenne tfenne deleted the bugfix/issue604 branch July 26, 2022 22:15
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.

NoSuchElementException with ReviewConsensusVariants
3 participants