构建ascat_example.R,用于后续每个样本的模板
library(ASCAT)
ascat.prepareHTS(
tumourseqfile = "/home/zhoukaiwen/IBC/WES/align/Tumor_name_bqsr.bam",
normalseqfile = "/home/zhoukaiwen/IBC/WES/align/Normal_name_bqsr.bam",
tumourname = "Tumor_name",
normalname = "Normal_name",
allelecounter_exe = "/home/zhoukaiwen/software/anaconda3/bin/alleleCounter",
alleles.prefix = "/home/zhoukaiwen/database/G1000_allelesAll_hg19/G1000_alleles_hg19_chr",
loci.prefix = "/home/zhoukaiwen/database/G1000_lociAll_hg19/G1000_loci_hg19_chr",
gender = "XX",
genomeVersion = "hg19",
nthreads = 4,
tumourLogR_file = "Tumor_name_LogR.txt",
tumourBAF_file = "Tumor_name_BAF.txt",
normalLogR_file = "Normal_name_LogR.txt",
normalBAF_file = "Normal_name_BAF.txt")
ascat.bc = ascat.loadData(Tumor_LogR_file = "Tumor_name_LogR.txt", Tumor_BAF_file = "Tumor_name_BAF.txt" Germline_LogR_file = "Normal_name_LogR.txt", Germline_BAF_file = "Normal_name_BAF.txt", gender = 'XX', genomeVersion = "hg19")
ascat.plotRawData(ascat.bc, img.prefix = "Before_correction_")
ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = "/home/zhoukaiwen/database/GC_G1000_hg19.txt", replictimingfile = "/home/zhoukaiwen/database/RT_G1000_hg19.txt")
ascat.plotRawData(ascat.bc, img.prefix = "After_correction_")
ascat.bc = ascat.aspcf(ascat.bc)
ascat.plotSegmentedData(ascat.bc)
ascat.output = ascat.runAscat(ascat.bc, gamma=1, write_segments = T)
QC = ascat.metrics(ascat.bc,ascat.output)
save(ascat.bc, ascat.output, QC, file = 'Tumor_name_ASCAT_objects.Rdata')
构建shell脚本用于批量运行ASCAT
for n in `ls ../align/*-T_bqsr.bam|sed 's/\.\.\/align\///g'|sed 's/\_bqsr\.bam//g'|sed 's/\-T//g'`; do echo cp ascat_example.R $n\_RunAscat.R \&\& sed -i \'s/Tumor\_name/$n-T/g\' $n\_RunAscat.R \&\& sed -i \'s/Normal\_name/$n-B/g\' $n\_RunAscat.R \&\& Rscript $n\_RunAscat.R \&\& echo $n ASCAT Done >> CreateASCATRscript.sh;done
将ASCAT结果的segment.txt 转换为GISTIC input