Error in fix.by(by.x, x) when MUNGE

54 views
Skip to first unread message

S Song

unread,
Oct 3, 2023, 4:18:05 AM10/3/23
to Genomic SEM Users
Hi,

I'm running GenomicSEM to test a small sample (n=155) of crop samples on two traits. I obtained my summary statistics after running univariate GWAS. I then combined the output assoc file with the .bim reference file. I created my own 'hm3' file by using the SNP, A1 and A2 columns of the .bim file. But when I tried to run munge, I encountered the following error:
The munging of 2 summary statistics started at 2023-10-03 16:05:53
Reading in reference file
Reading summary statistics for 171.txt 1045.txt. Please note that this step usually takes a few minutes due to the size of summary statistic files.
All files loaded into R!
Munging file: 171.txt
Interpreting the SNP column as the SNP column.
Interpreting the A1 column as the A1 column.
Interpreting the A2 column as the A2 column.
Interpreting the BETA column as the effect column.
Interpreting the P column as the P column.
Using provided N (202) for file:171.txt
Merging file:171.txt with the reference file:highQimputed203_allSNPsheaderreplaced.snplist
134385 rows present in the full 171.txt summary statistics file.
Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column


I understand it could be an issue with special characters in the data file, so I have removed ; ,- in the files and made sure I save properly using 
write.table(cp1045, file = "1045.txt", sep = "\t", quote=FALSE,row.names=FALSE,col.names=TRUE)
However, I still got the same error. I manually used the merge function in R to merge the summary statistics file and the hm3 file using SNP and it worked. I would be grateful if someone can advise me how to solve the issue.

My summary statistics data look like this:
A2 CHR SNP BP A1 TEST NMISS BETA STAT P
A scaffold5 scaffold589556AG 89556 G ADD 155 1.321 1.724 0.08672
T scaffold5 scaffold589776AT 89776 A ADD 155 0.7837 0.8903 0.3747
T scaffold5 scaffold592234GT 92234 G ADD 155 0.2037 0.3229 0.7472
G scaffold5 scaffold593632CG 93632 C ADD 155 -0.9649 -1.411 0.1603
A scaffold5 scaffold593664AC 93664 C ADD 155 -0.8201 -1.197

The 'hm3' file looks like:
SNP A1 A2
scaffold589556AG G A
scaffold589776AT A T
scaffold592234GT G T
scaffold593632CG C G
scaffold593664AC C A
scaffold593711CT C T


Thank you.

SS

S Song

unread,
Oct 3, 2023, 8:52:47 PM10/3/23
to Genomic SEM Users
Manged to spot the error. The hm3 file was space-delimited rather than tab.
Reply all
Reply to author
Forward
0 new messages