UNFINISHED ERRCODE on logistic regression

220 views
Skip to first unread message

MS WOO

unread,
Dec 10, 2024, 12:08:24 AM12/10/24
to plink2-users
Dear all,

I attempted to compare my cohort with the 1000 Genomes EAS cohort using PLINK2 logistic regression. 

Below is the code I used:  

plink2 --bfile [path]/thy_eas_merged \
       --glm hide-covar \
       --pheno  [path]/merge_pheno.txt \
       --pheno-name THYROID \
       --covar  [path]/merged_cova.txt \
       --covar-name PC1-PC5 \
       --out  [path]/20241210-logistic

However, the results seem to have an issue.

The ERRCODE column in the output contains "UNFINISHED" for all rows, as shown below:
  
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     1.30573 1.05916 0.251861        0.801148        UNFINISHED
1       707522  1:707522        G       C       Y       C       G       0.112026        Y       ADD     607     1.14332 0.965216        0.138761        0.889639        UNFINISHED
1       711310  1:711310        G       A       Y       A       G       0.0617792       Y       ADD     607     1.43888 1.2434  0.292636        0.769801        UNFINISHED

Additionally, here is the log file for reference:

PLINK v2.00a6LM 64-bit Intel (6 Aug 2024)
Options in effect:
  --bfile  [path]/thy_eas_merged
  --covar  [path]/merged_cova.txt
  --covar-name PC1-PC5
  --glm hide-covar
  --out  [path]/20241210-logistic
  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID

Hostname: bts-Precision-5820-Tower-X-Series
Working directory: /mnt/HDD2/WMS/plink_sw/Plink
Start time: Tue Dec 10 12:28:10 2024

Random number seed: 1733801290
257446 MiB RAM detected, ~43598 available; reserving 43534 MiB for main
workspace.
Using up to 28 threads (change this with --threads).
607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
5 covariates loaded from  [path]/merged_cova.txt.
Calculating allele frequencies... done.
--glm logistic-Firth hybrid regression on phenotype 'THYROID': done.
Results written to  [path]/20241210-logistic.THYROID.glm.logistic.hybrid .

End time: Tue Dec 10 12:33:29 2024

Could someone help identify whether there is an issue with my code or the log file? 
Any insights would be greatly appreciated.

Chris Chang

unread,
Dec 10, 2024, 3:20:13 AM12/10/24
to MS WOO, plink2-users
1. Try rerunning with the latest build; there was a convergence bugfix in October.

2. If that does not change the result, is it possible for you to post a set of files (could have most of the variants omitted) that lets me reproduce what you’re seeing?

--
You received this message because you are subscribed to the Google Groups "plink2-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plink2-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/plink2-users/272d3f33-15a5-4bdb-8c7c-7879c6ba478an%40googlegroups.com.

MS WOO

unread,
Dec 10, 2024, 4:42:53 AM12/10/24
to plink2-users
Thank you for reply!

1. I followed recommendation and downloaded plink2_linux_avx2_20241206.zip to rerun, but I didn't see any difference.

2. Thank you for concerning, but it is difficult to share files.  (Because of the privacy. Sorry.)

I have checked various factors and suspect the issue might have occurred during the PC extraction process.

The PCA plot appears to show significant bias.
sc1.png

Does it make a issue with PC when merging the cohort with EAS?

Thanks again with reply.
2024년 12월 10일 화요일 오후 5시 20분 13초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 10, 2024, 8:10:36 AM12/10/24
to MS WOO, plink2-users
1. Does adding “—threads 1 —randmem —seed 1” to the command line change the result at all?

2. Is it possible for you to run a sequence of debug builds?

MS WOO

unread,
Dec 10, 2024, 9:31:35 AM12/10/24
to plink2-users
1. Nope. I didnt't add any option like "threads" or "randmem". After I downloaded latest build, I just ran the same code what I did.
    
    Should I try that option?

2. May be. Sharing is limited, but editing code or files will be available.

Thanks for reply! 
2024년 12월 10일 화요일 오후 10시 10분 36초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 10, 2024, 9:43:25 AM12/10/24
to MS WOO, plink2-users
1. Ok, yes, you should try that.  Also add “—snp 1:649192 —memory 8000”.

2. Once you report the result for that test, I will try to create a suitable debug build for you to run.

MS WOO

unread,
Dec 10, 2024, 8:25:16 PM12/10/24
to plink2-users
1. Code 
plink2 --bfile [path]/thy_eas_merged \
       --glm hide-covar \
       --pheno [path]/merge_pheno.txt \
       --pheno-name THYROID \
       --covar [path]/PC5.eigenvec \
       --covar-name PC1-PC5 \
       --threads 1 \
       --randmem \
       --seed 1 \
       --snp 1:649192 \
       --memory 8000 \
       --out [path]/20241211-logistic3

2. result
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     NA      NA      NA      NA      FIRTH_CONVERGE_FAIL

3. log
PLINK v2.00a6LM 64-bit Intel (6 Aug 2024)      www.cog-genomics.org/plink/2.0/
(C) 2005-2024 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to  [path]/20241211-logistic3.log.

Options in effect:
  --bfile  [path]/thy_eas_merged
  --covar  [path]/PC5.eigenvec
  --covar-name PC1-PC5
  --glm hide-covar
  --memory 8000
  --out  [path]/20241211-logistic3

  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID
  --randmem
  --seed 1
  --snp 1:649192
  --threads 1

Start time: Wed Dec 11 10:17:22 2024
257446 MiB RAM detected, ~42536 available; reserving 8000 MiB for main
workspace.
Using 1 compute thread.

607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
--snp: 1 variant remaining.
5 covariates loaded from  [path]/PC5.eigenvec.
Calculating allele frequencies... done.
1 variant remaining after main filters.

--glm logistic-Firth hybrid regression on phenotype 'THYROID': done.
Results written to  [path]/20241211-logistic3.THYROID.glm.logistic.hybrid .
End time: Wed Dec 11 10:17:26 2024

It looks like issue is still remaining.

Does computing option (threads, randmem, memory, etc) affects the result? 

I thought it only affects on speed of the calculating.

Thank you.
2024년 12월 10일 화요일 오후 11시 43분 25초 UTC+9에 chrch...@gmail.com님이 작성:

Christopher Chang

unread,
Dec 11, 2024, 3:13:45 AM12/11/24
to plink2-users
Can you report the result with the 20241206 build?

MS WOO

unread,
Dec 11, 2024, 4:10:21 AM12/11/24
to plink2-users
I don't understand what is "20241206build". Is there extra update on plink2 build?

2024년 12월 11일 수요일 오후 5시 13분 45초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 11, 2024, 7:01:03 AM12/11/24
to MS WOO, plink2-users
From December 6.  You said you already downloaded it and tried running it without —threads 1, etc.

Chris Chang

unread,
Dec 11, 2024, 1:34:27 PM12/11/24
to MS WOO, plink2-users
First debug build has been posted to https://s3.amazonaws.com/plink2-assets/plink2_linux_avx2_20241211a.zip (or you can build from source on GitHub).  Post the .log you get from running with these flags (--threads 1, etc.) plus the --debug flag.

MS WOO

unread,
Dec 12, 2024, 7:55:02 PM12/12/24
to plink2-users
Thank you for answer!

I'll try with debug build, and share the result.

2024년 12월 12일 목요일 오전 3시 34분 27초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 16, 2024, 7:03:36 AM12/16/24
to MS WOO, plink2-users

