fogellab / multiWGCNA

an R package for deep mining gene co-expression networks in multi-trait expression data
16 stars 2 forks source link

Error in constructNetworks #19

Closed CCCff0615 closed 2 weeks ago

CCCff0615 commented 4 months ago

I have tried use dataframe or summarizedExperiment project to construct Networks, but it always in error. I am sure about there is no duplicate rownames with my counts file and sample information. Does anyone can help me to fix this? the console output below: se <- SummarizedExperiment(assays = list(microarray = root_counts_matrix),colData = col_data) root_networks = constructNetworks(se, sampletable, networkType = "unsigned", power = 10, minModuleSize = 40, maxBlockSize = 25000, reassignThreshold = 0, minKMEtoStay = 0.7, mergeCutHeight = 0.10, numericLabels = TRUE, pamRespectsDendro = FALSE, verbose=3) Flagging genes and samples with too many missing values... ..step 1 ..step 2 Calculating module eigengenes block-wise from all genes Flagging genes and samples with too many missing values... ..step 1 ....pre-clustering genes to determine blocks.. Projective K-means: ..k-means clustering.. ..merging smaller clusters... Block sizes: gBlocks 1 2 22536 7882 ..Working on block 1 . TOM calculation: adjacency.. ..will not use multithreading. Fraction of slow calculations: 0.000000 ..connectivity.. ..matrix multiplication (system BLAS).. ..normalization.. ..done. ....clustering.. ....detecting modules.. ....calculating module eigengenes.. ....checking kME in modules.. ..removing 486 genes from module 1 because their KME is too low. ..removing 383 genes from module 2 because their KME is too low. ..removing 316 genes from module 3 because their KME is too low. ..removing 312 genes from module 4 because their KME is too low. ..removing 353 genes from module 5 because their KME is too low. ..removing 312 genes from module 6 because their KME is too low. ..removing 267 genes from module 7 because their KME is too low. ..removing 316 genes from module 8 because their KME is too low. ..removing 244 genes from module 9 because their KME is too low. ..removing 235 genes from module 10 because their KME is too low. ..removing 29 genes from module 11 because their KME is too low. ..removing 38 genes from module 12 because their KME is too low. ..removing 164 genes from module 13 because their KME is too low. ..removing 162 genes from module 14 because their KME is too low. ..removing 63 genes from module 15 because their KME is too low. ..removing 136 genes from module 16 because their KME is too low. ..removing 88 genes from module 17 because their KME is too low. ..removing 63 genes from module 18 because their KME is too low. ..removing 107 genes from module 19 because their KME is too low. ..removing 190 genes from module 20 because their KME is too low. ..removing 141 genes from module 21 because their KME is too low. ..removing 121 genes from module 22 because their KME is too low. ..removing 113 genes from module 23 because their KME is too low. ..removing 62 genes from module 24 because their KME is too low. ..removing 62 genes from module 25 because their KME is too low. ..removing 65 genes from module 26 because their KME is too low. ..removing 72 genes from module 27 because their KME is too low. ..removing 63 genes from module 28 because their KME is too low. ..removing 58 genes from module 29 because their KME is too low. ..removing 105 genes from module 30 because their KME is too low. ..removing 69 genes from module 31 because their KME is too low. ..removing 33 genes from module 32 because their KME is too low. ..removing 8 genes from module 33 because their KME is too low. ..removing 40 genes from module 34 because their KME is too low. ..removing 79 genes from module 35 because their KME is too low. ..removing 83 genes from module 36 because their KME is too low. ..removing 14 genes from module 37 because their KME is too low. ..removing 68 genes from module 38 because their KME is too low. ..removing 17 genes from module 39 because their KME is too low. ..removing 20 genes from module 40 because their KME is too low. ..removing 33 genes from module 41 because their KME is too low. ..removing 42 genes from module 42 because their KME is too low. ..removing 31 genes from module 43 because their KME is too low. ..removing 8 genes from module 44 because their KME is too low. ..removing 6 genes from module 45 because their KME is too low. ..removing 23 genes from module 46 because their KME is too low. ..removing 24 genes from module 47 because their KME is too low. ..removing 68 genes from module 48 because their KME is too low. ..removing 71 genes from module 49 because their KME is too low. ..removing 52 genes from module 50 because their KME is too low. ..removing 24 genes from module 51 because their KME is too low. ..removing 28 genes from module 52 because their KME is too low. ..removing 53 genes from module 53 because their KME is too low. ..removing 46 genes from module 54 because their KME is too low. ..removing 3 genes from module 55 because their KME is too low. ..removing 13 genes from module 56 because their KME is too low. ..removing 19 genes from module 57 because their KME is too low. ..removing 43 genes from module 58 because their KME is too low. ..removing 38 genes from module 59 because their KME is too low. ..removing 25 genes from module 60 because their KME is too low. ..removing 4 genes from module 61 because their KME is too low. ..removing 11 genes from module 62 because their KME is too low. ..removing 52 genes from module 63 because their KME is too low. ..removing 48 genes from module 64 because their KME is too low. ..removing 38 genes from module 65 because their KME is too low. ..removing 14 genes from module 66 because their KME is too low. ..removing 24 genes from module 67 because their KME is too low. ..removing 4 genes from module 68 because their KME is too low. ..removing 33 genes from module 69 because their KME is too low. ..removing 38 genes from module 70 because their KME is too low. ..removing 25 genes from module 72 because their KME is too low. ..removing 1 genes from module 73 because their KME is too low. ..removing 14 genes from module 74 because their KME is too low. ..removing 19 genes from module 75 because their KME is too low. ..Working on block 2 . TOM calculation: adjacency.. ..will not use multithreading. Fraction of slow calculations: 0.000000 ..connectivity.. ..matrix multiplication (system BLAS).. ..normalization.. ..done. ....clustering.. ....detecting modules.. ....calculating module eigengenes.. ....checking kME in modules.. ..removing 793 genes from module 1 because their KME is too low. ..removing 398 genes from module 2 because their KME is too low. ..removing 231 genes from module 3 because their KME is too low. ..removing 146 genes from module 4 because their KME is too low. ..removing 181 genes from module 5 because their KME is too low. ..removing 115 genes from module 6 because their KME is too low. ..removing 158 genes from module 7 because their KME is too low. ..removing 89 genes from module 8 because their KME is too low. ..removing 124 genes from module 9 because their KME is too low. ..removing 115 genes from module 10 because their KME is too low. ..removing 96 genes from module 11 because their KME is too low. ..removing 99 genes from module 12 because their KME is too low. ..removing 80 genes from module 13 because their KME is too low. ..removing 82 genes from module 14 because their KME is too low. ..removing 60 genes from module 15 because their KME is too low. ..removing 74 genes from module 16 because their KME is too low. ..removing 70 genes from module 17 because their KME is too low. ..removing 72 genes from module 18 because their KME is too low. ..removing 47 genes from module 19 because their KME is too low. ..removing 53 genes from module 20 because their KME is too low. ..removing 51 genes from module 21 because their KME is too low. ..removing 65 genes from module 22 because their KME is too low. ..removing 36 genes from module 23 because their KME is too low. ..removing 53 genes from module 24 because their KME is too low. ..removing 43 genes from module 25 because their KME is too low. ..removing 48 genes from module 26 because their KME is too low. ..removing 20 genes from module 27 because their KME is too low. ..removing 32 genes from module 28 because their KME is too low. ..removing 26 genes from module 29 because their KME is too low. ..removing 33 genes from module 30 because their KME is too low. ..removing 25 genes from module 31 because their KME is too low. ..removing 28 genes from module 32 because their KME is too low. ..removing 19 genes from module 33 because their KME is too low. ..merging modules that are too close.. mergeCloseModules: Merging modules whose distance is less than 0.1 Calculating new MEs... softConnectivity: FYI: connecitivty of genes with less than 16 valid samples will be returned as NA. ..calculating connectivities....100% Error in .rowNamesDF<-(x, value = value) : duplicate 'row.names' are not allowed In addition: Warning message: non-unique values when setting 'row.names':

