privefl / bigsnpr

R package for the analysis of massive SNP arrays.
https://privefl.github.io/bigsnpr/
183 stars 43 forks source link

Script example-with-provided-LD.R does not work #487

Closed alhannae closed 3 months ago

alhannae commented 3 months ago

Hi Florian,

The script example-with-provided-LD.R does not work with the sumstats provided.

I get a warning when I read in the sumstats.

sumstats <- fread2("tmp-data/sumstats_BRCA.txt", na.strings = "NULL",
                    select = c("chr", "position_b37", "a0", "a1",
                               "bcac_onco_icogs_gwas_beta",
                              "bcac_onco_icogs_gwas_se"),
                    col.names = c("chr", "pos", "a0", "a1", "beta", "beta_se"))
Warning message:
In data.table::fread(input, ..., data.table = data.table, nThread = nThread) :
  Discarded single-line footer: <<3_42>>

When I then want to match the sumstats with hapmap, it errors because not enough variants have been matched. Do you also encounter the same error?

info_snp <- snp_match(sumstats, map_ldref)
1,847,056 variants to be matched.
9 ambiguous SNPs have been removed.
232,984 variants have been matched; 0 were flipped and 0 were reversed.
Error: Not enough variants have been matched.

Thanks very much for looking into this. Much appreciated!

Hannae

privefl commented 3 months ago
alhannae commented 3 months ago

Hi Florian,

I have ‘Package version 1.14.8’.

Apparently something goes wrong when downloading the file. But the strange thing is, it returned no error, it did not get interrupted but the file size is way smaller than when I download it manually. Those errors are fixed now.