This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error in using the MetaSubtract package

Hi guys, I am working with the MetaSubtract package ( https://rdrr.io/cran/MetaSubtract/) in R. This package enables to subtract from the summary statistics of a meta-analysis the contribution of a single or multiple cohorts being part of that meta-analysis.

In doing it, I need to write down the following command:

meta.subtract("4BCX2_BAS_EA_GWAMA.out", "GCST90002379_Vuckovic2020_Ba_count.tsv", metamethod = "FIV", lambda.meta = 1, 
      lambdas.cohort = 1, gc_meta = FALSE, calculate_lambda.meta = FALSE, 
      calculate_lambdas.cohort = FALSE, alternative = "alternative_headers.txt", 
      save.as.data.frame = TRUE, 
      savefile = "BCX2_BAS_EA2020_withoutUKBB_MetaSubtract.txt"
      )

where 4BCX2_BAS_EA_GWAMA.out is the sumstats of the meta-analysis, and it has the following aspect:

rs_number   reference_allele    other_allele    eaf beta    se  beta_95L    beta_95U    z   p-value _-log10_p-value q_statistic q_p-value   i2  n_studies   n_samples   effects
10:100000625_A_G    G   A   0.433704    -0.000714   0.002061    -0.004755   0.003326    -0.346486   0.728988    0.137280    16.477536   0.224301    0.211047    14  473945  --+--+--++-+-+
10:100000645_A_C    C   A   0.204581    0.001467    0.002534    -0.003500   0.006433    0.578794    0.562750    0.249684    12.374311   0.497215    0.000000    14  473977  +-++--++--+-+-
10:100002464_C_T    C   T   0.013921    -0.002998   0.009265    -0.021157   0.015161    -0.323600   0.746248    0.127117    12.893690   0.456057    0.000000    14  474001  +++---++++-+++
10:100003242_G_T    G   T   0.115296    -0.003044   0.003200    -0.009315   0.003228    -0.951205   0.341491    0.466621    12.762988   0.466281    0.000000    14  473999  --++++-------+

GCST90002379_Vuckovic2020_Ba_count.tsv is the sumstats of the single cohort which I want to remove from the meta-analysis and it has the following aspect:

 VARIANT    other_allele    effect_allele   beta    p_value standard_error  effect_allele_frequency     
    1:10177_A_AC     A  AC  -0.00282646 0.39    0.00329265  0.398249    0.398249    0.00000382901614652101  
    1:10352_T_TA        T   TA  0.0038701   0.25    0.00339105  0.392805    0.392805    0.00000714462704979404  
    1:10511_G_A     G   A   -0.029287   0.53    0.0469668   0.00126099999999996 0.00126099999999996 0.00000216046316283424  

while I wrote the alternative_headers.txt" file in this way:

MARKER rs_number
MARKER VARIANT  
EFFECTALLELE reference_allele
EFFECTALLELE effect_allele
OTHERALLELE other_allele
OTHERALLELE other_allele
BETA beta
BETA beta
EAF eaf
EAF effect_allele_frequency
NSTUDIES n_studies
I2HET i2
P p-value
P p_value
SE se
SE standard_error
Z z
QHETP q_p-value
LP LP
QHET q_statistic
DIRECTIONS effects
N n_samples

in the first column you can see the variable names as used in the script, the second one contains the header names as specified in the input files.

When I run the meta.subtract() command, I got the following error message:

Error in if (markercol == 0) { : argument is of length zero

I checked the source code at the following page https://rdrr.io/cran/MetaSubtract/src/R/MetaSubtract.r and it seems to be a problem related to the MARKER column... but I don't know how to fix it...

Could someone suggest how to fix it? Thank you!

summary statistics metasubtract r

I think alternative_headers.txt needs a header row, try adding "col1 col2" in the first row.

It still does not work and I got the same error message

0 answers

No answers yet.

Log in to answer this question.