MS WOO

unread,
Dec 16, 2024, 9:00:01 PM12/16/24
to plink2-users
Sorry, I totally forgot for sharing this issue.

1. Code
  ./plink2 --bfile  [path]/thy_eas_merged \ 
                --glm hide-covar \ 
                --pheno  [path]/merge_pheno.txt \ 
                --pheno-name THYROID \ 
                --covar  [path]/PC5.eigenvec \ 
                --covar-name PC1-PC5 \ 
                --threads 1 \ 
                --snp 1:649192 \ 
                --debug \ 
                --out  [path]/20241217-logistic

I ran the debug version of plink2 using "./" because another version of plink2 is installed in another directory. 

If there is an issue with the code, I will modify it and try again.

2. Log
PLINK v2.0.0-a.6.*LM AVX2 Intel (11 Dec 2024)

Options in effect:
  --bfile  [path]/thy_eas_merged
  --covar  [path]/PC5.eigenvec
  --covar-name PC1-PC5
  --debug
  --glm hide-covar
  --out  [path]/20241217-logistic

  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID
  --snp 1:649192
  --threads 1

Hostname: bts-Precision-5820-Tower-X-Series
Working directory:  [path]/Plink_debug
Start time: Tue Dec 17 10:45:03 2024

Random number seed: 1734399903
257446 MiB RAM detected, ~29494 available; reserving 29430 MiB for main

workspace.
Using 1 compute thread.
607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
--snp: 1 variant remaining.
5 covariates loaded from  [path]/PC5.eigenvec.
Calculating allele frequencies... done.
1 variant remaining after main filters.
--glm logistic-Firth hybrid regression on phenotype 'THYROID': FirthRegressionD sample_ct: 607
FirthRegressionD loglik: -420.054  dethh: 3.94683
done.
Results written to  [path]/20241217-logistic.THYROID.glm.logistic.hybrid .

3. Result
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     NA      NA      NA      NA      FIRTH_CONVERGE_FAIL

Thank you for your support and feedback, but I think the issue may not be with plink2 itself.  

It may be with the cohort data I am working with. (I have checked various elements, and it seems that the issue lies with the PC plot.)

Thanks a lot.  
2024년 12월 16일 월요일 오후 9시 3분 36초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 17, 2024, 3:23:45 AM12/17/24
to MS WOO, plink2-users
No, there is DEFINITELY a problem with plink2 because the ERRCODE was different between the —threads 1 … configuration and your original configuration.  I will post another debug build for you to run in a few hours.

Christopher Chang

unread,
Dec 17, 2024, 12:00:14 PM12/17/24
to plink2-users
Second AVX2 debug build has been posted to https://s3.amazonaws.com/plink2-assets/plink2_linux_avx2_20241217a.zip .

MS WOO

unread,
Dec 17, 2024, 8:52:17 PM12/17/24
to plink2-users
Thank you for reply!

1. Code
  ./plink2 --bfile  [path]/thy_eas_merged \ 
                --glm hide-covar \ 
                --pheno  [path]/merge_pheno.txt \ 
                --pheno-name THYROID \ 
                --covar  [path]/PC5.eigenvec \ 
                --covar-name PC1-PC5 \ 
                --threads 1 \ 
                 --snp 1:649192 \ 
                 --debug \ 
                 --out  [path]/20241218-logistic

2. Log
PLINK v2.0.0-a.6.4.bLM AVX2 Intel (17 Dec 2024)

Options in effect:
  --bfile  [path]/thy_eas_merged
  --covar  [path]/PC5.eigenvec
  --covar-name PC1-PC5
  --debug
  --glm hide-covar
  --out  [path]/20241218-logistic

  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID
  --snp 1:649192
  --threads 1

Hostname: bts-Precision-5820-Tower-X-Series
Working directory:  [path]/plink_sw/Plink_debug
Start time: Wed Dec 18 10:41:29 2024

Random number seed: 1734486089
257446 MiB RAM detected, ~19972 available; reserving 19908 MiB for main

workspace.
Using 1 compute thread.
607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
--snp: 1 variant remaining.
5 covariates loaded from  [path]/PC5.eigenvec.
Calculating allele frequencies... done.
1 variant remaining after main filters.
--glm logistic-Firth hybrid regression on phenotype 'THYROID': FirthRegressionD sample_ct: 607
FirthRegressionD loglik: -420.054  dethh: 3.94683
FirthRegressionD: failed to invert matrix
done.
Results written to  [path]/20241218-logistic.THYROID.glm.logistic.hybrid .

End time: Wed Dec 18 10:41:30 2024
[path]/20241218-logistic.log (END)


3. Result
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     NA      NA      NA      NA      FIRTH_CONVERGE_FAIL

Other question about using plink2 -debug.
Now, I have two plink2 versions. One is I downloaded on plink2 web site, the other is debug version(posted on).
When I'm using plink2 without "./" sign, which version is used for my code?
2024년 12월 18일 수요일 오전 2시 0분 14초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 18, 2024, 5:22:47 PM12/18/24
to MS WOO, plink2-users

On Wed, Dec 18, 2024 at 5:21 PM Chris Chang <chrch...@gmail.com> wrote:
Thanks, third AVX2 debug build posted to https://s3.amazonaws.com/plink2-assets/plink2_linux_avx2_20241217b.zip .

As for running plink2 without leading "./", that depends on your system PATH.  "which plink2" should tell you the full path of the binary you're executing (https://en.wikipedia.org/wiki/Which_(command) ).

MS WOO

unread,
Dec 18, 2024, 8:45:36 PM12/18/24
to plink2-users
OK I'll try again with 20241218a version.

1. code
./plink2 --bfile  [path]/thy_eas_merged \
       --glm hide-covar \
       --pheno  [path]/merge_pheno.txt \
       --pheno-name THYROID \
       --covar  [path]/PC5.eigenvec \
       --covar-name PC1-PC5 \
       --threads 1 \
       --snp 1:649192 \
       --debug \
       --out  [path]/20241219-logistic

2. log
PLINK v2.0.0-a.6.4.cLM AVX2 Intel (17 Dec 2024)

Options in effect:
  --bfile  [path]/thy_eas_merged
  --covar  [path]/PC5.eigenvec
  --covar-name PC1-PC5
  --debug
  --glm hide-covar
  --out  [path]/20241219-logistic

  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID
  --snp 1:649192
  --threads 1

Hostname: bts-Precision-5820-Tower-X-Series
Working directory:  [path]/Plink_debug
Start time: Thu Dec 19 10:37:48 2024

Random number seed: 1734572268
257446 MiB RAM detected, ~17751 available; reserving 17687 MiB for main

workspace.
Using 1 compute thread.
607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
--snp: 1 variant remaining.
5 covariates loaded from  [path]/PC5.eigenvec.
Calculating allele frequencies... done.
1 variant remaining after main filters.
--glm logistic-Firth hybrid regression on phenotype 'THYROID': FirthRegressionD sample_ct: 607
FirthRegressionD loglik: -420.054  dethh: 3.94683
FirthRegressionD: failed to invert matrix
done.
Results written to  [path]/20241219-logistic.THYROID.glm.logistic.hybrid .

End time: Thu Dec 19 10:37:49 2024

3. result
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     NA      NA      NA      NA      FIRTH_CONVERGE_FAIL

2024년 12월 19일 목요일 오전 7시 22분 47초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 18, 2024, 8:55:07 PM12/18/24
to MS WOO, plink2-users

