match_by_pos()

match_by_pos(df1, df2, verbose = NULL, show_full_output = FALSE)

Arguments

df1

A dataframe of variants, has to contain CHROM and POS

df2

A dataframe of variants, has to contain CHROM and POS

verbose

A logical scalar (default: FALSE). Assign to TRUE to get information on which alleles are matched and which are not.

show_full_output

A logical scalar (default:FALSE). Assign to TRUE to show the full output from this function

Value

A list containing two dataframes, one of overlapping snps and the other snps not found in the second input dataset

Examples

# \donttest{
CD_UKBB_index_snps <- get_lead_snps(CD_UKBB)
match_by_pos(CD_UKBB_index_snps, CD_FINNGEN)
#> $found
#>   CHROM      POS REF1 ALT1          P1         E1 REF2 ALT2          P2
#> 1     1 67216513    G    A 8.03684e-20 -0.2517527    G    A 1.04321e-08
#> 2     5 40439961    C    T 7.42668e-11  0.1818381    C    T 2.80350e-13
#> 3    16 50485831    A    G 8.18444e-16  0.5591071    A    G 8.06046e-08
#> 4    16 50729867    G   GC 7.36933e-24  0.7618894    G   GC 1.49882e-09
#>          E2         ID
#> 1 -0.146556 rs11576518
#> 2  0.187984  rs7713270
#> 3  0.426680 rs76176364
#> 4  0.530875  rs2066847
#> 
#> $not_found
#>   CHROM       POS REF1 ALT1          P1         E1      ID_tmp
#> 1     2 233237298    A    C 1.70216e-09  0.1628839 2_233237298
#> 2     6  31660620    T    A 1.47082e-24  0.8893100  6_31660620
#> 3     6  32708532    A    C 1.27821e-15  0.5884587  6_32708532
#> 4     7  50274703    T    G 8.52335e-14  0.2077781  7_50274703
#> 5     9   4984530    G    C 5.03745e-11 -0.1833112   9_4984530
#> 
# }