Skip to content
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

Mabye a bug in TCGAanalyze_SurvivalKM #615

Open
fw1121 opened this issue Jan 11, 2024 · 6 comments
Open

Mabye a bug in TCGAanalyze_SurvivalKM #615

fw1121 opened this issue Jan 11, 2024 · 6 comments

Comments

@fw1121
Copy link

fw1121 commented Jan 11, 2024

hi,

1. When I follow your tutorial Case study n. 1: Pan Cancer downstream analysis BRCA, error raised in:

dataSurv <- TCGAanalyze_SurvivalKM(
    clinical_patient = dataClin,
    dataGE = dataFilt,
    Genelist = rownames(dataDEGs),
    Survresult = FALSE,
    ThreshTop = 0.67,
    ThreshDown = 0.33,
    p.cut = 0.05, 
    group1 = group1, 
    group2 = group2
)

no applicable method for 'filter' applied to an object of class "c('matrix', 'array', 'double', 'numeric')"

2. I change parameter dataGE=dataFilt to dataGE = as.data.frame(dataFilt), it said failed to filter with same columns.

On closer inspection, I find duplicated sample in download BRCA expression data. After deduplicated, all thing go OK with this

dataSurv <- TCGAanalyze_SurvivalKM(
    clinical_patient = dataClin,
    dataGE = as.data.frame(dataFilt),
    Genelist = rownames(dataDEGs),
    Survresult = FALSE,
    ThreshTop = 0.67,
    ThreshDown = 0.33,
    p.cut = 0.05, 
    group1 = group1, 
    group2 = group2
)

However, dataSurv result is empty.

**3. ** Carefully read the source code, I replace this code
mRNAselected_values <- dataCancer %>% dplyr::filter(rownames(dataCancer) == mRNAselected) %>% as.numeric mRNAselected_values_normal <- dataNormal %>% dplyr::filter(rownames(dataNormal) == mRNAselected) %>% as.numeric
with
mRNAselected_values <- as.data.frame(dataCancer) %>% dplyr::filter(rownames(dataCancer) == mRNAselected) %>% unlist() mRNAselected_values_normal <- as.data.frame(dataNormal) %>% dplyr::filter(rownames(dataNormal) == mRNAselected) %>% unlist()
After this, it workd!

Thanks a lot for your outstanding work.

@lmirsadeghi
Copy link

Hi,
Thank you for bringing up a valid point.
I'm also encountering a similar issue, and unfortunately, the dataSurv result is empty.
Could you please provide detailed guidance on how/where can I do this replacement, step by step?
Thank you in advance.

@lmirsadeghi
Copy link

hi,

1. When I follow your tutorial Case study n. 1: Pan Cancer downstream analysis BRCA, error raised in:

dataSurv <- TCGAanalyze_SurvivalKM(
    clinical_patient = dataClin,
    dataGE = dataFilt,
    Genelist = rownames(dataDEGs),
    Survresult = FALSE,
    ThreshTop = 0.67,
    ThreshDown = 0.33,
    p.cut = 0.05, 
    group1 = group1, 
    group2 = group2
)

no applicable method for 'filter' applied to an object of class "c('matrix', 'array', 'double', 'numeric')"

2. I change parameter dataGE=dataFilt to dataGE = as.data.frame(dataFilt), it said failed to filter with same columns.

On closer inspection, I find duplicated sample in download BRCA expression data. After deduplicated, all thing go OK with this

dataSurv <- TCGAanalyze_SurvivalKM(
    clinical_patient = dataClin,
    dataGE = as.data.frame(dataFilt),
    Genelist = rownames(dataDEGs),
    Survresult = FALSE,
    ThreshTop = 0.67,
    ThreshDown = 0.33,
    p.cut = 0.05, 
    group1 = group1, 
    group2 = group2
)

However, dataSurv result is empty.

**3. ** Carefully read the source code, I replace this code mRNAselected_values <- dataCancer %>% dplyr::filter(rownames(dataCancer) == mRNAselected) %>% as.numeric mRNAselected_values_normal <- dataNormal %>% dplyr::filter(rownames(dataNormal) == mRNAselected) %>% as.numeric with mRNAselected_values <- as.data.frame(dataCancer) %>% dplyr::filter(rownames(dataCancer) == mRNAselected) %>% unlist() mRNAselected_values_normal <- as.data.frame(dataNormal) %>% dplyr::filter(rownames(dataNormal) == mRNAselected) %>% unlist() After this, it workd!

Thanks a lot for your outstanding work.

Hi,
Thank you for bringing up a valid point.
I'm also encountering a similar issue, and unfortunately, the dataSurv result is empty.
Could you please provide detailed guidance on how/where can I do this replacement, step by step?
Thank you in advance.

@CRISKA42
Copy link

CRISKA42 commented Apr 8, 2024