MS WOO

unread,
Dec 19, 2024, 7:21:09 AM12/19/24
to plink2-users
It's Okay! I try again wtih new version.
1. Code
./plink2 --bfile  [path]/thy_eas_merged \
       --glm hide-covar \
       --pheno  [path]/merge_pheno.txt \
       --pheno-name THYROID \
       --covar  [path]/PC5.eigenvec \
       --covar-name PC1-PC5 \
       --threads 1 \
       --snp 1:649192 \
       --debug \
       --out  [path]/20241219-logistic

2. Log
PLINK v2.0.0-a.6.4.dLM AVX2 Intel (18 Dec 2024)

Options in effect:
  --bfile  [path]/thy_eas_merged
  --covar  [path]/PC5.eigenvec
  --covar-name PC1-PC5
  --debug
  --glm hide-covar
  --out  [path]/20241219-logistic
  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID
  --snp 1:649192
  --threads 1

Hostname: bts-Precision-5820-Tower-X-Series
Working directory:  [path]/Plink_debug
Start time: Thu Dec 19 21:14:04 2024

Random number seed: 1734610444
257446 MiB RAM detected, ~12137 available; reserving 12073 MiB for main

workspace.
Using 1 compute thread.
607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
--snp: 1 variant remaining.
5 covariates loaded from  [path]/PC5.eigenvec.
Calculating allele frequencies... done.
1 variant remaining after main filters.
--glm logistic-Firth hybrid regression on phenotype 'THYROID': GlmLogisticThreadD: cur_is_always_firth=1  is_always_firth=0

FirthRegressionD sample_ct: 607
FirthRegressionD loglik: -420.054  dethh: 3.94683
FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.251115 0.251628 0.252991 0.251229 0.251344 ... 0.256714 0.260444 0.253602 0.259885 0.253175 (-nan) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ -nan -nan -nan 2.11402e-307 -nan -nan -nan (-nan) ]
[ -nan -nan -nan -nan 1.54358e-308 3.41849e-308 -nan (-nan) ]
[ -nan -nan -nan -nan -nan -nan 1.47051e-307 (-nan) ]
[ -nan -nan -nan -nan -nan -nan -nan (-nan) ]
[ -nan -nan -nan -nan -nan 4.2953e-308 -nan (-nan) ]
[ -nan -nan -nan -nan -nan -nan -nan (-nan) ]
[ -nan -nan -nan -nan -nan -nan -nan (-nan) ]

FirthRegressionD: failed to invert matrix
done.
Results written to  [path]/20241219-logistic.THYROID.glm.logistic.hybrid .

End time: Thu Dec 19 21:14:05 2024

3. Result
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     NA      NA      NA      NA      FIRTH_CONVERGE_FAIL

Looking at the log file, it seems like something has changed, but the result is the same. Should we apply it to other SNPs?
2024년 12월 19일 목요일 오전 10시 55분 7초 UTC+9에 chrch...@gmail.com님이 작성:

Christopher Chang

unread,
Dec 19, 2024, 12:54:53 PM12/19/24
to plink2-users
Okay, I might have figured out the problem.  See if the single-SNP regression now works with https://s3.amazonaws.com/plink2-assets/plink2_linux_avx2_20241219a.zip .  Then, if it does, try your original command (without --threads 1, etc.) and see if that now also works.

MS WOO

unread,
Dec 19, 2024, 10:18:14 PM12/19/24
to plink2-users
1. code (same)

2. log
Log is too long. So I attach the part of it.
...

FirthRegressionD sample_ct: 607
FirthRegressionD loglik: -420.054  dethh: 3.94683
FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.251115 0.251628 0.252991 0.251229 0.251344 ... 0.256714 0.260444 0.253602 0.259885 0.253175 (0.25) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 153.5 -nan -nan 2.11402e-307 -nan -nan -nan (-nan) ]
[ 29.3111 32.9526 -nan -nan 1.54358e-308 3.41849e-308 -nan (-nan) ]
[ -0.0290907 -0.0417855 0.253737 -nan -nan -nan 1.47051e-307 (-nan) ]
[ -0.0089276 -0.0138366 0.000949957 0.254135 -nan -nan -nan (-nan) ]
[ -0.00827192 0.138073 0.000436656 -7.13069e-05 0.252625 4.2953e-308 -nan (-nan) ]
[ 0.00505738 -0.146722 -0.000168997 -8.60885e-05 9.13099e-05 0.25498 -nan (-nan) ]
[ 0.00117595 -0.0320434 -0.000124766 -0.000170271 -1.46458e-05 8.36869e-05 0.25668 (-nan) ]
FirthRegressionD loglik: -318.084  dethh: 3.11311

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.242286 0.242954 0.244693 0.242646 0.243708 ... 0.248375 0.251097 0.245394 0.252335 0.24502 (0.235004) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 148.343 -0.00702544 -0.000266114 -0.0001064 0.00409892 -0.00419983 -0.000911632 (0) ]
[ 28.3265 31.8469 0.00529775 0.00174094 -0.0203527 0.0213179 0.00462032 (0) ]
[ -0.0307299 -0.0405422 0.245282 -0.0144552 -0.00972386 0.0056642 0.00256671 (0) ]
[ -0.00975841 -0.0132563 0.000974816 0.245651 0.000180033 0.00232191 0.00282041 (0) ]
[ -0.00831913 0.133241 0.000396015 -4.39563e-05 0.244177 -0.0132199 -0.00233336 (0) ]
[ 0.00728035 -0.141123 -0.000253717 -0.000133554 0.000135705 0.246545 0.00140136 (0) ]
[ 0.000700003 -0.0310161 -0.000101705 -0.000179098 9.81111e-06 1.31626e-05 0.248233 (0) ]
...

3. Result
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     4.71683 0.931014        1.66607 0.0956989       UNFINISHED
ERRCODE changed into "UNFINISHED". Does it work?
2024년 12월 20일 금요일 오전 2시 54분 53초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 20, 2024, 3:27:08 AM12/20/24
to MS WOO, plink2-users
Is it possible for you to send me the full log?

Have you checked whether the result is the same when you run your original command (without —threads 1, —snp, —debug, etc.)?

MS WOO

unread,
Dec 22, 2024, 1:44:55 AM12/22/24
to plink2-users
Sure.

1. Log
PLINK v2.0.0-a.6.4.eLM AVX2 Intel (19 Dec 2024)

Options in effect:
  --bfile [path]/thy_eas_merged
  --covar  [path]/PC5.eigenvec
  --covar-name PC1-PC5
  --debug
  --glm hide-covar
  --out  [path]/20241220-logistic

  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID
  --snp 1:649192
  --threads 1

Hostname: bts-Precision-5820-Tower-X-Series
Working directory:  [path]/plink_sw/Plink_debug
Start time: Fri Dec 20 12:10:49 2024

Random number seed: 1734664249
257446 MiB RAM detected, ~11881 available; reserving 11817 MiB for main