talgalper commented 4 months ago

I am also receiving this error. I have run the examples from the vignette just fine but when i insert my own data (exact same structure) I receive the error. I have also attempted to change all my row and columns names to unique numerical values to be sure. Still doesn’t work.

dariotommasini commented 4 months ago

Sorry for the delay, I'm taking a look now.

dariotommasini commented 4 months ago

Could you show me your sampleTable? It seems that someone else was having this issue recently and resolved it by fixing their metadata: https://github.com/fogellab/multiWGCNA/issues/18

talgalper commented 4 months ago

Here is mine. My datExpr object is just a data frame which according to the documentation should work fine. I also replicated the structure of the expression matrix in the autism example:

str(sampleTable) Formal class 'DFrame' [package "S4Vectors"] with 6 slots ..@ rownames : chr [1:714] "TCGA-3C-AAAU-01A-11R-A41B-07" "TCGA-3C-AALK-01A-11R-A41B-07" "TCGA-4H-AAAK-01A-12R-A41B-07" "TCGA-5L-AAT0-01A-12R-A41B-07" ... ..@ nrows : int 714 ..@ elementType : chr "ANY" ..@ elementMetadata: NULL ..@ metadata : list() ..@ listData :List of 3 .. ..$ cases : chr [1:714] "TCGA-3C-AAAU-01A-11R-A41B-07" "TCGA-3C-AALK-01A-11R-A41B-07" "TCGA-4H-AAAK-01A-12R-A41B-07" "TCGA-5L-AAT0-01A-12R-A41B-07" ... .. ..$ Subtype_Selected : chr [1:714] "BRCA.LumA" "BRCA.LumA" "BRCA.LumA" "BRCA.LumA" ... .. ..$ ajcc_pathologic_stage: chr [1:714] "Stage X" "Stage IA" "Stage IIIA" "Stage IIA" ...

