annotate_intermut_dist_PID {YAPSA} | R Documentation |
The function annotates the intermutational distance to a PID wide data frame
by applying rainfallTransform
to every
chromosome-specific subfraction of the PID wide data.
annotate_intermut_dist_PID(in_dat, in_CHROM.field = "CHROM", in_POS.field = "POS", in_mode = "min", in_verbose = FALSE)
in_dat |
VRanges object or data frame which carries (at least) one column for the chromosome and one column for the position. |
in_CHROM.field |
String indicating which column of |
in_POS.field |
String indicating which column of |
in_mode |
String passed to |
in_verbose |
Whether verbose or not. |
VRanges object or data frame identical to in_dat
, but with
the intermutation distance annotated as an additional column on the right
named dist
.
test_df <- data.frame( CHROM=c(1,1,1,2,2,2,3,3,3,4,4,4,5,5), POS=c(1,2,4,4,6,9,1,4,8,10,20,40,100,200), REF=c("C","C","C","T","T","T","A","A","A","G","G","G","N","A"), ALT=c("A","G","T","A","C","G","C","G","T","A","C","T","A","N")) min_dist_df <- annotate_intermut_dist_PID(test_df,in_CHROM.field="CHROM", in_POS.field="POS", in_mode="min") max_dist_df <- annotate_intermut_dist_PID(test_df,in_CHROM.field="CHROM", in_POS.field="POS", in_mode="max") min_dist_df max_dist_df