STRINGdb : error with string_db$plot_network()
Entering edit mode
ninidea • 0
Last seen 6 weeks ago

Hello experts,

I've recently run into an issue while attempting to visualize or plot a network using the STRINGdb package.

Forgive me if this is a silly question, I'm just learning :)

>archivo_tsv=read.delim("example.tsv" , header=TRUE, sep="\t")
>string_db <- STRINGdb$new(version="12", species=10090, score_threshold=400,network_type="full", input_directory="",protocol='http')
>mapped_data <- string_db$map(archivo_tsv, "ID", removeUnmappedRows=FALSE)
  Warning:  we couldn't map to STRING 11% of your identifiers

> head(mapped_data)
      ID                  X     logFC  AveExpr         t      P.Value    adj.P.Val        B
1   Gpx2 ENSMUSG00000042808 -2.175740 7.635130 -25.93892 1.500592e-16 1.965776e-12 28.01811
2   Bex1 ENSMUSG00000050071  2.072268 3.767211  19.11545 4.564407e-14 2.051526e-10 22.41397
3  Ndrg1 ENSMUSG00000005125 -2.111087 7.444225 -19.08563 4.698151e-14 2.051526e-10 22.41977
4    Id2 ENSMUSG00000020644 -1.617691 6.618765 -18.07857 1.277342e-13 4.183294e-10 21.42183
5 Fgfrl1 ENSMUSG00000008090 -2.275201 3.720606 -17.84377 1.624413e-13 4.255961e-10 20.93700
6 Iqgap2 ENSMUSG00000021676  1.308763 8.240324  17.28279 2.918316e-13 6.371656e-10 20.59974
1 10090.ENSMUSP00000081012
2 10090.ENSMUSP00000060005
3 10090.ENSMUSP00000005256
4 10090.ENSMUSP00000152052
5 10090.ENSMUSP00000013633
6 10090.ENSMUSP00000067685

> hits <- mapped_data$STRING_id[1:200]
> string_db$plot_network(hits)
Error en readPNG(postFormSmart(urlStr, .params = params, .ctype = "raw")): 
  libpng error: Not a PNG file

sessionInfo( )

R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22621)

Matrix products: default

[1] LC_COLLATE=Spanish_Spain.utf8  LC_CTYPE=Spanish_Spain.utf8   
[3] LC_MONETARY=Spanish_Spain.utf8 LC_NUMERIC=C                  
[5] LC_TIME=Spanish_Spain.utf8    

time zone: Europe/Madrid
tzcode source: internal

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

other attached packages:
[1] png_0.1-8       dplyr_1.1.4     STRINGdb_2.16.2 RCy3_2.24.0     igraph_2.0.3   

loaded via a namespace (and not attached):
 [1] generics_0.1.3      utf8_1.2.4          gplots_3.1.3.1      bitops_1.0-7       
 [5] KernSmooth_2.23-22  gtools_3.9.5        stringi_1.8.4       RSQLite_2.3.6      
 [9] digest_0.6.35       magrittr_2.0.3      caTools_1.18.2      evaluate_0.23      
[13] RColorBrewer_1.1-3  pbdZMQ_0.3-11       fastmap_1.1.1       blob_1.2.4         
[17] plyr_1.8.9          jsonlite_1.8.8      graph_1.82.0        backports_1.4.1    
[21] DBI_1.2.2           BiocManager_1.30.23 httr_1.4.7          fansi_1.0.6        
[25] XML_3.99-0.16.1     cli_3.6.2           rlang_1.1.3         crayon_1.5.2       
[29] bit64_4.0.5         base64enc_0.1-3     repr_1.1.7          cachem_1.0.8       
[33] gsubfn_0.7          plotrix_3.8-4       tools_4.4.0         proto_1.0.0        
[37] RJSONIO_1.3-1.9     uuid_1.2-0          memoise_2.0.1       base64url_1.4      
[41] BiocGenerics_0.50.0 curl_5.2.1          hash_2.2.6.3        IRdisplay_1.1      
[45] vctrs_0.6.5         R6_2.5.1            stats4_4.4.0        lifecycle_1.0.4    
[49] fs_1.6.4            bit_4.0.5           pkgconfig_2.0.3     pillar_1.9.0       
[53] glue_1.7.0          Rcpp_1.0.12         tidyselect_1.2.1    tibble_3.2.1       
[57] IRkernel_1.3.2      sqldf_0.4-11        htmltools_0.5.8.1   compiler_4.4.0     
[61] chron_2.3-61        RCurl_1.98-1.14
STRINGdb • 296 views
Entering edit mode

Your code seems ok.

Does the vignette produce the same error? link to STRINGdb R script vignette

Entering edit mode

Does the vignette produce the same error?


Anyway, I finally solved the problem. I don't know why, but I removed: protocol='http' from this:

string_db <- STRINGdb$new(version="12", species=10090, score_threshold=400,network_type="full", input_directory="",protocol='http')

and now there is no error

Thank you.

Entering edit mode

ok. Forcing non-secure protocol should not be needed anymore, due to changes in the underlying library. However, I will look at why "HTTP" produced the error you see.

Thanks for the feedback.


Login before adding your answer.

Traffic: 665 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6