Hi all,
I need some help with an analysis I am doing using the package STRINGdb.
In the vignette, the authors talk about the payload mechanism, which should allow you to label the nodes with a coloured halo, when you plot a network of interactions. I tried to replicate the example they provide, and it works fine. However, I cannot find a way of doing the same with my own data.
Please have a look below at the code I am using.
head(string_df)
gene STRING_id log2FoldChange padj
1 BCL7C 9606.ENSP00000215115 -0.1456586 9.285457e-01
2 BCL7C 9606.ENSP00000459007 -0.1456586 9.285457e-01
3 BCL7C 9606.ENSP00000461177 -0.1456586 9.285457e-01
4 BCL7C 9606.ENSP00000369674 -0.1456586 9.285457e-01
5 TSTD1 9606.ENSP00000388293 -1.0200344 3.510905e-02
6 SYK 9606.ENSP00000364904 -0.4645502 9.611069e-01
string_df <- string_db$map( string_df, "gene", removeUnmappedRows = TRUE )
Error in eval(e, x, parent.frame()) : object 'STRING_id' not found
string_df_padj05 <- string_db$add_diff_exp_color( subset(string_df,padj< 0.05 ), logFcColStr="log2FoldChange" )
payload_id2 <- string_db$post_payload( string_df_padj05$STRING_id,
colors=string_df_padj05$color )
string_db$plot_network( string_df_padj05$STRING_id, payload_id=payload_id2 )
All commands apparently work, with the exception of string_db$map (no idea what the error means)
string_db$map( string_df, "gene", removeUnmappedRows = TRUE )
Error in eval(e, x, parent.frame()) : object 'STRING_id' not found
The plot I get (unfortunately I cannot share it) does not show any halo. Also, the payload object for my analysis (payload_id_new) seems to be missing something compared to the one generated for the example in the vignette (payload_id_vignette):
payload_id_vignette
[1] "R_JXOFAPSLKYQWX308"
attr(,"Content-Type")
charset
"text/plain" "utf-8"
> payload_id_new
[1] ""
attr(,"Content-Type")
charset
"text/plain" "utf-8"
I am not familiar with this kind of analysis, and any help/suggestion would e really welcome!
Thank you in advance
Thanks a lot for your feedback! The STRING_id column was not added with the mapping function, I had generated those IDs myself using Ensembl annotation data. Apparently that was the issue, because after removing the column I could successfully run the mapping command without errors, and get the halo in the figure! There was however a small mistake in the code I shared above. Function string_db$plot_network should be given a list of STRING ids:
With this correction, the code can be applied to a data frame which does not have a manually generated column STRING_id and everything works fine.