dariotommasini commented 3 months ago

Thank you @talgalper !

Could you try renaming your column with the sample ids (cases?) as "Sample"? The sample column has to be labeled as "Sample" with uppercase S. Sorry I should update the documentation to highlight this. Also, can you remove the underscores from your other column names e.g. Subtype_Selected and ajcc_pathologic_stage? I think I use underscores for parsing downstream. It's almost certainly one of these problems.

For example, the sampleTable for autism dataset looks like this:

> sampleTable
DataFrame with 58 rows and 3 columns
               Sample      Status      Tissue
          <character> <character> <character>
GSM706412   GSM706412      autism          FC
GSM706413   GSM706413      autism          FC
GSM706414   GSM706414      autism          FC
GSM706415   GSM706415      autism          FC
GSM706416   GSM706416      autism          FC
...               ...         ...         ...
GSM706465   GSM706465    controls          TC
GSM706466   GSM706466    controls          TC
GSM706467   GSM706467    controls          TC
GSM706468   GSM706468    controls          TC
GSM706469   GSM706469    controls          TC
talgalper commented 3 months ago

I changed the sample column to "Sample" which did not fix the error. I then removed all the "-" form the sample names as well as the "BRCA." from the subtypes. I also changed the column for the subtypes to "Status" for good measure. This worked but I now seem to be getting a new error:

str(sampleTable) Formal class 'DFrame' [package "S4Vectors"] with 6 slots ..@ rownames : chr [1:714] "TCGA3CAAAU01A11RA41B07" "TCGA3CAALK01A11RA41B07" "TCGA4HAAAK01A12RA41B07" "TCGA5LAAT001A12RA41B07" ... ..@ nrows : int 714 ..@ elementType : chr "ANY" ..@ elementMetadata: NULL ..@ metadata : list() ..@ listData :List of 3 .. ..$ Sample : chr [1:714] "TCGA3CAAAU01A11RA41B07" "TCGA3CAALK01A11RA41B07" "TCGA4HAAAK01A12RA41B07" "TCGA5LAAT001A12RA41B07" ... .. ..$ Subtype: chr [1:714] "LumA" "LumA" "LumA" "LumA" ... .. ..$ Stage : chr [1:714] "X" "IA" "IIIA" "IIA" ...