workspace.
Using 1 compute thread.
607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
--snp: 1 variant remaining.
5 covariates loaded from  [path]/PC5.eigenvec.
Calculating allele frequencies... done.
1 variant remaining after main filters.
--glm logistic-Firth hybrid regression on phenotype 'THYROID': GlmLogisticThreadD: cur_is_always_firth=1  is_always_firth=0
FirthRegressionD sample_ct: 607
FirthRegressionD loglik: -420.054  dethh: 3.94683
FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.251115 0.251628 0.252991 0.251229 0.251344 ... 0.256714 0.260444 0.253602 0.259885 0.253175 (0.25) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 153.5 -nan -nan 2.11402e-307 -nan -nan -nan (-nan) ]
[ 29.3111 32.9526 -nan -nan 1.54358e-308 3.41849e-308 -nan (-nan) ]
[ -0.0290907 -0.0417855 0.253737 -nan -nan -nan 1.47051e-307 (-nan) ]
[ -0.0089276 -0.0138366 0.000949957 0.254135 -nan -nan -nan (-nan) ]
[ -0.00827192 0.138073 0.000436656 -7.13069e-05 0.252625 4.2953e-308 -nan (-nan) ]
[ 0.00505738 -0.146722 -0.000168997 -8.60885e-05 9.13099e-05 0.25498 -nan (-nan) ]
[ 0.00117595 -0.0320434 -0.000124766 -0.000170271 -1.46458e-05 8.36869e-05 0.25668 (-nan) ]
FirthRegressionD loglik: -318.084  dethh: 3.11311
FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.242286 0.242954 0.244693 0.242646 0.243708 ... 0.248375 0.251097 0.245394 0.252335 0.24502 (0.235004) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 148.343 -0.00702544 -0.000266114 -0.0001064 0.00409892 -0.00419983 -0.000911632 (0) ]
[ 28.3265 31.8469 0.00529775 0.00174094 -0.0203527 0.0213179 0.00462032 (0) ]
[ -0.0307299 -0.0405422 0.245282 -0.0144552 -0.00972386 0.0056642 0.00256671 (0) ]
[ -0.00975841 -0.0132563 0.000974816 0.245651 0.000180033 0.00232191 0.00282041 (0) ]
[ -0.00831913 0.133241 0.000396015 -4.39563e-05 0.244177 -0.0132199 -0.00233336 (0) ]
[ 0.00728035 -0.141123 -0.000253717 -0.000133554 0.000135705 0.246545 0.00140136 (0) ]
[ 0.000700003 -0.0310161 -0.000101705 -0.000179098 9.81111e-06 1.31626e-05 0.248233 (0) ]
FirthRegressionD loglik: -236.39  dethh: 1.55225

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.218146 0.219196 0.221871 0.219118 0.222565 ... 0.225441 0.225623 0.222812 0.231388 0.222577 (0.227266) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 134.197 -0.00726945 -0.000194553 -7.08811e-05 0.00424651 -0.00440364 -0.000931292 (0) ]
[ 25.6258 28.8137 0.00543252 0.00175544 -0.0210391 0.0220204 0.00477967 (0) ]
[ -0.0348734 -0.0371173 0.222077 -0.0158929 -0.00959172 0.0073084 0.00233864 (0) ]
[ -0.0118273 -0.0116879 0.00103791 0.222374 -0.000203586 0.00319576 0.00315006 (0) ]
[ -0.00843425 0.120025 0.000295475 2.29658e-05 0.220984 -0.0144387 -0.0028064 (0) ]
[ 0.0128043 -0.125935 -0.000464349 -0.000250535 0.000246513 0.223384 0.00255394 (0) ]
[ -0.00052539 -0.028187 -4.28156e-05 -0.000201201 6.95438e-05 -0.00016604 0.225033 (0) ]
FirthRegressionD loglik: -173.049  dethh: 0.511208

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.184494 0.18596 0.189712 0.186151 0.192377 ... 0.193154 0.190366 0.19101 0.201412 0.190941 (0.225293) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 114.352 -0.00803521 5.10119e-05 4.8341e-05 0.00471309 -0.00505084 -0.000990617 (0) ]
[ 21.8395 24.5608 0.00584344 0.0017909 -0.0231919 0.0242204 0.00527829 (0) ]
[ -0.0400043 -0.032294 0.189506 -0.0206959 -0.00920661 0.0126421 0.00158268 (0) ]
[ -0.0142827 -0.00954277 0.00112261 0.18973 -0.00141859 0.0060123 0.00424624 (0) ]
[ -0.00862395 0.101585 0.000187558 9.49881e-05 0.18841 -0.0183766 -0.00431295 (0) ]
[ 0.0190436 -0.105094 -0.000702836 -0.000381055 0.000372871 0.190854 0.00634884 (0) ]
[ -0.00201004 -0.0241923 2.68687e-05 -0.000228303 0.000134742 -0.000377854 0.192436 (0) ]
FirthRegressionD loglik: -125.371  dethh: 0.118273

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.147907 0.149655 0.154242 0.150062 0.158477 ... 0.157603 0.152425 0.155977 0.167671 0.156053 (0.224837) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 92.5912 -0.0094288 0.000589416 0.000299604 0.00557893 -0.0062547 -0.0010911 (0) ]
[ 17.6917 19.9009 0.00653884 0.0018112 -0.027106 0.028207 0.00618091 (0) ]
[ -0.0447413 -0.0269848 0.15377 -0.0308079 -0.00878302 0.0229358 0.000105838 (0) ]
[ -0.0163781 -0.00726447 0.00121498 0.153951 -0.00361678 0.0113979 0.00651346 (0) ]
[ -0.0089091 0.081503 0.000120507 0.000141635 0.15263 -0.0259349 -0.00713017 (0) ]
[ 0.0236577 -0.0829196 -0.000880057 -0.000475955 0.000467902 0.155122 0.0138295 (0) ]
[ -0.00325704 -0.0197752 8.2567e-05 -0.00025334 0.000180159 -0.000548366 0.156618 (0) ]
FirthRegressionD loglik: -90.4032  dethh: 0.0205738

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.113511 0.115337 0.120338 0.115862 0.125379 ... 0.123694 0.11719 0.122551 0.134665 0.122723 (0.224734) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 71.9249 -0.0116439 0.00168937 0.000789381 0.00700283 -0.00822468 -0.00123572 (0) ]
[ 13.7571 15.48 0.00750492 0.0017255 -0.0333213 0.0345042 0.00760512 (0) ]
[ -0.0483139 -0.0219223 0.119808 -0.050679 -0.00911983 0.0405265 -0.00237657 (0) ]
[ -0.0177497 -0.00517367 0.00130495 0.119992 -0.00693924 0.0205058 0.0108488 (0) ]
[ -0.0092866 0.0625707 0.000114871 0.000150375 0.118581 -0.0388122 -0.0117616 (0) ]
[ 0.0255868 -0.0625994 -0.000954899 -0.000514471 0.000509293 0.121113 0.026884 (0) ]
[ -0.00397383 -0.0155403 0.000110535 -0.000272993 0.000196378 -0.0006378 0.122519 (0) ]
FirthRegressionD loglik: -65.3325  dethh: 0.00287145

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0841555 0.0858738 0.0908868 0.0864229 0.0959608 ... 0.09431 0.0875152 0.093583 0.105298 0.0938028 (0.224711) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 54.0886 -0.0149897 0.00390692 0.00172984 0.00926845 -0.0113008 -0.00143043 (0) ]
[ 10.3659 11.669 0.00864905 0.00132843 -0.0427016 0.043939 0.00973689 (0) ]
[ -0.050583 -0.0175354 0.090477 -0.0895748 -0.0125212 0.0691307 -0.00613041 (0) ]
[ -0.0183947 -0.00342499 0.00138677 0.0907036 -0.0112316 0.0351701 0.019079 (0) ]
[ -0.00972863 0.0463482 0.000164736 0.000125173 0.0891306 -0.0598369 -0.0189954 (0) ]
[ 0.0249952 -0.0457317 -0.000932595 -0.000501748 0.000499029 0.091685 0.0484378 (0) ]
[ -0.00410736 -0.011847 0.000109215 -0.000287482 0.000187447 -0.000643374 0.0930139 (0) ]
FirthRegressionD loglik: -47.7232  dethh: 0.000340385

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0607241 0.0622139 0.0669572 0.06272 0.0714857 ... 0.0704977 0.0641551 0.0701153 0.0808753 0.0703471 (0.224706) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 39.6853 -0.0199361 0.00837823 0.00353545 0.0128766 -0.0160082 -0.00168887 (0) ]
[ 7.63145 8.59567 0.00966853 0.000170137 -0.0565654 0.0577495 0.012854 (0) ]
[ -0.0518017 -0.0139787 0.0667781 -0.166445 -0.0249427 0.114214 -0.0110625 (0) ]
[ -0.018508 -0.00204275 0.00145877 0.0670703 -0.0152821 0.0581104 0.0348927 (0) ]
[ -0.0102007 0.0333323 0.00025125 7.78701e-05 0.0652962 -0.0935098 -0.0299744 (0) ]
[ 0.0226697 -0.0326502 -0.000842473 -0.000455233 0.000452125 0.0678529 0.0825725 (0) ]
[ -0.00376129 -0.00882924 8.44786e-05 -0.000299022 0.000162974 -0.000584529 0.0691254 (0) ]
FirthRegressionD loglik: -35.6034  dethh: 3.59375e-05

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0428785 0.0440856 0.0484133 0.0445128 0.0520645 ... 0.0520999 0.0466194 0.0520003 0.0615518 0.0522241 (0.224705) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 28.587 -0.0271843 0.0174327 0.00701305 0.018727 -0.0231397 -0.00204505 (0) ]
[ 5.5278 6.23111 0.00975618 -0.00272192 -0.0768909 0.0777426 0.0173581 (0) ]
[ -0.0523651 -0.0112279 0.0485102 -0.319898 -0.0608228 0.183237 -0.015828 (0) ]
[ -0.0183348 -0.000977152 0.00152266 0.0488772 -0.0148856 0.0931376 0.0657861 (0) ]
[ -0.0106787 0.023355 0.000354873 2.07121e-05 0.0468898 -0.146847 -0.0462436 (0) ]
[ 0.0194731 -0.0229739 -0.000717397 -0.000393076 0.000385862 0.0494335 0.134244 (0) ]
[ -0.00309162 -0.00647094 4.41997e-05 -0.000310541 0.000132008 -0.000486698 0.0506757 (0) ]
FirthRegressionD loglik: -27.4497  dethh: 3.51499e-06

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0297284 0.0306483 0.0345206 0.0309842 0.0371687 ... 0.0383703 0.033904 0.038508 0.0468416 0.0387161 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 20.3161 -0.0377761 0.0358812 0.0137288 0.0284787 -0.0338739 -0.00258408 (0) ]
[ 3.96276 4.472 0.00694503 -0.00943889 -0.106634 0.106517 0.0238101 (0) ]
[ -0.0526659 -0.00917135 0.0348959 -0.62837 -0.153822 0.285253 -0.0156714 (0) ]
[ -0.0180964 -0.00014665 0.00158283 0.0353368 0.00198167 0.145219 0.127108 (0) ]
[ -0.0111573 0.0159428 0.000461531 -3.72203e-05 0.0331402 -0.230638 -0.0696663 (0) ]
[ 0.0160686 -0.0160521 -0.000583126 -0.000328737 0.000314036 0.0356651 0.207753 (0) ]
[ -0.00223401 -0.00468124 -5.33336e-06 -0.000325283 0.000100577 -0.000371367 0.0369042 (0) ]
FirthRegressionD loglik: -22.1233  dethh: 3.2969e-07

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0202622 0.0209198 0.0243648 0.0211666 0.0260203 ... 0.0283954 0.0249397 0.0287451 0.0360173 0.0289376 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 14.3002 -0.0532624 0.0737445 0.0266969 0.045273 -0.0499384 -0.00351072 (0) ]
[ 2.82676 3.19543 -0.00335207 -0.024478 -0.150218 0.14776 0.0329463 (0) ]
[ -0.0530564 -0.00767213 0.0250016 -1.25028 -0.38062 0.428589 0.00253627 (0) ]
[ -0.017977 0.000542233 0.00164623 0.0255105 0.0671967 0.220053 0.250449 (0) ]
[ -0.0116556 0.0105481 0.000563986 -9.06288e-05 0.023112 -0.361216 -0.101912 (0) ]
[ 0.012861 -0.0112227 -0.000455845 -0.000270258 0.000245496 0.0256241 0.301908 (0) ]
[ -0.0012676 -0.00334564 -6.11855e-05 -0.000347327 7.15985e-05 -0.00025236 0.026889 (0) ]
FirthRegressionD loglik: -18.7917  dethh: 3.07288e-08

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0135629 0.0139966 0.0170795 0.0141633 0.0178254 ... 0.0213244 0.0188112 0.0218867 0.0283654 0.0220676 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 10.0071 -0.0759716 0.152106 0.0516064 0.0751844 -0.0738109 -0.00529271 (0) ]
[ 2.01859 2.28796 -0.03163 -0.0575577 -0.214246 0.206579 0.0455886 (0) ]
[ -0.0538879 -0.00660025 0.0179603 -2.50191 -0.913878 0.613487 0.0712824 (0) ]
[ -0.0181492 0.00119784 0.00172333 0.0185301 0.262907 0.322453 0.500963 (0) ]
[ -0.0122235 0.00666463 0.000661243 -0.000137338 0.0159285 -0.562579 -0.142728 (0) ]
[ 0.0100413 -0.00792739 -0.000343688 -0.000221677 0.000184875 0.0184478 0.396967 (0) ]
[ -0.000195581 -0.00235367 -0.000124964 -0.000383227 4.55895e-05 -0.00013545 0.0197734 (0) ]
FirthRegressionD loglik: -16.8526  dethh: 2.98514e-09

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00888465 0.00913636 0.011945 0.00923333 0.0118851 ... 0.0164715 0.0148483 0.0172884 0.0233501 0.0174627 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 6.99982 -0.109442 0.315876 0.098775 0.130095 -0.108905 -0.00893445 (0) ]
[ 1.45618 1.658 -0.101833 -0.129863 -0.308421 0.289719 0.0621789 (0) ]
[ -0.0556257 -0.00584224 0.0130659 -5.00112 -2.1414 0.812624 0.265853 (0) ]
[ -0.018828 0.00197905 0.0018314 0.0136925 0.800097 0.452398 1.01276 (0) ]
[ -0.0129653 0.00386397 0.000758325 -0.000177637 0.0108633 -0.867504 -0.184914 (0) ]
[ 0.00765511 -0.00574504 -0.000249282 -0.000185159 0.000133949 0.0134284 0.422119 (0) ]
[ 0.00109082 -0.00161118 -0.000205543 -0.000446306 2.1178e-05 -1.81291e-05 0.0148672 (0) ]
FirthRegressionD loglik: -15.8668  dethh: 3.29565e-10

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00565793 0.0057669 0.00842213 0.00580213 0.00763123 ... 0.0133625 0.0127057 0.0145666 0.0208064 0.0147348 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 4.95172 -0.159142 0.662287 0.185475 0.233024 -0.159525 -0.016427 (0) ]
[ 1.08141 1.24212 -0.269208 -0.28814 -0.445932 0.404966 0.0811513 (0) ]
[ -0.0591327 -0.00528693 0.00980651 -9.90316 -4.93858 0.923526 0.752099 (0) ]
[ -0.0203737 0.00322934 0.00200337 0.0104945 2.2262 0.59854 2.06001 (0) ]
[ -0.0141129 0.00177576 0.000869223 -0.000215026 0.00736229 -1.31143 -0.200786 (0) ]
[ 0.0056565 -0.00440003 -0.000171836 -0.000164348 9.29184e-05 0.0100437 0.179372 (0) ]
[ 0.00294954 -0.0010521 -0.000329174 -0.00057059 -5.4265e-06 0.000114946 0.011699 (0) ]
FirthRegressionD loglik: -15.5027  dethh: 5.72317e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00356513 0.00356675 0.00632635 0.00354261 0.00475547 ... 0.011898 0.0127257 0.0138754 0.0215883 0.0140087 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.72656 -0.233728 1.40669 0.336158 0.425678 -0.22997 -0.0313322 (0) ]
[ 0.886444 1.03931 -0.66499 -0.636946 -0.638785 0.557288 0.0942406 (0) ]
[ -0.0664179 -0.00475929 0.00801253 -19.153 -11.2968 0.655032 1.87788 (0) ]
[ -0.0233473 0.00602282 0.00230317 0.00879836 5.97822 0.739451 4.19937 (0) ]
[ -0.0162585 3.26218e-05 0.00102824 -0.000264441 0.0051678 -1.89354 -0.108285 (0) ]
[ 0.00401366 -0.00385651 -0.000110475 -0.000176232 6.32211e-05 0.00809902 -0.820706 (0) ]
[ 0.00647003 -0.000733147 -0.000575612 -0.000862229 -4.24127e-05 0.000310036 0.0102299 (0) ]
FirthRegressionD loglik: -15.4262  dethh: 4.30535e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0028878 0.00282697 0.00623676 0.00275004 0.00373474 ... 0.0119973 0.0149291 0.0150828 0.0256006 0.0150811 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.5113 -0.339329 2.91768 0.561982 0.738135 -0.315394 -0.0583611 (0) ]
[ 0.944017 1.14381 -1.55365 -1.35627 -0.843923 0.718715 0.0775469 (0) ]
[ -0.0743623 -0.00366579 0.00786734 -33.7358 -24.57 -0.689423 4.18975 (0) ]
[ -0.0251038 0.0110198 0.00254703 0.00880541 15.0034 0.925837 8.31945 (0) ]
[ -0.0187069 -0.00116087 0.001187 -0.000345096 0.00466726 -2.35943 0.261747 (0) ]
[ 0.00323907 -0.00419746 -7.5458e-05 -0.000244445 5.39301e-05 0.00781587 -3.48161 (0) ]
[ 0.0113055 -0.000930243 -0.000928682 -0.00133616 -7.6208e-05 0.00054399 0.0106113 (0) ]
FirthRegressionD loglik: -15.3808  dethh: 4.45194e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00259399 0.00248442 0.0066967 0.00236634 0.00324424 ... 0.0116637 0.0169878 0.0158488 0.0292871 0.0156658 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.4861 -0.397021 4.04099 0.730305 0.88478 -0.353696 -0.0842472 (0) ]
[ 1.08041 1.35863 -2.41641 -1.96129 -0.827633 0.736166 0.0273792 (0) ]
[ -0.0759502 -0.0016464 0.00784652 -38.6454 -33.5366 -2.63897 6.48212 (0) ]
[ -0.0240846 0.0163535 0.00253354 0.00887482 22.2193 1.3861 12.3865 (0) ]
[ -0.0198696 -0.00227393 0.00123644 -0.00041089 0.00458298 -2.05286 0.588823 (0) ]
[ 0.00272 -0.004494 -2.88194e-05 -0.000320248 5.01919e-05 0.00768402 -6.24059 (0) ]
[ 0.0158528 -0.00151355 -0.00126297 -0.00181635 -9.98521e-05 0.000755217 0.011034 (0) ]
FirthRegressionD loglik: -15.3491  dethh: 4.6037e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00239515 0.00224232 0.00711764 0.00209764 0.00289822 ... 0.0109886 0.0187645 0.0162023 0.0325098 0.0158857 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.47493 -0.428896 4.59654 0.930618 0.94099 -0.378634 -0.110148 (0) ]
[ 1.22135 1.58664 -3.05575 -2.33517 -0.705422 0.69453 -0.0206398 (0) ]
[ -0.0747566 0.000481996 0.00778549 -36.1797 -35.8533 -4.83799 8.77832 (0) ]
[ -0.0226491 0.0206658 0.00244137 0.00884502 25.025 1.99439 16.4199 (0) ]
[ -0.0204914 -0.00348446 0.00123181 -0.000449733 0.00455156 -1.44171 0.782052 (0) ]
[ 0.00232955 -0.00450477 3.53525e-05 -0.000371216 4.71936e-05 0.00753812 -8.60663 (0) ]
[ 0.0199249 -0.00223791 -0.00156287 -0.00224674 -0.000123002 0.000929585 0.0113724 (0) ]
FirthRegressionD loglik: -15.33  dethh: 4.64681e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.002247 0.00205677 0.00738155 0.00189671 0.00263577 ... 0.0102523 0.0203967 0.016392 0.035481 0.0160133 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.46361 -0.452175 4.93326 1.14615 0.985882 -0.401738 -0.134768 (0) ]
[ 1.33735 1.78063 -3.52357 -2.56983 -0.568545 0.646172 -0.0592542 (0) ]
[ -0.0732452 0.0022741 0.00772761 -31.9557 -35.7688 -7.27318 11.2181 (0) ]
[ -0.0217329 0.023701 0.00236459 0.00878699 25.9421 2.35705 20.3272 (0) ]
[ -0.0209085 -0.00461632 0.00121465 -0.000466961 0.00451992 -0.798435 0.98802 (0) ]
[ 0.00208718 -0.00427488 0.00010581 -0.000391821 4.48531e-05 0.00741801 -10.7176 (0) ]
[ 0.0235906 -0.00290687 -0.00183364 -0.00261679 -0.000149753 0.00106679 0.0117014 (0) ]
FirthRegressionD loglik: -15.3194  dethh: 4.63599e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0021415 0.00191919 0.00752758 0.00175132 0.00244286 ... 0.00956308 0.0218792 0.0165008 0.038169 0.0161306 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.45427 -0.470686 5.18753 1.3368 1.01948 -0.42624 -0.154754 (0) ]
[ 1.42302 1.9278 -3.86715 -2.72727 -0.452033 0.610545 -0.0908028 (0) ]
[ -0.0720563 0.0036342 0.00768519 -28.0567 -35.3018 -9.73237 13.6469 (0) ]
[ -0.0212506 0.0256998 0.00231435 0.00873355 26.2296 2.29771 23.7998 (0) ]
[ -0.0211623 -0.00551703 0.00119857 -0.000471971 0.00449151 -0.27325 1.23369 (0) ]
[ 0.00195278 -0.00391146 0.000176213 -0.000385288 4.41617e-05 0.00733465 -12.5249 (0) ]
[ 0.0267716 -0.00343979 -0.00207039 -0.0029231 -0.000177772 0.00116884 0.0120192 (0) ]
FirthRegressionD loglik: -15.3137  dethh: 4.61044e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00206985 0.0018192 0.00760856 0.00164878 0.00230406 ... 0.00893942 0.0231728 0.0165453 0.0405016 0.016249 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.44751 -0.484836 5.38599 1.48423 1.03566 -0.45408 -0.16845 (0) ]
[ 1.48282 2.03259 -4.11704 -2.83504 -0.361439 0.591764 -0.117744 (0) ]
[ -0.0712082 0.00460498 0.00765395 -24.8999 -34.9388 -12.0659 15.8894 (0) ]
[ -0.0209501 0.026979 0.00228055 0.0086916 26.2725 1.8152 26.7028 (0) ]
[ -0.0212687 -0.00616018 0.00118627 -0.000472122 0.00447106 0.0729041 1.49199 (0) ]
[ 0.00186721 -0.00349156 0.000245946 -0.000355825 4.58503e-05 0.00728255 -14.0108 (0) ]
[ 0.0293927 -0.00382913 -0.0022683 -0.00316848 -0.000203986 0.0012393 0.0123022 (0) ]
FirthRegressionD loglik: -15.3104  dethh: 4.58622e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00202255 0.00174582 0.00765838 0.00157673 0.00220372 ... 0.00837121 0.0242678 0.0165325 0.0424678 0.0163697 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.44287 -0.49495 5.53681 1.58661 1.03467 -0.486202 -0.175788 (0) ]
[ 1.52323 2.10446 -4.29656 -2.90662 -0.292209 0.588053 -0.141843 (0) ]
[ -0.0706074 0.00526816 0.0076285 -22.424 -34.7329 -14.2379 17.8662 (0) ]
[ -0.0206744 0.0277863 0.00225428 0.00866012 26.2091 0.970998 29.0695 (0) ]
[ -0.0212577 -0.00658727 0.0011774 -0.000471345 0.00445912 0.239124 1.74254 (0) ]
[ 0.00179091 -0.00305027 0.000316558 -0.000306842 5.01499e-05 0.00725462 -15.2142 (0) ]
[ 0.0314613 -0.00409494 -0.00242815 -0.00336109 -0.000226855 0.00128283 0.0125375 (0) ]
FirthRegressionD loglik: -15.3083  dethh: 4.56811e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00199168 0.0016899 0.00769485 0.00152528 0.00212903 ... 0.00784269 0.0251853 0.0164702 0.044112 0.0164944 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.43969 -0.501705 5.64936 1.65045 1.01997 -0.522909 -0.177354 (0) ]
[ 1.54995 2.15255 -4.42523 -2.95118 -0.238277 0.596291 -0.164472 (0) ]
[ -0.0701724 0.00570512 0.00760553 -20.4725 -34.6498 -16.2778 19.5804 (0) ]
[ -0.0203574 0.0282882 0.00223067 0.0086366 26.1012 -0.172454 31.004 (0) ]
[ -0.0211601 -0.00685458 0.00117107 -0.000471202 0.00445432 0.249322 1.98043 (0) ]
[ 0.00170786 -0.00259592 0.000389798 -0.000240843 5.69838e-05 0.00724587 -16.195 (0) ]
[ 0.0330473 -0.00426269 -0.00255504 -0.00351152 -0.000246218 0.00130412 0.0127249 (0) ]
FirthRegressionD loglik: -15.3067  dethh: 4.5566e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00197138 0.00164475 0.00772669 0.00148719 0.00207059 ... 0.00733919 0.0259611 0.0163655 0.045503 0.0166251 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.43747 -0.505899 5.73411 1.68476 0.99523 -0.564339 -0.173824 (0) ]
[ 1.56728 2.18413 -4.51895 -2.97601 -0.194496 0.613718 -0.186741 (0) ]
[ -0.069846 0.00598301 0.00758323 -18.891 -34.6491 -18.2375 21.0775 (0) ]
[ -0.0199785 0.0285913 0.00220733 0.00861865 25.9778 -1.56932 32.6214 (0) ]
[ -0.0209988 -0.0070107 0.00116643 -0.000472076 0.00445496 0.130918 2.20967 (0) ]
[ 0.0016185 -0.00212431 0.000467014 -0.000159513 6.61886e-05 0.00725351 -17.0103 (0) ]
[ 0.0342435 -0.00435521 -0.00265568 -0.00363023 -0.00026263 0.00130719 0.0128712 (0) ]
FirthRegressionD loglik: -15.3052  dethh: 4.55087e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.0019576 0.00160566 0.00775797 0.0014574 0.00202184 ... 0.00684875 0.0266332 0.0162229 0.0467123 0.0167632 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.43587 -0.508254 5.8006 1.69786 0.963091 -0.61077 -0.165722 (0) ]
[ 1.57828 2.20452 -4.58999 -2.98683 -0.156961 0.638396 -0.209584 (0) ]
[ -0.0695891 0.00615223 0.00756053 -17.547 -34.6992 -20.1688 22.4159 (0) ]
[ -0.0195326 0.0287632 0.00218301 0.00860436 25.8509 -3.19169 34.025 (0) ]
[ -0.0207873 -0.00709155 0.00116281 -0.000473889 0.00445967 -0.0943053 2.43784 (0) ]
[ 0.00153328 -0.00162641 0.000549132 -6.37826e-05 7.76553e-05 0.00727647 -17.7057 (0) ]
[ 0.0351383 -0.00439058 -0.00273657 -0.00372629 -0.000276892 0.00129491 0.0129854 (0) ]
FirthRegressionD loglik: -15.3036  dethh: 4.54999e-11

