jessieren / DeepVirFinder

Identifying viruses from metagenomic data by deep learning
Other
122 stars 32 forks source link

Estimating q-values based on p-values, error in R #6

Open miasungeunlee opened 5 years ago

miasungeunlee commented 5 years ago

Dear Jie,

Thanks for this amazing tool. I am using DeepVirFinder to find viral sequences from contigs from metagenomic data. But there was this error when calculating the q value using p-value: There are hole script:

library(qvalue) result <- read.csv("/Users/leesungeun/Desktop/DeepVirFinder/test.fasta_gt1000bp_dvfpred.txt", sep='\t') result$qvalue <- qvalue(result$pvalue)$qvalues Error in smooth.spline(lambda, pi0, df = smooth.df) : missing or infinite values in inputs are not allowed head(result) name len score pvalue 1 scaffold_18377_c1 4557 0.87375259 0.019865549 2 scaffold_44088_c1 2944 0.98103178 0.009158547 3 scaffold_57332_c1 2580 0.99517071 0.006023869 4 scaffold_65082_c1 2416 0.98514450 0.008516504 5 scaffold_72628_c1 2286 0.13312286 0.172426165 6 scaffold_83131_c1 2133 0.05367623 0.229719012

miasungeunlee commented 2 years ago

Hi, I’ve used this R script to get q-values based on p-values. I think now most of people tend to use DVF threshold for selecting contigs with a score ≥0.9 and p-value <0.05, not taking account of qvalues… (See the https://www.mdpi.com/2571-8789/4/2/23 https://www.mdpi.com/2571-8789/4/2/23)

library(qvalue) result <- read.csv("gt1000bp_dvfpred.txt", sep='\t') result$qvalue <- qvalue(result$pvalue, pi0= 1 )$qvalues qvalue<-result[order(result$qvalue),] write.table(qvalue, file = "gt1000bp_dvfpred.txt", sep = "\t") q()

Cheers Mia

Le 23 nov. 2022 à 09:43, asierFernandezP @.***> a écrit :

Hi! Any solutions for this problem?

— Reply to this email directly, view it on GitHub https://github.com/jessieren/DeepVirFinder/issues/6#issuecomment-1324713515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHUAD4ZYLBNIYOOVDPNZB6LWJXKKHANCNFSM4H53NJZQ. You are receiving this because you authored the thread.

asierFernandezP commented 2 years ago

Thank you Mia!! I have just seen also this approach: https://github.com/StoreyLab/qvalue/issues/19#issuecomment-643394179

But I will consider also not taking q-values into account.

Best, Asier

miasungeunlee commented 2 years ago

You’re welcome & enjoy your virus discovery ! Best, Mia

Le 23 nov. 2022 à 10:06, asierFernandezP @.***> a écrit :

Thank you Mia!! I have just seen also this approach: StoreyLab/qvalue#19 (comment) https://github.com/StoreyLab/qvalue/issues/19#issuecomment-1038565450 But I will consider also not taking q-values into account.

Best, Asier

— Reply to this email directly, view it on GitHub https://github.com/jessieren/DeepVirFinder/issues/6#issuecomment-1324739131, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHUAD43DETUDINT77AHD2K3WJXNADANCNFSM4H53NJZQ. You are receiving this because you authored the thread.