How do I exclude low read loci from a sam file
1
0
Entering edit mode
10.0 years ago

I have a control and tumour sam file which I will be using to detect copy number changes. I want to use reliable loci (defined as producing >100 reads for this purpose) so I want to exclude all loci that have <100 reads from the control sam file before I do my comparisons. The trouble is I dont know how to see the number of reads for each locus from a sam file. Can anyone direct me as to how to do this?

sequencing • 2.4k views
ADD COMMENT
0
Entering edit mode

What tool on GATK do you use to filter the data with a given set of loci? It's not clear to me how I input the filter list with the DepthOfCoverage tool. It only provides documentation for a RefSeq Rod- is that the filtering list?

ADD REPLY
0
Entering edit mode

The idea is to create a BED file with GATK (you could also use samtools depth, though perhaps the GATK tool is more convenient (I don't know, I've never used that particular tool from GATK)). You can then filter the BAM files using samtools.

ADD REPLY
0
Entering edit mode

OK so Im already using samtools to convert sam to bam- is there a way of specifying inclusion in a bam file only for those loci with a certain read depth in the sam file? GATK seems a bit too complicated if samtools works (using it anyway)

ADD REPLY
0
Entering edit mode

No you can't: 'samtools view filters' the alignments but it has no knowledge of a 'window' of depth.

ADD REPLY
1
Entering edit mode
10.0 years ago

extract the Depth of coverage : https://www.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_coverage_DepthOfCoverage.php

filter the data and create a BED file containing the region of interest.

filter the BAMs with this bed and "samtools view -o new.bam -b -L your.bed old.bam"

ADD COMMENT
0
Entering edit mode

What if I already know my loci of interest as a txt file (or csv or whatever). Is there a way of cross referencing these with the original sam file to produce an updated one?

ADD REPLY
0
Entering edit mode

that was my last sentence...

ADD REPLY

Login before adding your answer.

Traffic: 1797 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6