FirthRegressionD: xx = [ 1 1 1 1 1 ... 1 1 1 1 1 (0) ]
FirthRegressionD: ww = [ 0.00194761 0.0015694 0.00779046 0.00143241 0.00197818 ... 0.00636225 0.0272361 0.0160445 0.0478035 0.0169087 (0.224704) ]
FirthRegressionD: hh (predictor_ct=7, predictor_ctav=8):
[ 3.43465 -0.509334 5.8566 1.69632 0.925111 -0.662768 -0.153328 (0) ]
[ 1.58507 2.21745 -4.64749 -2.98797 -0.122802 0.669215 -0.233842 (0) ]
[ -0.0693749 0.0062485 0.00753667 -16.3309 -34.7768 -22.1161 23.6531 (0) ]
[ -0.0190171 0.0288463 0.00215688 0.00859225 25.7246 -5.02716 35.3016 (0) ]
[ -0.0205323 -0.00712189 0.00115971 -0.000476425 0.0044675 -0.412989 2.67383 (0) ]
[ 0.00146951 -0.00109163 0.000636763 4.61402e-05 9.13998e-05 0.00731522 -18.3134 (0) ]
[ 0.0358037 -0.00438211 -0.00280321 -0.0038071 -0.00028982 0.00126893 0.0130761 (0) ]
FirthRegressionD loglik: -15.3018  dethh: 4.55336e-11
FirthRegressionD: unfinished
done.
Results written to  [path]/20241220-logistic.THYROID.glm.logistic.hybrid .