str(se) Formal class 'SummarizedExperiment' [package "SummarizedExperiment"] with 5 slots ..@ colData :Formal class 'DFrame' [package "S4Vectors"] with 6 slots .. .. ..@ rownames : chr [1:714] "TCGA3CAAAU01A11RA41B07" "TCGA3CAALK01A11RA41B07" "TCGA4HAAAK01A12RA41B07" "TCGA5LAAT001A12RA41B07" ... .. .. ..@ nrows : int 714 .. .. ..@ elementType : chr "ANY" .. .. ..@ elementMetadata: NULL .. .. ..@ metadata : list() .. .. ..@ listData :List of 3 .. .. .. ..$ Sample: chr [1:714] "TCGA3CAAAU01A11RA41B07" "TCGA3CAALK01A11RA41B07" "TCGA4HAAAK01A12RA41B07" "TCGA5LAAT001A12RA41B07" ... .. .. .. ..$ Status: chr [1:714] "LumA" "LumA" "LumA" "LumA" ... .. .. .. ..$ Stage : chr [1:714] "X" "IA" "IIIA" "IIA" ... ..@ assays :Formal class 'SimpleAssays' [package "SummarizedExperiment"] with 1 slot .. .. ..@ data:Formal class 'SimpleList' [package "S4Vectors"] with 4 slots .. .. .. .. ..@ listData :List of 1 .. .. .. .. .. ..$ LumA_unstranded:'data.frame': 1500 obs. of 714 variables: .. .. .. .. .. .. ..$ TCGA3CAAAU01A11RA41B07: num [1:1500] 4.86 12.14 2.61 5.54 5.14 ... .. .. .. .. .. .. ..$ TCGA3CAALK01A11RA41B07: num [1:1500] 11.1 11.34 3.94 5.75 3.82 ... .. .. .. .. .. .. ..$ TCGA4HAAAK01A12RA41B07: num [1:1500] 8.39 11.98 3.25 6.02 4.27 ... .. .. .. .. .. .. ..$ TCGA5LAAT001A12RA41B07: num [1:1500] 7.54 11.79 1.93 5.77 3.8 ... .. .. .. .. .. .. ..$ TCGA5LAAT101A12RA41B07: num [1:1500] 7.03 12.14 1.93 5.81 4.58 ... .. .. .. .. .. .. ..$ TCGAA1A0SD01A11RA11507: num [1:1500] 10.06 11.55 4.37 4.24 3.53 ... .. .. .. .. .. .. ..$ TCGAA1A0SE01A11RA08407: num [1:1500] 8.85 11.41 1.93 4.19 3.66 ... .. .. .. .. .. .. ..$ TCGAA1A0SF01A11RA14407: num [1:1500] 8.24 11.54 3.01 4.49 4.63 ... .. .. .. .. .. .. ..$ TCGAA1A0SG01A11RA14407: num [1:1500] 6.96 12.01 2.66 5.01 4.46 ... .. .. .. .. .. .. ..$ TCGAA1A0SH01A11RA08407: num [1:1500] 11.79 11.41 1.93 4.36 2.98 ... .. .. .. .. .. .. ..$ TCGAA1A0SJ01A11RA08407: num [1:1500] 6.49 11.51 3.37 4.49 3.9 ... .. .. .. .. .. .. ..$ TCGAA1A0SM01A11RA08407: num [1:1500] 13.52 11.59 5.59 4.46 3.42 ... .. .. .. .. .. .. ..$ TCGAA1A0SQ01A21RA14407: num [1:1500] 3.24 11.96 1.93 4.17 4.64 ... .. .. .. .. .. .. ..$ TCGAA2A04N01A11RA11507: num [1:1500] 7.54 11.74 3.15 5.33 3.33 ... .. .. .. .. .. .. ..$ TCGAA2A04V01A21RA03407: num [1:1500] 3.69 10.83 2.68 4.94 3.69 ... .. .. .. .. .. .. ..$ TCGAA2A0CK01A11RA22K07: num [1:1500] 5.27 12.4 2.65 5.84 4.99 ... .. .. .. .. .. .. ..$ TCGAA2A0CO01A13RA22K07: num [1:1500] 7.45 11.93 3.89 5.53 4.78 ... .. .. .. .. .. .. ..$ TCGAA2A0CP01A11RA03407: num [1:1500] 6.41 11.94 6.62 4.47 3.51 ... .. .. .. .. .. .. ..$ TCGAA2A0CQ01A21RA03407: num [1:1500] 3.53 12.16 1.93 5 5.68 ... .. .. .. .. .. .. ..$ TCGAA2A0CR01A11RA22K07: num [1:1500] 7.23 13.18 6.34 6.08 4.72 ... .. .. .. .. .. .. ..$ TCGAA2A0CS01A11RA11507: num [1:1500] 4.44 12.23 1.93 3.56 4.13 ... .. .. .. .. .. .. ..$ TCGAA2A0CT01A31RA05607: num [1:1500] 8.97 12.12 7.71 5.25 4.87 ... .. .. .. .. .. .. ..$ TCGAA2A0CU01A12RA03407: num [1:1500] 5.62 12.01 1.93 4.59 3.64 ... .. .. .. .. .. .. ..$ TCGAA2A0CV01A31RA11507: num [1:1500] 7.3 12.25 3.17 4.23 4.1 ... .. .. .. .. .. .. ..$ TCGAA2A0D301A11RA11507: num [1:1500] 5.98 11.59 1.93 4.18 3.94 ... .. .. .. .. .. .. ..$ TCGAA2A0EM01A11RA03407: num [1:1500] 6.01 12.16 2.65 4.14 3.62 ... .. .. .. .. .. .. ..$ TCGAA2A0EN01A13RA08407: num [1:1500] 6.01 11.35 2.61 4.36 3.52 ... .. .. .. .. .. .. ..$ TCGAA2A0EO01A11RA03407: num [1:1500] 7.86 11.48 1.93 3.92 3.31 ... .. .. .. .. .. .. ..$ TCGAA2A0EP01A52RA22U07: num [1:1500] 9.78 12.39 3.08 5.38 3.93 ... .. .. .. .. .. .. ..$ TCGAA2A0ER01A21RA03407: num [1:1500] 5.23 12.42 1.93 3.94 4.02 ... .. .. .. .. .. .. ..$ TCGAA2A0ES01A11RA11507: num [1:1500] 9.16 12.31 5.64 4.59 3.72 ... .. .. .. .. .. .. ..$ TCGAA2A0ET01A31RA03407: num [1:1500] 4.11 13.67 3.82 5.1 5.44 ... .. .. .. .. .. .. ..$ TCGAA2A0EU01A22RA05607: num [1:1500] 8.42 11.54 2.98 5.43 3.2 ... .. .. .. .. .. .. ..$ TCGAA2A0EV01A11RA03407: num [1:1500] 5.93 11.69 1.93 4.32 4.46 ... .. .. .. .. .. .. ..$ TCGAA2A0EW01A21RA11507: num [1:1500] 7.54 12.05 2.9 4.53 3.67 ... .. .. .. .. .. .. ..$ TCGAA2A0EX01A21RA03407: num [1:1500] 6.06 11.39 1.93 3.79 3.64 ... .. .. .. .. .. .. ..$ TCGAA2A0SU01A11RA08407: num [1:1500] 8.3 11.93 1.93 3.63 3.47 ... .. .. .. .. .. .. ..$ TCGAA2A0SY01A31RA08407: num [1:1500] 6.01 11.82 3.3 4.72 3.58 ... .. .. .. .. .. .. ..$ TCGAA2A0T401A31RA08407: num [1:1500] 11.36 11.5 4.3 4.56 3.08 ... .. .. .. .. .. .. ..$ TCGAA2A0T501A21RA08407: num [1:1500] 8.58 11.4 3.5 4.76 3.17 ... .. .. .. .. .. .. ..$ TCGAA2A0T601A11RA08407: num [1:1500] 6.45 12.14 2.58 3.78 3.95 ... .. .. .. .. .. .. ..$ TCGAA2A0T701A21RA08407: num [1:1500] 7.95 11.77 3.91 4.62 2.83 ... .. .. .. .. .. .. ..$ TCGAA2A0YC01A11RA10907: num [1:1500] 6.04 11.74 1.93 4.47 3.91 ... .. .. .. .. .. .. ..$ TCGAA2A0YD01A11RA10907: num [1:1500] 8.12 11.71 5.38 4.09 3.64 ... .. .. .. .. .. .. ..$ TCGAA2A0YF01A21RA10907: num [1:1500] 4.45 12.6 2.56 3.01 3.54 ... .. .. .. .. .. .. ..$ TCGAA2A0YI01A31RA10J07: num [1:1500] 4.53 11.91 1.93 4.88 3.84 ... .. .. .. .. .. .. ..$ TCGAA2A0YL01A21RA10907: num [1:1500] 9.72 11.56 3.05 4.9 1.93 ... .. .. .. .. .. .. ..$ TCGAA2A1FV01A11RA13Q07: num [1:1500] 6.82 12.51 1.93 5.14 3.72 ... .. .. .. .. .. .. ..$ TCGAA2A1FZ01A51RA14D07: num [1:1500] 7.68 11.58 1.93 3.57 3.71 ... .. .. .. .. .. .. ..$ TCGAA2A1G001A11RA13Q07: num [1:1500] 5.14 12 3.23 4.26 3.49 ... .. .. .. .. .. .. ..$ TCGAA2A25901A11RA16F07: num [1:1500] 7.79 12.56 3.46 5.21 2.84 ... .. .. .. .. .. .. ..$ TCGAA2A25D01A12RA16F07: num [1:1500] 5.95 11.75 2.66 5.11 3.51 ... .. .. .. .. .. .. ..$ TCGAA2A3KC01A11RA21307: num [1:1500] 5.57 12.05 4.13 5.3 3.78 ... .. .. .. .. .. .. ..$ TCGAA2A3KD01A12RA21307: num [1:1500] 6.29 11.45 3.07 4.76 3.9 ... .. .. .. .. .. .. ..$ TCGAA2A4RW01A21RA26607: num [1:1500] 9.92 11.15 2.82 6.17 3.17 ... .. .. .. .. .. .. ..$ TCGAA2A4S001A21RA26607: num [1:1500] 4.78 12.77 1.93 5.3 4.7 ... .. .. .. .. .. .. ..$ TCGAA2A4S201A12RA26607: num [1:1500] 6.5 12.2 1.93 5.38 3.54 ... .. .. .. .. .. .. ..$ TCGAA7A0CD01A11RA00Z07: num [1:1500] 4.09 11.36 1.93 5.39 3.94 ... .. .. .. .. .. .. ..$ TCGAA7A0CG01A12RA05607: num [1:1500] 15.28 11.56 1.93 3.77 3.18 ... .. .. .. .. .. .. ..$ TCGAA7A0CH01A21RA00Z07: num [1:1500] 7.22 12.23 1.93 3.87 2.71 ... .. .. .. .. .. .. ..$ TCGAA7A0D901A31RA05607: num [1:1500] 7.41 11.73 6.86 5.27 3.2 ... .. .. .. .. .. .. ..$ TCGAA7A0DB01A11RA00Z07: num [1:1500] 12.13 11.52 3.49 3.95 3.49 ... .. .. .. .. .. .. ..$ TCGAA7A0DC01A11RA00Z07: num [1:1500] 3.24 9.91 1.93 5.83 3.59 ... .. .. .. .. .. .. ..$ TCGAA7A13G01A11RA13Q07: num [1:1500] 4.97 8.82 2.68 5.28 2.68 ... .. .. .. .. .. .. ..$ TCGAA7A13G11A51RA13Q07: num [1:1500] 8.49 12.98 1.93 4.65 3.68 ... .. .. .. .. .. .. ..$ TCGAA7A13H01A11RA22K07: num [1:1500] 8.27 12.11 2.59 5.36 3.48 ... .. .. .. .. .. .. ..$ TCGAA7A26E01A11RA16907: num [1:1500] 6.1 11.94 1.93 4.08 3.56 ... .. .. .. .. .. .. ..$ TCGAA7A26H01A11RA16907: num [1:1500] 7.14 11.3 1.93 4.94 3.21 ... .. .. .. .. .. .. ..$ TCGAA7A26J01A11RA16907: num [1:1500] 6.25 12.18 2.55 4 3.93 ... .. .. .. .. .. .. ..$ TCGAA7A3IY01A21RA21T07: num [1:1500] 7.93 12.1 2.63 5.22 3.29 ... .. .. .. .. .. .. ..$ TCGAA7A3IZ01A11RA21307: num [1:1500] 3.28 13.11 1.93 4.54 5.02 ... .. .. .. .. .. .. ..$ TCGAA7A3J001A11RA21307: num [1:1500] 3.27 13.59 1.93 4.58 5.09 ... .. .. .. .. .. .. ..$ TCGAA7A3J101A11RA21307: num [1:1500] 6.91 12.65 2.51 5.34 4.37 ... .. .. .. .. .. .. ..$ TCGAA7A3RF01A11RA22K07: num [1:1500] 2.65 13.89 2.65 4.87 5.13 ... .. .. .. .. .. .. ..$ TCGAA7A42501A11RA24H07: num [1:1500] 7.86 12.47 2.92 6.48 3.58 ... .. .. .. .. .. .. ..$ TCGAA7A42601A22RA24H07: num [1:1500] 7.64 12.59 2.95 6.44 4.06 ... .. .. .. .. .. .. ..$ TCGAA7A4SA01A11RA26607: num [1:1500] 4.88 11.75 2.79 6.02 4.39 ... .. .. .. .. .. .. ..$ TCGAA7A4SB01A21RA26607: num [1:1500] 5.58 11.99 1.93 6.44 3.17 ... .. .. .. .. .. .. ..$ TCGAA7A4SC01A12RA26607: num [1:1500] 9.89 11.7 3.94 4.99 3.41 ... .. .. .. .. .. .. ..$ TCGAA7A56D01A11RA27Q07: num [1:1500] 5.84 12.43 5.73 6.72 4.61 ... .. .. .. .. .. .. ..$ TCGAA7A5ZW01A12RA29R07: num [1:1500] 9.1 12.1 3 4.25 2.7 ... .. .. .. .. .. .. ..$ TCGAA7A5ZX01A12RA29R07: num [1:1500] 9.35 12.2 7.81 5.94 3.34 ... .. .. .. .. .. .. ..$ TCGAA8A06P01A11RA00Z07: num [1:1500] 6.54 12.42 2.9 4.34 3.42 ... .. .. .. .. .. .. ..$ TCGAA8A06T01A11RA00Z07: num [1:1500] 2.96 12.5 1.93 5.01 4.14 ... .. .. .. .. .. .. ..$ TCGAA8A06U01A11RA00Z07: num [1:1500] 6.56 11.72 1.93 5.41 3.21 ... .. .. .. .. .. .. ..$ TCGAA8A06Y01A21RA00Z07: num [1:1500] 8.01 11.23 2.71 4.6 3.02 ... .. .. .. .. .. .. ..$ TCGAA8A07B01A11RA00Z07: num [1:1500] 9.47 12.17 1.93 5.68 3.49 ... .. .. .. .. .. .. ..$ TCGAA8A07E01A11RA03407: num [1:1500] 11.18 11.11 4.06 3.75 3.75 ... .. .. .. .. .. .. ..$ TCGAA8A07F01A11RA00Z07: num [1:1500] 9.42 11.56 2.56 4.86 3.41 ... .. .. .. .. .. .. ..$ TCGAA8A07G01A11RA03407: num [1:1500] 11.6 11.3 4.04 4.04 2.9 ... .. .. .. .. .. .. ..$ TCGAA8A07J01A11RA00Z07: num [1:1500] 3.69 11.66 1.93 3.84 3.52 ... .. .. .. .. .. .. ..$ TCGAA8A07P01A11RA00Z07: num [1:1500] 3.49 10.36 1.93 5.16 4.05 ... .. .. .. .. .. .. ..$ TCGAA8A07Z01A11RA00Z07: num [1:1500] 4.86 12.18 1.93 4.22 4.33 ... .. .. .. .. .. .. ..$ TCGAA8A08301A21RA00Z07: num [1:1500] 9.07 12.12 1.93 4.25 5.04 ... .. .. .. .. .. .. ..$ TCGAA8A08601A11RA00Z07: num [1:1500] 4.77 11.38 1.93 5.37 4.25 ... .. .. .. .. .. .. ..$ TCGAA8A08A01A11RA32Y07: num [1:1500] 2.65 12.09 1.93 5.48 4.22 ... .. .. .. .. .. .. ..$ TCGAA8A08C01A11RA00Z07: num [1:1500] 5.06 12.14 1.93 4.45 3.91 ... .. .. .. .. .. .. ..$ TCGAA8A08O01A21RA05607: num [1:1500] 5.48 11.33 3.23 4.86 3.41 ... .. .. .. .. .. .. ..$ TCGAA8A08T01A21RA00Z07: num [1:1500] 4.08 12.12 1.93 6.02 3.83 ... .. .. .. .. .. .. .. [list output truncated] .. .. .. .. ..@ elementType : chr "ANY" .. .. .. .. ..@ elementMetadata: NULL .. .. .. .. ..@ metadata : list() ..@ NAMES : chr [1:1500] "ENSG00000137975" "ENSG00000220205" "ENSG00000183072" "ENSG00000260924" ... ..@ elementMetadata:Formal class 'DFrame' [package "S4Vectors"] with 6 slots .. .. ..@ rownames : NULL .. .. ..@ nrows : int 1500 .. .. ..@ elementType : chr "ANY" .. .. ..@ elementMetadata: NULL .. .. ..@ metadata : list() .. .. ..@ listData :List of 1 .. .. .. ..$ X: chr [1:1500] "ENSG00000137975" "ENSG00000220205" "ENSG00000183072" "ENSG00000260924" ... ..@ metadata : list()

