This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Overwrite Read sequences in bam with reads from Fastq

I had to modify my original reads (masking few nucleotides), now my alignment went well (i use bowtie2) but I need my original reads in my sam. So I need to catch the original read from my fastq to reinject it into my bam (I know the cigar would be compromised but I don't care).

What would be the most efficient?

My idea would be to use python to parse the fastq and the bam with Python (using pyfastx and pysam), but I'm wondering if something more efficient already exist.

sam bam fastq

this is a pretty esoteric need that also makes the BAM file invalid ... it is unlikely that any such tool would exist.

I am mainly chiming in to suggest another Python package that you could do it with - SimpleSam, it is pure python but needs samtools if operating on BAM file

https://simplesam.readthedocs.io/en/latest/

0 answers

No answers yet.

Log in to answer this question.