how to add new column in each maf dataframe? #1023
-
Hi there, I'm interested to visualize VAF in my cohort. I don't have VAF column in my MAF files. I read that I can calculate using ratio of counts of ref and alt allele. I've following code:
How do I add or calculate this column to the list of data frames I've? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, It depends on what columns your maf has. If your ref and alt counts are stored under mafs = data.table::rbindlist(l = mafs_datatable, use.names = TRUE, fill = TRUE, idcol = "Source_MAF")
mafs[,t_vaf := as.numeric(as.character(t_alt_count))/(as.numeric(as.character(t_ref_count)) + as.numeric(as.character(t_alt_count)))] |
Beta Was this translation helpful? Give feedback.
-
Hi @PoisonAlien Can VAF not be, VAF=t_alt/((t_alt+t_ref)*2) since there are two copies. Or VAF be VAF=t_alt/(t_ref) that is count of alt divided by ref only. Your suggested way Sorry this may see confusing. |
Beta Was this translation helpful? Give feedback.
Hi,
It's the option 3. You would like to estimate the frequency of the variant allele of the total depth.