I have a list of microRNA family names among which some are named in the form of "miR-10-5p". However, some microRNA family names have forward slash in them, e.g., "miR-1-3p/206". I want to use the Web API of ENCORI or starBase databse to obtain the ceRNA data for the miRNA families.
I used the following curl command in shell for retrieving the data of a microRNA families without slashes in their names:
curl 'https://rnasysu.com/encori/api/ceRNA/?assembly=hg38&geneType=mRNA&ceRNA=all&miRNAnum=2&family=miR-10-5p&pval=0.01&fdr=0.01&pancancerNum=0' >ENCORI_hg38_ceRNA-network_all.txt
This command works properly.
However for the microRNA families with slashes in their names, the following equivalent command does not work.
curl 'https://rnasysu.com/encori/api/ceRNA/?assembly=hg38&geneType=mRNA&ceRNA=all&miRNAnum=2&family=miR-1-3p/206&pval=0.01&fdr=0.01&pancancerNum=0' >ENCORI_hg38_ceRNA-network_all.txt
I tried replacing '/' with '%2F' but it still does not work.
curl 'https://rnasysu.com/encori/api/ceRNA/?assembly=hg38&geneType=mRNA&ceRNA=all&miRNAnum=2&family=miR-1-3p%2F206&pval=0.01&fdr=0.01&pancancerNum=0' >ENCORI_hg38_ceRNA-network_all.txt
How should I mention the microRNA families with slashes in their names in the curl command?
Edit: While searching for the solution, I found the following question on the stack overflow.
cURL wrap url containing token having forward slashes
Is it the same problem as mine? But then, how is URL encoding helpful here?
%2F
is the correct way to pass a/
in the GET request data. That microRNA family doesn’t seem to exist on the server, or an other parameter is wrongfamily="miR-1-3p/206"