This is a test version of Biostars. For the public version, visit https://www.biostars.org.
String is not accepting more than 2000 genes

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

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

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

0 answers

No answers yet.

Log in to answer this question.