problem with get_link function
0
0
Entering edit mode
@cristinapasi-14734
Last seen 6.9 years ago

Hello,

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 string-db.org webpage opens.

I hope you can help me with this,

Best regards,

Cristina

STRINGdb get_link bug • 1.6k views
ADD COMMENT
0
Entering edit mode

Dear Cristina,

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

Best, Damian.

 

ADD REPLY
0
Entering edit mode

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:  http://version10.string-db.org/10/p/8078305016

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

Thanks for your help!!

Cristina

ADD REPLY
0
Entering edit mode

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: http://version10.string-db.org/10/p/8219305039 which is correct.

Best,

Damian.

 

ADD REPLY
0
Entering edit mode

You are right, thank you very much! 

ADD REPLY

Login before adding your answer.

Traffic: 517 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6