bedtools icon indicating copy to clipboard operation
bedtools copied to clipboard

Including the cigar field when in bamToBed with the -splitD argument

Open ndrubins opened this issue 2 years ago • 1 comments

Hi,

I'm running bamToBed on an RNA-seq bam file with the -splitD argument in order to view each aligned segment in a different line in the bed file, but I would like to be able to distinguish between ambiguously mapped reads in the bed file. I thought that adding the -cigar to the option would do the trick (as it would serve as a read mapping ID), but it seems that it gets ignored when the -splitD option is used (I do get the cigar in the bed output of I exclude the -splitD option).

Any idea how to include the cigar field in the split bed (or any other bam record identified, such as row number in the bam file)?

Seems like this has been asked before but I didn't find a follow up.

Thanks

ndrubins avatar Dec 24 '21 22:12 ndrubins

Hi, I'm also interested in getting the CIGAR output when using the -split/-splitD argument in bamtobed.

I'm using long reads from ONT with minimap2. Large deletions are detected and I would like to split the alignment in multiple parts at deletion position. Without the CIGAR, i can not determine the original position of fragments in the original read.

Moreover, it would be great if -splitD can accept a threshold in order to split the alignment upon user defined deletion size. Best,

gcorre avatar Dec 14 '22 08:12 gcorre