This is a test version of Biostars. For the public version, visit https://www.biostars.org.
trailing paired-end slashes (/) in BAM file

Hi there, I'm working with a BAM file to produce a contact-map with PreText. Unfortunately, it appears that trailing /1 and /2 characters after the read name bother the tool which returns an empty map...

Is there a way to get rid of those trailing characters maybe with sed or awk. I've done few experiments, but I guess I'm missing the overall mechanics because it either didn't happen anything, or else the file is corrupted afterwards. Below, it is how the first column of the BAM appears:

E250011414L1C001R00100000217/1
E250011414L1C001R00100000217/1
E250011414L1C001R00100000263/1
.
.
.
E250012634L1C021R01400500123/2
E250012634L1C021R01400500258/2
E250012634L1C021R01400500313/2

Thanks in advance!

awk bam sed

i've done few experiments

show us the commands.

1 answer

@Pierre Lindenbaum that helped, thanks! Tweaking a bit the command gave the expected result!

Log in to answer this question.