Entering edit mode
2.7 years ago
Anst
▴
50
Hello!
I am trying to rewrite the existing bam file by replacing some nucleotides in given reads. For example
ATCCG -> TTCCG
I though about a prototype of if condition like
str1 = 'ATCCG'
if str1[0] == 'A' : str2[0] = 'T'
Although, did not find a good explaination in documentation how to do it. Maybe there is more accurate way of rewriting file via pysam.
Thanks!
see How to introduce artificial mutation in bam ; Modifying fastq base at specific reference location on different length reads ;