CharlesJB / ENCODExplorer

5 stars 4 forks source link

Error in clean_column from searchEncode #50

Open ericfournier2 opened 4 years ago

ericfournier2 commented 4 years ago

Since this week, the searchEncode example fails with an error:

> searchEncode("ChIP-Seq+H3K4me1")
Error in `[[<-.data.frame`(`*tmp*`, i, value = list(current_version = c("/analysis-step-versions/ggr-tr1-chip-seq-quantification-step-v-1-0/",  : 
  replacement has 20 rows, data has 10

1: searchEncode("ChIP-Seq+H3K4me1")
2: suppressWarnings(clean_table(r))
3: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
4: clean_table(r)
5: lapply(colnames(table), clean_column, table)
6: FUN(X[[i]], ...)
7: `[[<-`(`*tmp*`, i, value = list(current_version = c("/analysis-step-versions/ggr-tr1-chip-seq-quantification-step-v-1-0/", "/analysis-step-versions/ggr-tr1-chip-seq-quantification-step-v-1-0/", "/analysis-step-versions/ggr-tr1-chip
8: `[[<-.data.frame`(`*tmp*`, i, value = list(current_version = c("/analysis-step-versions/ggr-tr1-chip-seq-quantification-step-v-1-0/", "/analysis-step-versions/ggr-tr1-chip-seq-quantification-step-v-1-0/", "/analysis-step-versions/g

The error occurs because the table being cleaned (the one returned by searchEncode: searchEncode results aren't split into multiple tables) has a double-nested data.frame (The table has a data.frame column which itself has a data.frame column). clean_column does not handle such a case, and fails.

The downloaded table object, as it is passed to clean_column, is attached. The error occurs on the analysis_step_version column of the table, which is a data.frame including the analysis_step_version column, which is itself a 20-column data.frame.

ericfournier2 commented 4 years ago

clean_column_issue.zip

ericfournier2 commented 4 years ago

clean_column and clean_table are defined both in ENCODExplorer and ENCODExplorerData. They should be moved to ENCODExplorerData and exported from there to avoid duplication.

ericfournier2 commented 4 years ago

The underlying issue was fixed in commits ArnaudDroitLab/ENCODExplorerData@7b72207326505dcfaa18892cd09234c39f825df9 and ArnaudDroitLab/ENCODExplorerData@935ceb88a1587ebb0dce8dda52b8166137495588 from the ENCODExplorerData repository.

Commit e3e3095039374a51b9a7adb991e43e07768e2479 switches ENCODExplorer from using its local versions to using ENCODExplorerData's exported method.

I'll close this issue when ENCODExplorerData's fix will have propagated to BioCondoctor devel.

CharlesJB commented 4 years ago

Great! Thanks Éric!