End time: Fri Dec 20 12:10:49 2024

2. Full code
  ./plink2 --bfile [path]/thy_eas_merged \ 
 --glm hide-covar \ 
 --pheno  [path]/merge_pheno.txt \ 
 --pheno-name THYROID \ 
 --covar  [path]/PC5.eigenvec \ 
 --covar-name PC1-PC5 \ 
 --out  [path]/20241222-logistic

3. result
#CHROM  POS     ID      REF     ALT     PROVISIONAL_REF?        A1      OMITTED A1_FREQ FIRTH?  TEST    OBS_CT  OR      LOG(OR)_SE      Z_STAT  P       ERRCODE
1       649192  1:649192        A       T       Y       T       A       0.0947282       Y       ADD     607     4.71683 0.931014        1.66607 0.0956989       UNFINISHED
1       707522  1:707522        G       C       Y       C       G       0.112026        Y       ADD     607     3.63524 0.964105        1.33873 0.180659        UNFINISHED
1       711310  1:711310        G       A       Y       A       G       0.0617792       Y       ADD     607     0.370828        1.15101 -0.861865       0.388762        UNFINISHED
...

2024년 12월 20일 금요일 오후 5시 27분 8초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Dec 23, 2024, 3:55:50 PM12/23/24
to MS WOO, plink2-users
Thanks, the obviously-buggy part of the behavior is fixed.