LumA_networks <- constructNetworks(se, sampleTable, conditions1, conditions2, networkType = "unsigned", power = 10, minModuleSize = 40, maxBlockSize = 25000, reassignThreshold = 0, minKMEtoStay = 0.7, mergeCutHeight = 0.10, numericLabels = TRUE, pamRespectsDendro = FALSE, verbose=3, saveTOMs = FALSE) Flagging genes and samples with too many missing values... ..step 1 Calculating module eigengenes block-wise from all genes Flagging genes and samples with too many missing values... ..step 1 ..Working on block 1 . TOM calculation: adjacency.. ..will not use multithreading. Fraction of slow calculations: 0.000000 ..connectivity.. ..matrix multiplication (system BLAS).. ..normalization.. ..done. ....clustering.. ....detecting modules.. ....calculating module eigengenes.. ....checking kME in modules.. ..removing 97 genes from module 1 because their KME is too low. ..removing 55 genes from module 2 because their KME is too low. ..merging modules that are too close.. mergeCloseModules: Merging modules whose distance is less than 0.1 Calculating new MEs... softConnectivity: FYI: connecitivty of genes with less than 238 valid samples will be returned as NA. ..calculating connectivities....100% Flagging genes and samples with too many missing values... ..step 1 Calculating module eigengenes block-wise from all genes Flagging genes and samples with too many missing values... ..step 1 ..Working on block 1 . TOM calculation: adjacency.. ..will not use multithreading. Fraction of slow calculations: 0.000000 ..connectivity.. ..matrix multiplication (system BLAS).. ..normalization.. ..done. ....clustering.. ....detecting modules.. ....calculating module eigengenes.. ....checking kME in modules.. ..removing 26 genes from module 1 because their KME is too low. ..merging modules that are too close.. mergeCloseModules: Merging modules whose distance is less than 0.1 mergeCloseModules: less than two proper modules. ..color levels are 0, 1 ..there is nothing to merge. Calculating new MEs... softConnectivity: FYI: connecitivty of genes with less than 191 valid samples will be returned as NA. ..calculating connectivities....100% Flagging genes and samples with too many missing values... ..step 1 Calculating module eigengenes block-wise from all genes Flagging genes and samples with too many missing values... ..step 1 ..Working on block 1 . TOM calculation: adjacency.. ..will not use multithreading. Fraction of slow calculations: 0.000000 ..connectivity.. ..matrix multiplication (system BLAS).. ..normalization.. ..done. ....clustering.. ....detecting modules.. ....calculating module eigengenes.. ....checking kME in modules.. ..removing 179 genes from module 1 because their KME is too low. ..removing 86 genes from module 2 because their KME is too low. ..removing 57 genes from module 3 because their KME is too low. ..removing 33 genes from module 4 because their KME is too low. ..removing 31 genes from module 5 because their KME is too low. ..merging modules that are too close.. mergeCloseModules: Merging modules whose distance is less than 0.1 Calculating new MEs... softConnectivity: FYI: connecitivty of genes with less than 47 valid samples will be returned as NA. ..calculating connectivities....100% Flagging genes and samples with too many missing values... ..step 1 ..step 2 Calculating module eigengenes block-wise from all genes Flagging genes and samples with too many missing values... ..step 1 ..Working on block 1 . TOM calculation: adjacency.. ..will not use multithreading. Fraction of slow calculations: 0.000000 ..connectivity.. ..matrix multiplication (system BLAS).. ..normalization.. ..done. ....clustering.. ....detecting modules.. ....calculating module eigengenes.. ....checking kME in modules.. ..removing 73 genes from module 1 because their KME is too low. ..removing 50 genes from module 2 because their KME is too low. ..removing 44 genes from module 3 because their KME is too low. ..removing 19 genes from module 4 because their KME is too low. ..removing 36 genes from module 5 because their KME is too low. ..removing 26 genes from module 6 because their KME is too low. ..removing 34 genes from module 7 because their KME is too low. ..removing 15 genes from module 8 because their KME is too low. ..removing 28 genes from module 9 because their KME is too low. ..removing 13 genes from module 10 because their KME is too low. ..removing 15 genes from module 11 because their KME is too low. ..removing 13 genes from module 12 because their KME is too low. ..removing 24 genes from module 13 because their KME is too low. ..removing 15 genes from module 14 because their KME is too low. ..removing 23 genes from module 15 because their KME is too low. ..removing 21 genes from module 16 because their KME is too low. ..removing 5 genes from module 17 because their KME is too low. ..removing 7 genes from module 18 because their KME is too low. ..merging modules that are too close.. mergeCloseModules: Merging modules whose distance is less than 0.1 Calculating new MEs... softConnectivity: FYI: connecitivty of genes with less than 4 valid samples will be returned as NA. ..calculating connectivities....100%

