Entering edit mode
2.1 years ago
Eliveri
▴
350
I have a Bam file for which I want to REMOVE reads overlapping with a given Bed file (so keep all other reads/alignments).
I know the parameter option -L
= only output alignments overlapping the input bed file, however I want to output alignments NOT overlapping with the input bed file.
Is this possible?
I tried the following with the -U parameters but it has not worked. I am currently trying samtools view
samtools view -b -h original.bam -T ref_dir/genome.fa -U ref_dir/human.bed > new.bam
samtools view documentation: http://www.htslib.org/doc/samtools-view.html
Is there any way to also include unmapped mates of mapped reads and vice versa? So that singleton reads will not be discarded because of missing mates? Thank you.
After I obtained the output.bam. I sorted the output.bam and convert to fastq (example below):
However 663286 singletons were discarded
output.bam info: