def run_haplotype_caller(args): blue("Going for STAGE_6 - run_haplotype_caller") with cwd(joiner(args.hg, "chromFa")): cmd = ( "module add " + ngs_tools_dict["GATK"] + " && $GATK_RUN -T HaplotypeCaller -R hg19.fa -I recal_reads.bam -L chr20 --genotyping_mode DISCOVERY -stand_call_conf 30 -stand_emit_conf 10 -o raw_variants.vcf" ) run_command(cmd, Exception) ok("Done!")
def marking_PCR_duplicates(args): blue("Going for STAGE_3 - marking_PCR_duplicates") with cwd(joiner(args.hg, "chromFa")): cmd = ( "module add " + ngs_tools_dict["Picard"] + " && $PICARDRUN MarkDuplicates INPUT=output.bam OUTPUT=output.marked.bam METRICS_FILE=metrics CREATE_INDEX=true VALIDATION_STRINGENCY=LENIENT" ) run_command(cmd, Exception) ok("done")
def SAM_to_BAM_conversion(args): blue("Going for STAGE_2 - SAM_to_BAM_conversion") with cwd(joiner(args.hg, "chromFa")): cmd = ( "module add " + ngs_tools_dict["Picard"] + " && $PICARDRUN SortSam SO=coordinate INPUT=out.sam OUTPUT=output.bam VALIDATION_STRINGENCY=LENIENT CREATE_INDEX=true" ) run_command(cmd, Exception) ok("done")
def actual_alignment(args): blue("Going for STAGE_1 - actual_alignment") with cwd(joiner(args.hg, "chromFa")): cmds = [ "module add " + ngs_tools_dict["bwa"] + " && bwa aln -t 4 -f input.sai hg19 input.fastq", "module add " + ngs_tools_dict["bwa"] + ' && bwa samse -f out.sam -r "@RG\tID:bwa\tLB:Exome1Lib\tSM:Exome1Sampl\tPL:ILLUMINA" hg19 input.sai input.fastq', ] run_commands(cmds, Exception) ok("done")
def quality_score_recalibration(args): blue("Going for STAGE_5 - quality_score_recalibration") with cwd(joiner(args.hg, "chromFa")): cmds = [ "module add " + ngs_tools_dict["GATK"] + " && $GATK_RUN -T BaseRecalibrator -R hg19.fa -I input_bam.marked.realigned.fixed.bam -L chr20 -knownSites dbsnp_138.hg19.vcf -o recal_data.table", "module add " + ngs_tools_dict["GATK"] + " && $GATK_RUN -T PrintReads -R hg19.fa -I input_bam.marked.realigned.fixed.bam -L chr20 -BQSR recal_data.table -o recal_reads.bam", ] run_commands(cmds, Exception) ok("Done!")
def local_realignment(args): blue("Going for STAGE_4 - local_realignment") with cwd(joiner(args.hg, "chromFa")): cmds = [ "module add " + ngs_tools_dict["GATK"] + " && $GATK_RUN -T RealignerTargetCreator -R hg19.fa -o input.bam.list -I output.marked.bam", "module add " + ngs_tools_dict["GATK"] + " && $GATK_RUN -I output.marked.bam -R hg19.fa -T IndelRealigner -targetIntervals input.bam.list -o input.marked.realigned.bam", "module add " + ngs_tools_dict["Picard"] + " && $PICARDRUN FixMateInformation INPUT=input.marked.realigned.bam OUTPUT=input_bam.marked.realigned.fixed.bam SO=coordinate VALIDATION_STRINGENCY=LENIENT CREATE_INDEX=true", ] run_commands(cmds, Exception) ok("Done!")