The remaining question is whether the updated behavior matches that of the R logistf package, as it is intended to.  I can write debug-print code to dump the phenotype vector and predictor matrix for the 1:649192 into a format that can be easily loaded into R.  Then, it would be most convenient if you could share the vector+matrix, but alternatively I could give you instructions to perform the Firth regression in R yourself; let me know which approach would work better.

MS WOO

unread,
Dec 25, 2024, 8:43:32 PM12/25/24
to plink2-users
Thank your for reply!

But I don't know what does " phenotype vector and predictor matrix for the 1:649192".

If you mean for data which is used in code  "--pheno and --covar", it can not be shared.

Because they are sorted with "subject" name, not variant name(1:649192, you mentioned.).
example of pheno) 
#FID    IID     THYROID
HG00403 HG00403 1
covar)
#FID    IID     PC1     PC2     PC3     PC4     PC5
HG00403 HG00403 0.0151964       0.00514 0.0352031       -0.0165247      -0.0243364
...
If you need this data, I can share it.

And I'd like to know both method(using plink and R), what should I do?
2024년 12월 24일 화요일 오전 5시 55분 50초 UTC+9에 chrch...@gmail.com님이 작성:

Christopher Chang

unread,
Dec 30, 2024, 6:24:44 PM12/30/24
to plink2-users
With the build at https://s3.amazonaws.com/plink2-assets/plink2_linux_avx2_20241230.zip :

