Loading required namespace: GenomicFiles
Using local VCF.
File already tabix-indexed.
Finding empty VCF columns based on first 10,000 rows.
Dropping 1 duplicate column(s).
1 sample detected: ukb-e-R07_AFR
Constructing ScanVcfParam object.
VCF contains: 15,531,120 variant(s) x 1 sample(s)
Reading VCF file: multi-threaded (4 threads)
Dropping 1 duplicate column(s).

Dropping 1 duplicate column(s).

Dropping 1 duplicate column(s).

Dropping 1 duplicate column(s).

Renaming ID as SNP.
VCF file has -log10 P-values; these will be converted to unadjusted p-values in the 'P' column.
No INFO (SI) column detected.
Standardising column headers.
First line of summary statistics file: 
SNP	chr	BP	end	REF	ALT	FILTER	AF	ES	LP	SE	P	
Summary statistics report:
   - 15,026,066 rows
   - 15,025,983 unique variants
   - 0 genome-wide significant variants (P<5e-8)
   - 22 chromosomes
Checking for multi-GWAS.
Checking for multiple RSIDs on one row.
Inferring genome build.
Loading SNPlocs data.
Loading reference genome data.
Preprocessing RSIDs.
Validating RSIDs of 10,000 SNPs using BSgenome::snpsById...
Loading required package: BiocGenerics

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, aperm, append, as.data.frame, basename, cbind,
    colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
    get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
    Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
    table, tapply, union, unique, unsplit, which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:base’:

    expand.grid, I, unname

