String is not accepting more than 2000 genes
0
0
Entering edit mode
19 months ago
anasjamshed ▴ 120

I am using string API in python to find confidence scores and make a network of genes but it does not accept 2500 genes and shows this error:

Error   ErrorMessage
input too large STRING website does not support networks larger than 2000 nodes. In order to visualize large STRING networks please use our
Cytoscape stringApp. 
The stringApp, among other features, gives you access to more network customization options, lets you augment the network with your data and performs the functional enrichment analysis.

Cytoscape stringApp link: https://apps.cytoscape.org/apps/stringapp

My code:

### The required libraries and packages ###
import requests
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm

string_api_url = "https://version-11-5.string-db.org/api"
output_format = "tsv-no-header"
method = "network"

## Construct URL
##

request_url = "/".join([string_api_url, output_format, method])


list1= open("genes.txt").read()
my_genes = list1.rstrip().split("\n")


params = {

    "identifiers" : "%0d".join(my_genes), # your protein
    "species" : 9606, # species NCBI identifier 
    "caller_identity" : "www.awesome_app.org" # your app name

}

response = requests.post(request_url, data=params)
a= open("interactions.txt","w")
for line in response.text.strip().split("\n"):
    print(line)

How can I analyze more than 2000 genes? Do we have another API?

Please help me

python API • 713 views
ADD COMMENT
0
Entering edit mode

what about this stringapp they mention in their 'error' ?

ADD REPLY
0
Entering edit mode

we have string app that we can use in Cytoscape but I want to it through python script

ADD REPLY

Login before adding your answer.

Traffic: 1798 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