Overwrite Read sequences in bam with reads from Fastq
0
0
Entering edit mode
2.5 years ago
Juke34 8.5k

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 • 585 views
ADD COMMENT
0
Entering edit mode

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/

ADD REPLY

Login before adding your answer.

Traffic: 2338 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6