BSgenome::snpsById done in 45 seconds.
Loading SNPlocs data.
Loading reference genome data.
Preprocessing RSIDs.
Validating RSIDs of 10,000 SNPs using BSgenome::snpsById...
BSgenome::snpsById done in 73 seconds.
Inferred genome build: GRCH37
Checking SNP RSIDs.
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/logs/snp_missing_rs.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/logs/snp_multi_colon.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
445,051 SNP IDs appear to be made up of chr:bp, these will be replaced by their SNP ID from the reference genome
Loading SNPlocs data.
Found  Indels. These won't be checked against the reference genome as it does not contain Indels.
WARNING If your sumstat doesn't contain Indels, set the indel param to FALSE & rerun MungeSumstats::format_sumstats()
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/logs/snp_not_found_from_bp_chr.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
Checking for merged allele column.
Checking A1 is uppercase
Checking A2 is uppercase
Checking for incorrect base-pair positions
Ensuring all SNPs are on the reference genome.
Loading SNPlocs data.
Loading reference genome data.
Preprocessing RSIDs.
Validating RSIDs of 14,581,136 SNPs using BSgenome::snpsById...
BSgenome::snpsById done in 144 seconds.
Found 989,031 Indels. These won't be checked against the reference genome as it does not contain Indels.
WARNING If your sumstat doesn't contain Indels, set the indel param to FALSE & rerun MungeSumstats::format_sumstats()
Checking for correct direction of A1 (reference) and A2 (alternative allele).
There are 240 SNPs where neither A1 nor A2 match the reference genome. These will be removed.
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/logs/alleles_dont_match_ref_gen.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
There are 133 SNPs where A1 doesn't match the reference genome.
These will be flipped with their effect columns.
Reordering so first three column headers are SNP, CHR and BP in this order.
Reordering so the fourth and fifth columns are A1 and A2.
Checking for missing data.
Checking for duplicate columns.
Checking for duplicate SNPs from SNP ID.
Found 2 Indels. These won't be checked for duplicates based on RS ID as there can be multiples.
WARNING If your sumstat doesn't contain Indels, set the indel param to FALSE & rerun MungeSumstats::format_sumstats()
9,190 RSIDs are duplicated in the sumstats file. These duplicates will be removed
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/logs/dup_snp_id.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
Checking for SNPs with duplicated base-pair positions.
Found 2 Indels. These won't be checked for duplicates based on base-pair position as there can be multiples.
WARNING If your sumstat doesn't contain Indels, set the indel param to FALSE & rerun MungeSumstats::format_sumstats()
Checking for duplicated rows.
12 base-pair positions are duplicated in the sumstats file. These duplicates will be removed.
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/logs/dup_base_pair_position.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
INFO column not available. Skipping INFO score filtering step.
Filtering SNPs, ensuring SE>0.
Ensuring all SNPs have N<5 std dev above mean.
Checking for bi-allelic SNPs.
341,451 SNPs are non-biallelic. These will be removed.
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/logs/snp_bi_allelic.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
Computing Z-score from P using formula: `sign(BETA)*sqrt(stats::qchisq(P,1,lower=FALSE)`
Warning: When method is an integer, must be >0.
1,737,278 SNPs (13.2%) have FRQ values > 0.5. Conventionally the FRQ column is intended to show the minor/effect allele frequency.
The FRQ column was mapped from one of the following from the inputted  summary statistics file:
FRQ, EAF, FREQUENCY, FRQ_U, F_U, MAF, FREQ, FREQ_TESTED_ALLELE, FRQ_TESTED_ALLELE, FREQ_EFFECT_ALLELE, FRQ_EFFECT_ALLELE, EFFECT_ALLELE_FREQUENCY, EFFECT_ALLELE_FREQ, EFFECT_ALLELE_FRQ, A1FREQ, A1FRQ, A2FREQ, A2FRQ, ALLELE_FREQUENCY, ALLELE_FREQ, ALLELE_FRQ, AF, MINOR_AF, EFFECT_AF, A2_AF, EFF_AF, ALT_AF, ALTERNATIVE_AF, INC_AF, A_2_AF, TESTED_AF, AF1, ALLELEFREQ, ALT_FREQ, EAF_HRC, EFFECTALLELEFREQ, FREQ.A1.1000G.EUR, FREQ.A1.ESP.EUR, FREQ.ALLELE1.HAPMAPCEU, FREQ.B, FREQ1, FREQ1.HAPMAP, FREQ_EUROPEAN_1000GENOMES, FREQ_HAPMAP, FREQ_TESTED_ALLELE_IN_HRS, FRQ_A1, FRQ_U_113154, FRQ_U_31358, FRQ_U_344901, FRQ_U_43456, POOLED_ALT_AF, AF_ALT, AF.ALT, AF-ALT, ALT.AF, ALT-AF, A2.AF, A2-AF, AF.EFF, AF_EFF, AF_EFF
As frq_is_maf=TRUE, the FRQ column will not be renamed. If the FRQ values were intended to represent major allele frequency,
set frq_is_maf=FALSE to rename the column as MAJOR_ALLELE_FRQ and differentiate it from minor/effect allele frequency.
Sorting coordinates with 'data.table'.
Sorting coordinates with 'data.table'.
Writing in tabular format ==> /rds/general/project/neurogenomics-lab/ephemeral/MAGMA_Files_Public/data/GWAS_munged/ukb-e-R07_AFR/ukb-e-R07_AFR.tsv
Writing uncompressed instead of gzipped to enable tabix indexing.
Converting full summary stats file to tabix format for fast querying...
Reading header.
Ensuring file is bgzipped.
Tabix-indexing file.
Removing temporary .tsv file.
Summary statistics report:
   - 13,180,994 rows (87.7% of original 15,026,066 rows)
   - 13,180,994 unique variants
   - 0 genome-wide significant variants (P<5e-8)
   - 22 chromosomes
Done munging in 32.134 minutes.
Successfully finished preparing sumstats file, preview:
Reading header.
           SNP CHR     BP A1 A2    END FILTER     FRQ     BETA       LP      SE
1: rs561109771   1  11063  T  G  11063   PASS 0.01575 -0.17810 0.361611 0.22810
2: rs568792105   1 541944  T  C 541944   PASS 0.01896 -0.15890 0.363813 0.20260
3: rs538740799   1 672798  G  A 672798   PASS 0.01450  0.42140 1.077120 0.24370
4: rs548729314   1 691545  A  T 691545   PASS 0.04007 -0.14980 0.498804 0.14970
5:  rs12238997   1 693731  A  G 693731   PASS 0.24270 -0.09449 0.708631 0.07301
            P          Z
1: 0.43489959 -0.7808349
2: 0.43270010 -0.7845796
3: 0.08372979  1.7294433
4: 0.31709982 -1.0004354
5: 0.19560007 -1.2941892