This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Remove from enst name a unique eleven digit number from bam file

Hello!

I need to remove from bam file number in the end of name transcripts. ENST00000451407.4 to ENST00000451407

How can i do it?

Thank you!

ensembl

1 answer

Untested but should work.

samtools view -h file.bam | sed -E 's/(ENST[0-9]+)\.[0-9]+/\1/g' | samtools view -bo cleaned_file.bam

Log in to answer this question.