Question: problem with get_link function
gravatar for cristinapasi
22 months ago by
cristinapasi0 wrote:


I have tried to use the get_link function for an application I am developing in Shiny, however the link redirects to a page where of the list of proteins that I have passed as STRING_id, it only recognises the first one as the following ones are all preceded by "0D".  I believe it must be some issue on how the link is created and how the list of STRING_ids are then separated when the webpage opens.

I hope you can help me with this,

Best regards,


bug stringdb get_link • 414 views
ADD COMMENTlink written 22 months ago by cristinapasi0

Dear Cristina,

can you paste the call you are making? (including the input)

Best, Damian.


ADD REPLYlink written 22 months ago by damian.szk20

Hi Damian!

Thanks for your reply!  If I use the internal example to the STRINGdb package everything works however this is the dataset of differentially expressed proteins I have:

> tomap

  p-value   LogFC protein

1  0.0000  3.3334 YBR117C

2  0.0003 -0.5578 YBR249C

3  0.0026  0.5085 YCL040W

4  0.0043 -0.4235 YGL148W

5  0.0000  2.0330 YGR043C

6  0.0000  1.1019 YGR248W

7  0.0000  0.9537 YMR105C

8  0.0000  2.4107 YMR169C

And this is the code I am using:

> string_db <- STRINGdb$new( version="10", species=4932, score_threshold=0, input_directory="" )

> example1_mapped <- string_db$map(tomap, "protein", removeUnmappedRows = TRUE )
> hits <- example1_mapped$STRING_id[1:10]

> link1 <- string_db$get_link(hits)

And this is the link I get:

It should stay valid for a while so you can see what I mean.

Thanks for your help!!


ADD REPLYlink written 22 months ago by cristinapasi0

Hi Cristina,

The attached simple example of parsing a list of names to the get_link function seems to work. From the example you have provided it seems that you are slicing the example1_mapped vector with indices ([1:10]) which are larger than the vector length (8). This results in "NA" being appended to the vector (hence the error in the link you have attached).

> a <- c("YBR117C", "YBR249C")
> m <- data.frame(a)
> d <- string_db$map(m,  "a", removeUnmappedRows = TRUE )
>  h <- d$STRING_id[1:2]
> h
[1] "4932.YBR117C" "4932.YBR249C"
>  string_db$get_link(h)

I get: which is correct.




ADD REPLYlink written 22 months ago by damian.szk20

You are right, thank you very much! 

ADD REPLYlink written 22 months ago by cristinapasi0
Please log in to add an answer.


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