1. Run the single-SNP regression with "--threads 1" + --debug + etc.  (You may also want to remove the 'hide-covar' modifier for --glm.)  The resulting .log should include a line like "Debug matrix written to [path]/202xyyzz-logistic.THYROID.glm.logistic.hybrid.inputs " at the end; stop here and ask for help if that doesn't happen.

2. Then, start up R, and run the following commands:
install.packages("logistf")
library(logistf)
data <- read.table("/path/to/.inputs")
result <- logistf(V1 ~ V2 + V3 + V4 + V5 + V6 + V7, pl=FALSE)
result$prob

The final command should print p-values for the predictors.  If plink2 is doing the right thing, the V2 p-value printed in R should match plink2's p-value to 5-6 decimal places.

Chris Chang

unread,
Jan 12, 2025, 3:20:06 AM1/12/25
to plink2-users

MS WOO

unread,
Jan 15, 2025, 3:20:18 AM1/15/25
to plink2-users
Sorry, I was struggled with another problem, so I totally forgot about it.

I run the code with the new build (20241230.zip)

1. Code
  ./plink2 --bfile [path]/thy_eas_merged \
       --glm hide-covar \ #(Should I change this option?)

       --pheno  [path]/merge_pheno.txt \
       --pheno-name THYROID \
       --covar  [path]/PC5.eigenvec \
       --covar-name PC1-PC5 \
       --threads 1 \
       --snp 1:649192 \
       --debug \
       --out  [path]/20241220-logistic

2. Log
PLINK v2.0.0-a.6.5.bLM AVX2 Intel (30 Dec 2024)

Options in effect:
  --bfile  [path]/thy_eas_merged
  --covar  [path]/PC5.eigenvec
  --covar-name PC1-PC5
  --debug
  --glm hide-covar
  --out  [path]/20241220-logistic
  --pheno  [path]/merge_pheno.txt
  --pheno-name THYROID
  --snp 1:649192
  --threads 1

Hostname: bts-Precision-5820-Tower-X-Series
Working directory:  [path]/Plink_debug
Start time: Wed Jan 15 17:08:06 2025

Random number seed: 1736928486
257446 MiB RAM detected, ~234184 available; reserving 128723 MiB for main

workspace.
Using 1 compute thread.
607 samples (348 females, 259 males; 607 founders) loaded from
[path]/thy_eas_merged.fam.
5286456 variants loaded from
[path]/thy_eas_merged.bim.
1 binary phenotype loaded (103 cases, 504 controls).
--snp: 1 variant remaining.
5 covariates loaded from  [path]/PC5.eigenvec.
Calculating allele frequencies... done.
1 variant remaining after main filters.
--glm logistic-Firth hybrid regression on phenotype 'THYROID': done.
Results written to  [path]/20241220-logistic.THYROID.glm.logistic.hybrid .
Debug matrix written to  [path]/20241220-logistic.THYROID.glm.logistic.hybrid.inputs .

End time: Wed Jan 15 17:08:07 2025

It seems to be worked. The written debug matrix consists of numeric structure.
2025년 1월 12일 일요일 오후 5시 20분 6초 UTC+9에 chrch...@gmail.com님이 작성:

Christopher Chang

unread,
Jan 15, 2025, 6:17:46 PM1/15/25
to plink2-users
Let me know if you want to execute the R commands I laid out in my previous message, or if you want to send me the .inputs file and have me run them.

MS WOO

unread,
Jan 16, 2025, 8:03:04 AM1/16/25
to plink2-users
I have an error with using "logistf" package.

If you need only "Debug matrix.input" file, I can share you.

Is it Ok to send it by e-mail?

2025년 1월 16일 목요일 오전 8시 17분 46초 UTC+9에 chrch...@gmail.com님이 작성:

Chris Chang

unread,
Jan 16, 2025, 8:36:28 AM1/16/25
to MS WOO, plink2-users

MS WOO

unread,
Jan 16, 2025, 8:53:04 AM1/16/25
to plink2-users
Thanks. I sent it by email.

2025년 1월 16일 목요일 오후 10시 36분 28초 UTC+9에 chrch...@gmail.com님이 작성:

Christopher Chang

unread,
Jan 16, 2025, 2:38:29 PM1/16/25
to plink2-users
Ok, looks like the "result <- logistf(V1 ~ V2 + V3 + V4 + V5 + V6 + V7, pl=FALSE)" line I wrote should have been "result <- logistf(V1 ~ V2 + V3 + V4 + V5 + V6 + V7, data, pl=FALSE)", sorry about that.

Anyway, result is now consistent between plink2 and R logistf.  The problem is that the covariates are just too strongly associated with the phenotype; but if you crank up the number of iterations from 25 to 1000 in R, the p-value only changes by a factor of ~1.2, so the "unfinished" results are not that inaccurate.

MS WOO

unread,
Jan 16, 2025, 8:55:59 PM1/16/25
to plink2-users
Thank you for your help!

I should think about covariates problem.

2025년 1월 17일 금요일 오전 4시 38분 29초 UTC+9에 chrch...@gmail.com님이 작성:
Reply all
Reply to author
Forward
0 new messages