New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in permutationSimpleLm #1
Comments
Hi, Thank you for the information. I will try to fix it. Do you mind sharing with me the imputation dataset that you used, so that I can reproduce the errors? Best |
Hi Shijia,
Thanks for your fast response!
Here is one of the datasets I used - the KEGG pathway worked, but the other
pathways (e.g. MSigDB.TF, TargetScan.miRNA, MSigDB.miRNA) did not.
You might have to filter for unique genes first - I matched on the most
recent Ensembl IDs to remove the defunct Ensembl IDs when genes had
multiple mappings (otherwise the order calls will not work).
Afterwards I just used the sample code in the tutorial:
prep = read_csv(input_path)
prep$gene_name <- as.character(prep$gene_name)
gene = prep$gene_name
fc = prep$zscore
# use the prediction R^2 and fraction of imputation-used SNPs as weights
usedFrac = prep$n_snps_used / prep$n_snps_in_model
r2 = prep$pred_perf_r2
weights = usedFrac * r2
net <- MSigDB.TF$net
data2 <- orderedIntersect(x = data , by.x = data$gene , by.y =
rownames(net))
net2 <- orderedIntersect(x = net , by.x = rownames(net) , by.y = data$gene)
all(rownames(net2) == as.character(data2$gene)) ##will fail here if
duplicate genes are present
# # permutationSimpleLm uses the weighted simple linear regression model
SGSEA.res1 <- permutationSimpleLm(fc=data2$fc , net=net2 ,
weights=data2$weights , num=10)
Best.
Jiwon
2018년 12월 17일 (월) 오후 5:23, Shijia Zhu <notifications@github.com>님이 작성:
… Hi,
Thank you for the information. I will try to fix it. Do you mind sharing
with me the imputation dataset that you used, so that I can reproduce the
errors?
Best
Shijia
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ALXdL7rC2VjsRys__7d4xpA6OomRsnJZks5u6BlGgaJpZM4ZW7iH>
.
|
Sorry, Jiwon. I cannot find the dataset link. Could you please resend it? |
Hmm that's strange - maybe replying through the Github link doesn't enable
attachments.
I uploaded the file onto Dropbox and created a link:
https://www.dropbox.com/s/0zcrqme8ivhb4yh/metxcan.Muscle_Skeletal.csv?dl=0
2018년 12월 18일 (화) 오후 1:17, Shijia Zhu <notifications@github.com>님이 작성:
… Sorry, Jiwon. I cannot find the dataset link. Could you please resend it?
Shijia
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ALXdL3uvvmMrZqQROoKFyvZXqhc9YC0fks5u6TFDgaJpZM4ZW7iH>
.
|
Got it! Thanks for the data. I will try to fix it soon, and will keep you posted. |
Hi Jiwon, Just keep you updated. To address the duplicates, I modified the function orderedIntersect(x, by.x, by.y, duplicate="mean"), by adding a parameter "duplicate". It takes "mean" of fold changes and weights for duplicated genes by default; alternatively, it can also take "median", "max", "min" of or "remove" the values for duplicates. Please let me know if it makes sense to you. Thank you for your input! |
Hi Shijia,
That does seem reasonable. However, it looks like with the update to the
permutationSimpleLm function, I'm still getting the same error:
[1] TRUE
10%.20%.30%.40%.50%.60%.70%.80%.90%.100%.Error in shuffledPval[i, ] <
observedPval[i] :
comparison of these types is not implemented
Calls: permutationSimpleLm -> mean
Execution halted
Best,
Jiwon
…On Mon, Dec 24, 2018, 12:44 AM Shijia Zhu ***@***.*** wrote:
Hi Jiwon,
Just keep you updated. To address the duplicates, I modified the function
orderedIntersect(x, by.x, by.y, duplicate="mean"), by adding a parameter
"duplicate". It takes "mean" of fold changes and weights for duplicated
genes; alternatively, it can also take "median", "max", "min" of or
"remove" the values for duplicates. Please let me know if it makes sense to
you.
Thank you for your input!
Best
Shijia
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ALXdL8wPvu-pVR9FiygmQCnos7BSxP9iks5u8GnHgaJpZM4ZW7iH>
.
|
The function for permutationMultipleLm has this line:
nonNaRange <- which( !is.na(trueLM$coefficients[-1]) )
https://github.com/zhushijia/GIGSEA/blob/981285caf016cc85a9a09b6d6c9f4a4e3c82fff5/R/permutationMultipleLm.R#L107
Do you think adding an equivalent to the permutationSimpleLm function could
resolve the issue?
2018년 12월 24일 (월) 오전 11:48, Jiwon Lee <jiwonslee@gmail.com>님이 작성:
… Hi Shijia,
That does seem reasonable. However, it looks like with the update to the
permutationSimpleLm function, I'm still getting the same error:
[1] TRUE
10%.20%.30%.40%.50%.60%.70%.80%.90%.100%.Error in shuffledPval[i, ] <
observedPval[i] :
comparison of these types is not implemented
Calls: permutationSimpleLm -> mean
Execution halted
Best,
Jiwon
On Mon, Dec 24, 2018, 12:44 AM Shijia Zhu ***@***.*** wrote:
> Hi Jiwon,
>
> Just keep you updated. To address the duplicates, I modified the function
> orderedIntersect(x, by.x, by.y, duplicate="mean"), by adding a parameter
> "duplicate". It takes "mean" of fold changes and weights for duplicated
> genes; alternatively, it can also take "median", "max", "min" of or
> "remove" the values for duplicates. Please let me know if it makes sense to
> you.
>
> Thank you for your input!
> Best
> Shijia
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#1 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ALXdL8wPvu-pVR9FiygmQCnos7BSxP9iks5u8GnHgaJpZM4ZW7iH>
> .
>
|
Sorry for forgetting about that. I just addressed it. Please check the updated version. Hopefully, it is good now. |
When running the permutationSimpleLm function, I sometimes run into the following error:
[1] TRUE
0%.....10%.....20%.....30%.....40%.....50%.....60%.....70%.....80%.....90%.....100%.Error in shuffledPval[i, ] < observedPval[i] :
comparison of these types is not implemented
Calls: permutationSimpleLm -> mean
Execution halted
It seems that this is because when the shuffled p values are regressed against the net dataset, there are sometimes some null values, and returned as 'numeric(0)'. The do.call function seems to convert this to "Numeric,0", which get compared to the observedPval, and the exit occurs because the two formats are incompatible.
Can you fix the issue so that the 'Numeric,0' is changed to a null value compatible with the observedPval and does not cause the function to exit?
The text was updated successfully, but these errors were encountered: