stianlagstad / chimeraviz

chimeraviz is an R package that automates the creation of chimeric RNA visualizations.
37 stars 14 forks source link

data.table warning in vignette #62

Closed stianlagstad closed 5 years ago

stianlagstad commented 5 years ago

The package vignette has a few warnings as a result of the plot_fusion_transcript_with_protein_domain-call:

## Warning in `[<-.data.table`(`*tmp*`, i, , value =
## structure(list(Transcript_id = "ENST00000370031", : Coerced integer
## RHS to character to match the type of the target column (column 8 named
## 'plot_start'). If the target column's type character is correct, it's best
## for efficiency to avoid the coercion and create the RHS as type character.
## To achieve that consider R's type postfix: typeof(0L) vs typeof(0), and
## typeof(NA) vs typeof(NA_integer_) vs typeof(NA_real_). You can wrap the RHS
## with as.character() to avoid this warning, but that will still perform the
## coercion. If the target column's type is not correct, it's best to revisit
## where the DT was created and fix the column type there; e.g., by using
## colClasses= in fread(). Otherwise, you can change the column type now by
## plonking a new column (of the desired type) over the top of it; e.g. DT[,
## `plot_start`:=as.integer(`plot_start`)]. If the RHS of := has nrow(DT)
## elements then the assignment is called a column plonk and is the way to
## change a column's type. Column types can be observed with sapply(DT,typeof).

## Warning in `[<-.data.table`(`*tmp*`, i, , value =
## structure(list(Transcript_id = "ENST00000370031", : Coerced integer
## RHS to character to match the type of the target column (column 9 named
## 'plot_end'). If the target column's type character is correct, it's best
## for efficiency to avoid the coercion and create the RHS as type character.
## To achieve that consider R's type postfix: typeof(0L) vs typeof(0), and
## typeof(NA) vs typeof(NA_integer_) vs typeof(NA_real_). You can wrap the RHS
## with as.character() to avoid this warning, but that will still perform the
## coercion. If the target column's type is not correct, it's best to revisit
## where the DT was created and fix the column type there; e.g., by using
## colClasses= in fread(). Otherwise, you can change the column type now by
## plonking a new column (of the desired type) over the top of it; e.g. DT[,
## `plot_end`:=as.integer(`plot_end`)]. If the RHS of := has nrow(DT) elements
## then the assignment is called a column plonk and is the way to change a
## column's type. Column types can be observed with sapply(DT,typeof).

Figure out what's wrong and fix it.

stianlagstad commented 5 years ago

I think https://github.com/stianlagstad/chimeraviz/commit/603889b76d0c538fbcca771b9581db4b81f3378c should solve it. Will keep the issue open until Bioconductor has rebuilt the vignette and I can verify that the warnings are gone.

stianlagstad commented 5 years ago

Note to self: Since you did that in the master branch, remember to verify that the warning is gone in the development version's vignette, not the release version. Check it here: https://bioconductor.org/packages/devel/bioc/vignettes/chimeraviz/inst/doc/chimeraviz-vignette.html. When verified, do the same change for the release_3_8 branch.

stianlagstad commented 5 years ago

Looks like that solved it, since the warning is gone from the devel vignette. I'll go ahead and make the same change in the release_3_8 branch.

stianlagstad commented 5 years ago

That should do it!