Error in $<-.data.frame(*tmp*, "trait", value = character(0)) : replacement has 0 rows, data has 18

dariotommasini commented 3 months ago

Thank you. Could you print your sample table in a more readable format? Just the output of "sampleTable" would do.

talgalper commented 3 months ago

Sure thing:

sampleTable DataFrame with 714 rows and 3 columns Sample Subtype Stage

TCGA3CAAAU01A11RA41B07 TCGA3CAAAU01A11RA41B07 LumA X TCGA3CAALK01A11RA41B07 TCGA3CAALK01A11RA41B07 LumA IA TCGA4HAAAK01A12RA41B07 TCGA4HAAAK01A12RA41B07 LumA IIIA TCGA5LAAT001A12RA41B07 TCGA5LAAT001A12RA41B07 LumA IIA TCGA5LAAT101A12RA41B07 TCGA5LAAT101A12RA41B07 LumA IV ... ... ... ... TCGAWTAB4101A11RA41B07 TCGAWTAB4101A11RA41B07 LumA IIB TCGAWTAB4401A11RA41B07 TCGAWTAB4401A11RA41B07 LumA IA TCGAXXA89901A11RA36F07 TCGAXXA89901A11RA36F07 LumA IIIA TCGAXXA89A01A11RA36F07 TCGAXXA89A01A11RA36F07 LumA IIB TCGAZ7A8R501A42RA41B07 TCGAZ7A8R501A42RA41B07 LumA IIIA
dariotommasini commented 3 months ago

