This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filtering sam or bam file with maximum matching region

Hi all,

I am analysing NGS amplicon reads of crisper gene samples. I do not know exactly which genes do they belong to because if I align reads against gene sequence (that was supposed to be) using BWA it gives 0% identity however by aligning reference genome I get 99% alignment rate. Now how can I find about the gene through reads data. Is there any way to find through sam or bam file that which chromosomal position are maximum reads aligning to?

Thanks

crisper-edited alignment match

1 answer

. Is there any way to find through sam or bam file that which chromosomal position are maximum reads aligning to?

samtools depth in.bam | awk -F '\t' 'BEGIN{BEST_DEPTH=0;BEST="";} {DEPTH=int($3);if(BEST_DEPTH<DEPTH) {BEST_DEPTH=DEPTH;BEST=$0;} } END{print BEST;}'

Thanks Pierre!

I got this output

Can you please interpret the output

enter image description here

Please do not paste screenshots of plain text content, it is counterproductive. You can copy paste the content directly here (using the code formatting option shown below),

Okay sure Pierre I will take care of it next time

Thanks for the interpretation Pierre!

Log in to answer this question.