@@ -42,16 +42,18 @@ ezMethodGatkRnaHaplotyper = function(input=NA, output=NA, param=NA){
4242 ezSystem(' mv local.bam withRg.bam' )
4343 }
4444
45+ ezSystem(" samtools index withRg.bam" )
4546 cmd = paste(gatkCall , " SplitNCigarReads" ,
4647 " -R" , genomeSeq ,
4748 " -I" , " withRg.bam" ,
4849 " -L" , exomeInterVals ,
4950 # # this is the default! "-rf ReassignOneMappingQuality -RMQF 255 -RMQT 60 -U ALLOW_N_CIGAR_READS",
5051 " -O splitNtrim.bam" )
5152 ezSystem(cmd )
52-
53+ ezSystem(" samtools index splitNtrim.bam" )
54+
5355 # BaseRecalibration is done only if known sites are available
54- if (param $ knownSitesAvailable ){
56+ if (file.exists( dbsnpFile ) ){
5557 cmd = paste(gatkCall , " BaseRecalibrator" ,
5658 " -R" , genomeSeq ,
5759 " -I splitNtrim.bam" ,
@@ -68,13 +70,15 @@ ezMethodGatkRnaHaplotyper = function(input=NA, output=NA, param=NA){
6870 " --add-output-sam-program-record" ,
6971 " --bqsr-recal-file recal.table" ,
7072 " --output recal.bam" )
73+ ezSystem(cmd )
7174 } else {
7275 ezSystem(' mv splitNtrim.bam recal.bam' )
7376 }
77+ ezSystem(" samtools index recal.bam" )
7478
7579 # ########## haplotyping
7680 outputFile = basename(output $ getColumn(" GVCF" ))# paste0(sampleName, ".g.vcf.gz")
77- cmd = paste(gatkCal ,' HaplotypeCaller' ,
81+ cmd = paste(gatkCall ,' HaplotypeCaller' ,
7882 " -R" , genomeSeq ,
7983 " -I recal.bam" ,
8084 " -L" , exomeInterVals ,
0 commit comments