Thank you. Is your first trait just one condition? It looks like it's all LumA.

talgalper commented 3 months ago

No there are also the "Normal" samples mixed in there.

Organised by sample type:

DataFrame with 714 rows and 3 columns Sample Subtype Stage

TCGA3CAAAU01A11RA41B07 TCGA3CAAAU01A11RA41B07 LumA X TCGA3CAALK01A11RA41B07 TCGA3CAALK01A11RA41B07 LumA IA TCGA4HAAAK01A12RA41B07 TCGA4HAAAK01A12RA41B07 LumA IIIA TCGA5LAAT001A12RA41B07 TCGA5LAAT001A12RA41B07 LumA IIA TCGA5LAAT101A12RA41B07 TCGA5LAAT101A12RA41B07 LumA IV ... ... ... ... TCGALLA73Z01A11RA32P07 TCGALLA73Z01A11RA32P07 Normal IV TCGAOLA5D601A21RA27Q07 TCGAOLA5D601A21RA27Q07 Normal IIA TCGAOLA5RY01A21RA28M07 TCGAOLA5RY01A21RA28M07 Normal IIA TCGAOLA97C01A32RA41B07 TCGAOLA97C01A32RA41B07 Normal IIB TCGAPLA8LY01A11RA41B07 TCGAPLA8LY01A11RA41B07 Normal IIB
dariotommasini commented 3 months ago