hi, I just encountered similar problem. I used the commpass data and mRNA-seq for KM analysis.

At first, the code was like:
tabSurvKM <- TCGAanalyze_SurvivalKM(clin.mm, dataMMcomplete, Genelist = G_list2, Survresult = TRUE, p.cut = 0.05, ThreshTop = 0.67, ThreshDown = 0.33, group1=gr1, group2=gr2)
and the error:
Erno applicable method for 'filter' applied to an object of class "c('matrix', 'array', 'double', 'numeric')"

Then I change the dataMMcomplete to as.data.frame.(dataMMcomplete), and the code was like:
tabSurvKM <- TCGAanalyze_SurvivalKM(clin.mm, as.data.frame(dataMMcomplete), Genelist = G_list2, Survresult = TRUE, p.cut = 0.05, ThreshTop = 0.67, ThreshDown = 0.33, group1=gr1, group2=gr2)
but new error arised:
Error in survfit.formula(ttime ~ c(rep("low", nrow(cfu_onlyTOP)), rep("high", : data set has no non-missing observations Error in if (value == n) {

Sadly, I can't figure out how it come, could you please give me some advice?
Also, i'm not sure if the problem comes from the clinical data. Are the survival time(days_to_death) and survival status ( vital_status) in clin.mm valid for function TCGAanalyze_SurvivalKM?

PS: clin.mm dataset was like:
clin mm

@CRISKA42
Copy link

CRISKA42 commented Apr 8, 2024

Then I changed the vital_status from (Alive, Dead) to (0,1) via
clinical=clin.mm
clinical$vital_status<- as.numeric(clinical$vital_status == "Dead")
Then I run the code
tabSurvKM <- TCGAanalyze_SurvivalKM(clinical, as.data.frame(dataMMcomplete), Genelist = G_list2, Survresult = TRUE, p.cut = 0.05, ThreshTop = 0.67, ThreshDown = 0.33, group1=gr1, group2=gr2)

But the error still remains....

@daniel-spies
Copy link

I encountered the same error, due in my case it's due to the fact the the bcr_patient_barcode is a sequence of more than 12 characters but the TCGAanalyze_SurvivalKM tries to merge the clinical barcode with only the first 12 characters of the expression matrix colnames

cfu <- clinical_patient[clinical_patient[, "bcr_patient_barcode"] %in% substr(colnames(dataCancer), 1, 12), ]

thus creating an empty cfu object and failing downstream to filter as it has 0 rows

@azra2510
Copy link

hi,

1. When I follow your tutorial Case study n. 1: Pan Cancer downstream analysis BRCA, error raised in:

dataSurv <- TCGAanalyze_SurvivalKM(
    clinical_patient = dataClin,
    dataGE = dataFilt,
    Genelist = rownames(dataDEGs),
    Survresult = FALSE,
    ThreshTop = 0.67,
    ThreshDown = 0.33,
    p.cut = 0.05, 
    group1 = group1, 
    group2 = group2
)

no applicable method for 'filter' applied to an object of class "c('matrix', 'array', 'double', 'numeric')"

2. I change parameter dataGE=dataFilt to dataGE = as.data.frame(dataFilt), it said failed to filter with same columns.

On closer inspection, I find duplicated sample in download BRCA expression data. After deduplicated, all thing go OK with this

dataSurv <- TCGAanalyze_SurvivalKM(
    clinical_patient = dataClin,
    dataGE = as.data.frame(dataFilt),
    Genelist = rownames(dataDEGs),
    Survresult = FALSE,
    ThreshTop = 0.67,
    ThreshDown = 0.33,
    p.cut = 0.05, 
    group1 = group1, 
    group2 = group2
)

However, dataSurv result is empty.

**3. ** Carefully read the source code, I replace this code mRNAselected_values <- dataCancer %>% dplyr::filter(rownames(dataCancer) == mRNAselected) %>% as.numeric mRNAselected_values_normal <- dataNormal %>% dplyr::filter(rownames(dataNormal) == mRNAselected) %>% as.numeric with mRNAselected_values <- as.data.frame(dataCancer) %>% dplyr::filter(rownames(dataCancer) == mRNAselected) %>% unlist() mRNAselected_values_normal <- as.data.frame(dataNormal) %>% dplyr::filter(rownames(dataNormal) == mRNAselected) %>% unlist() After this, it workd!

Thanks a lot for your outstanding work.

Hello, I recently tried to use the function TCGAanalyze_SurvivalKM however, i have the same problem that you encountered. First, i tried to convert the dataGE into a dataframe, but i had en error signaling that i had duplicates. I removed the duplicates in the dataCancer (from the code source) and retried with the same modifications that you brought. When running the source code, it didn't work. It said that no Threshtop was defined. Any wonder what i can do to fix this? Thanks in advance for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants