The current GATK version is 3.8-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Get notifications!


You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

Got a problem?


1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?


Then follow instructions in Article#1894.

Formatting tip!


Wrap blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block as demonstrated here.

Jump to another community
Download the latest Picard release at https://github.com/broadinstitute/picard/releases.
GATK version 4.beta.3 (i.e. the third beta release) is out. See the GATK4 beta page for download and details.

CoverageBySample tool

redred Member
edited February 2013 in Ask the GATK team

I am also trying to check the coverage at each position of my reference using the CoverageBySample tool (with and without the –L argument):

java -Xmx30g -jar GenomeAnalysisTK.jar \
-T UnifiedGenotyper \
–T CoverageBySample \
–R ref.fasta  \
-I  input.bam  \
-o output.cov\

The output (below) is giving the right coverage but without the positions on the reference and also skipping all positions with no coverage. Is there any way to get these positions in the output file?

eo78       10
eo78       10
eo78       10
eo78       10
eo78       10
eo78       11
eo78       12
eo78       12
eo78       12
Post edited by Geraldine_VdAuwera on

Answers

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    Do you not get ref position info when you use an intervals list?

    Anyway this is a fairly primitive tool -- you would be better off using DepthOfCoverage or DiagnoseTargets.

  • FYI; CoverageBySample does not appear to be compatible with reducereads. I have been using this tool to calculate read depths over my exome intervals,

    java -Xmx2g -jar /home/jpriest/priest_apps/GATKv2.3.9/GenomeAnalysisTK.jar \

    -T CoverageBySample \
    -I "$i" \
    -R /home/jpriest/reference_genomes/hg19/ucsc.hg19.fasta \
    -L /home/jpriest/reference_genomes/exome_intervals/SeqCap_EZ_Exome_v2.samformat.new.intervals \
    -o "$i".basecoverage.txt

    awk {'print $2, $1}' "$i".basecoverage.txt | sort -n | awk 'BEGIN{c=0;sum=0;}{a[c++]=$1;sum+=$1;}END{ave=sum/c;if((c%2)==1){median=a[int(c/2)];}else{median=(a[c/2]+a[c/2-1])/2;}print sum," ",c," ",ave," ",median}' > "$i".coveragestats.txt

    However the mean read depth appears reduced after reduce reads is applied

    file 1 before RR 68.2454--> after RR 7.69979

    file 2 before RR 205.4--> after RR 6.95658

    Are there any suggestions on making accurate read depth calculations upon readreduced bam files?

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    Hi James,

    That's correct, this tool is not adapted to use reduced data. This is an older tool that is no longer updated and we plan to retire it soon, so you should switch to using DiagnoseTargets instead.

Sign In or Register to comment.