Okay, that's good. Do your columns in your datExpr match your sample names here? If so, I can go in a troubleshoot with your data. In hindsight I should add all these checks in the construct networks function to make it easier to debug. I'll get on that.

talgalper commented 3 months ago

Yes they match.

talgalper commented 2 months ago

Any updates @dariotommasini?

dariotommasini commented 2 months ago

Hi @talgalper ,

I'm so sorry for the delay, I totally forgot. I will get to this first thing tomorrow. Thank you for following up!

dariotommasini commented 2 months ago

I just sent you an email. The issue seemed to be that some of your tumor stages had too few samples. I will add more message statements in constructNetworks function to make it easier to debug in the future!

talgalper commented 2 months ago

Ah ok all good, thanks for getting back! I realise now that you say that, when i subset my samples to test with i probably didn't take an even number of each stage.

Thanks again.

Virrau commented 2 months ago

How did you solve the problem ? I have the same error in my data and I can't understand why

talgalper commented 2 months ago

Initially the error was resolved by ensuring that all of the variables had at least 10 samples. However, when I tried it with a different dataset I go the error again. Still trying to figure it out. The author mentioned he was going to add some additional error messaging soon to help identify problematic networks.

dariotommasini commented 2 months ago

Yep, I added print statements to constructNetworks, so please give that a try!

You will need to reinstall from development using devtools.

Virrau commented 2 months ago

Is it mandatory to have at least 10 samples by variables ? In my case I tried to follow temporally my patients and so for most of them I have only like 3 to 5 times there names in the dataset. But even if I try to use constuctNetworks on different varaibles with at least 10 samples I still have the error