I am trying to extract reads that support structural variants called from a sample. I would like to get these reads from the bam file that was used in structural variant calling.
The purpose of this is to have a minimal bam (evidence bam) that contains only the reads that support structural variant events so I could load the bam bit quickly in IGV. My intention to do this is because I am using 5 Structural variant callers and manually curating each variant called as I want to be super sure before calling them as true variants in patient samples.
Effectively I am trying to create a final bam which would be obtained by merging and removing the duplicate reads from the evidence bams from all the 5 callers.
I am currently using samtools view to extract reads from bam file using the coordinates of breakpoint1 and breakpoint2 for each structural variant called.
Is there an easier way to do this?
Thanks in advance
Venki (Venkatesh Chellappa)
Do you have the reads names that support the SV? If so you can grep them.
samtools view my.bam | grep -f reads_name.txt > supporting_reads.sam
More efficient way is to use
picard FilterSamReads
I am looking for the supporting reads. Without that I cannot have the read_names.txt