Search
Question: tximport error: all(names(aveLengthSampGene) == rownames(lengthMat)) is not TRUE
0
gravatar for macmanes
4 months ago by
macmanes0
macmanes0 wrote:

 

I'm having an error with the importing of Salmon data via tximport.

txi.all <- tximport(all_files, type = "salmon", tx2gene = tx2gene)
reading in files with read_tsv
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 
transcripts missing from tx2gene: 36704
summarizing abundance
summarizing counts
summarizing length
Error: all(names(aveLengthSampGene) == rownames(lengthMat)) is not TRUE
In addition: Warning messages:
1: In rowsum.default(abundanceMatTx, geneId) : missing values for 'group'
2: In rowsum.default(countsMatTx, geneId) : missing values for 'group'
3: In rowsum.default(abundanceMatTx * lengthMatTx, geneId) :
  missing values for 'group'
4: In names(aveLengthSampGene) == rownames(lengthMat) :
  longer object length is not a multiple of shorter object length​

Here is the tx2gene file, there are no duplicates in col1, but there are (necessarily) in col2

head(tx2gene)
                                txpid  entrezid
1  NODE_100013_length_285_cov_3.16957 107049498
2 NODE_100209_length_284_cov_0.838428 107055031
3  NODE_100282_length_284_cov_1.67686 100873158
4  NODE_100290_length_284_cov_1.24891    419771
5  NODE_100321_length_284_cov_1.24454    429098
6  NODE_100459_length_284_cov_2.58952    429951​

Here is the session info

R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
 [1] grid      stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] Rgraphviz_2.20.0     topGO_2.28.0         SparseM_1.77         GO.db_3.4.1          AnnotationDbi_1.38.1
 [6] IRanges_2.10.2       S4Vectors_0.14.3     Biobase_2.36.2       graph_1.54.0         BiocGenerics_0.22.0 
[11] gplots_3.0.1         statmod_1.4.30       locfit_1.5-9.1       readr_1.1.1          tximport_1.4.0      
[16] edgeR_3.18.1         limma_3.32.2         BiocInstaller_1.26.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.11       compiler_3.4.0     bitops_1.0-6       tools_3.4.0        digest_0.6.12      bit_1.1-12        
 [7] RSQLite_2.0        memoise_1.1.0      tibble_1.3.3       lattice_0.20-35    pkgconfig_2.0.1    rlang_0.1.1       
[13] DBI_0.7            gtools_3.5.0       caTools_1.17.1     hms_0.3            bit64_0.9-7        R6_2.2.2          
[19] gdata_2.18.0       blob_1.1.0         matrixStats_0.52.2 KernSmooth_2.23-15 rjson_0.2.15      

 

I have seen 1 other report of this issue, which was thought to be a results of duplicates in the transcriptID column - this is not the case with my dataset.  Please advise.. 

dim(tx2gene)
[1] 61234     2
> tx2gene2 <- tx2gene[!duplicated(tx2gene[,1]),]
> dim(tx2gene2)
[1] 61234     2​
ADD COMMENTlink modified 4 months ago by Michael Love14k • written 4 months ago by macmanes0
1
gravatar for Michael Love
4 months ago by
Michael Love14k
United States
Michael Love14k wrote:

The "missing values" in group is saying that the grouping factor (second column of tx2gene) has missing values. Maybe it was a large data.frame and then you removed some rows? Can you try droplevels() on the second column of tx2gene?

ADD COMMENTlink written 4 months ago by Michael Love14k

Perfect! You rock!

I had coded in 'NA' to fill missing values in the geneID column, which R (appropriately) sees as missing. Getting rid of those fixes the issue.  Thanks a bunch. 

ADD REPLYlink written 4 months ago by macmanes0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 115 users visited in the last hour