how to calculate BAF and LRR from VCF or BCF files?
1
0
Entering edit mode
3.2 years ago
xiaoguang ▴ 160

Hi,

Do anyone know how to calculate BAF(B-allele frequency) and log R ratio from SNP calling pipeline( bcftoools mpileup & call) ?

I read some papers and I guess BAF can be calculated by (AD[2]/DP) and LRR can be calculated by [log2(cancer DP /normal DP)] , are that right?

I also want to know the level of allele specific CNV using ASCAT package. now I have paired samples (normal WGS and cancer WGS data), ASCAT need BAF and LRR from tumour and gemerline, but how to differ the tumour and gemerline variation?

SNP BAF LRR Variation • 2.3k views
ADD COMMENT
0
Entering edit mode

Hi @xiaoguang! Did you figure out if this is a valid way to calculate BAF and LRR?

ADD REPLY
0
Entering edit mode
16 months ago
Matt • 0

@xiaoguang

hi, have you got the answer?

I want to calculate the tumor purity with ASCAT.

I have tumor.bam and normal.bam from a WES pipeline, but I don't how to generate the input files like Tumor_LogR.txt, Tumor_BAF.txt, GC_file.txt, RT_file.txt, from bam or vcf files.

Is there any tool could do this?

ADD COMMENT
0
Entering edit mode

Hi, The ASCAT new version has introduced a new function called ascat.prepareHTS, which can be used to prepare all files that are required for predicting purity.

ADD REPLY
0
Entering edit mode

I'm having the same problem. ascat.prepareHTS seems like the solution, except when I run it, it seems to be looking for those files that I want it to create, so it fails. Is it something I'm doing wrong? Thanks in advance for the help.


ascat.prepareHTS( tumourseqfile = "/data/tumor.mapped.sort.bam", normalseqfile = "/data/normal.mapped.sort.bam", tumourname = "Tumour_name", normalname = "Normal_name", allelecounter_exe = "/usr/bin/bin/alleleCounter", alleles.prefix = "/data/ascat_reference/G1000_allelesAll_hg38/G1000_alleles_hg38", loci.prefix = "/data/ascat_reference/G1000_lociAll_hg38/G1000_lociAll_hg38", gender = "XX", genomeVersion = "hg38", chrom_names = c('chr1', 'chr2', 'chr3', 'chr4', 'chr5', 'chr6', 'chr7', 'chr8', 'chr9', 'chr10', 'chr11', 'chr12', 'chr13', 'chr14', 'chr15', 'chr16', 'chr17', 'chr18', 'chr19', 'chr20', 'chr21', 'chr22', 'chrX'), nthreads = 2, tumourLogR_file = "/data/ascat_out/Tumor_LogR.txt", tumourBAF_file = "/data/ascat_out/Tumor_BAF.txt", normalLogR_file = "/data/ascat_out/Germline_LogR.txt", normalBAF_file = "/data/ascat_out/Germline_BAF.txt", skip_allele_counting_tumour = 0, skip_allele_counting_normal = 0)

Error in readAlleleCountFiles(tumourAlleleCountsFile.prefix, ".txt", chrom_names, : length(files) > 0 is not TRUE

ADD REPLY
0
Entering edit mode

Most likely, ascat is not able to find the allele file from the prefix you provided. From documentation alleles.prefix: Prefix path to the allele data (e.g. "G1000_alleles_chr").

https://github.com/VanLoo-lab/ascat/blob/master/ASCAT/R/ascat.prepareHTS.R

In readAllelesFiles function

files=paste0(prefix, chrom_names, suffix)

If your files are like: /data/ascat_reference/G1000_allelesAll_hg38/G1000_alleles_hg38_chr1.txt Your prefix should be something like: alleles.prefix = "/data/ascat_reference/G1000_allelesAll_hg38/G1000_alleles_hg38_"

The other reason could be that the read counts mapping to the regions in all the files are zero.

ADD REPLY

Login before adding your answer.

Traffic: 1230 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