Having problem in getting rsIDs in a given gene interval using NCBI etuils!
1
0
Entering edit mode
4.9 years ago
burcakotlu ▴ 40

Dear all,

For my tool, I was calling ncbi eutils for getting rsIDs in a given gene interval.

Here is my example post: http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=snp&term=20000000%3A20000500%5BBase+Position%5D+AND+1%5BCHR%5D+AND+txid9606&usehistory=y

Here is the corresponding response:

HttpResponseProxy{HTTP/1.1 403 Forbidden [Date: Fri, 18 Nov 2016 07:14:39 GMT, Server: Apache, Referrer-Policy: origin-when-cross-origin, Accept-Ranges: bytes, Vary: Accept-Encoding, X-UA-Compatible: IE=Edge, X-XSS-Protection: 1; mode=block, Keep-Alive: timeout=1, max=10, Connection: Keep-Alive, Content-Type: text/html] org.apache.http.client.entity.GzipDecompressingEntity@4b00e89d}

I was parsing the resulting response with the code below; however this code doesn't work anymore. What has changed in ncbi eutils? Any idea?

if(response.getEntity() != null){
                InputStream is = entity.getContent();
                readerSearch = xmlInputFactory.createXMLEventReader( is);
}

while(readerSearch.hasNext()){
    XMLEvent evtSearch = readerSearch.peek();
if( !evtSearch.isStartElement()){
    readerSearch.nextEvent();
    continue;
}

StartElement startSearch = evtSearch.asStartElement();
String localNameSearch = startSearch.getName().getLocalPart();

if( !localNameSearch.equals("eSearchResult")){
    readerSearch.nextEvent();
    continue;
}

ESearchResult eSearchResult = unmarshaller.unmarshal(readerSearch, ESearchResult.class).getValue();
IdList idList =(IdList)eSearchResult.getCountOrRetMaxOrRetStartOrQueryKeyOrWebEnvOrIdListOrTranslationSetOrTranslationStackOrQueryTranslationOrERROR().get(5);

for(Id id : idList.getId()){
    rsIdList.add(Integer.parseInt( id.getvalue()));
}

}

I will really appreciate any help. Thanks in advance, Burçak Otlu

ncbi eutils getting rsIDs in a • 1.1k views
ADD COMMENT
0
Entering edit mode

Dear Pierre,

Thank you for your answer. Now response is "OK" instead of "FORBIDDED".

I'm trying to get the assembly of a certain rs but although it shows itselft as <assembly dbsnpbuild="147" genomebuild="38.2" grouplabel="GRCh38.p2" current="true" reference="true"> on the webpage, it is null when it called from java code.

Here is my post: https://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=snp&id=776587116&retmode=xml

Here is the related code:

.... for( Assembly as : rs.getAssembly()){ String groupLabel = as.getGroupLabel(); .....

Why could it be?

Thanks in advance, Burçak Otlu

ADD REPLY
0
Entering edit mode

Upvote! 0 gravatar for burcakotlu 3 minutes ago by burcakotlu • 30 Turkey Dear Pierre,

Thank you for your answer. Now response is "OK" instead of "FORBIDDED".

I'm trying to get the assembly of a certain rs but although it shows itselft as <assembly dbsnpbuild="147" genomebuild="38.2" grouplabel="GRCh38.p2" current="true" reference="true"> on the webpage, it is null when it called from java code.

Here is my post: https://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=snp&id=776587116&retmode=xml

Here is the related code:

 .... 
for( Assembly as : rs.getAssembly())
{ String groupLabel = as.getGroupLabel();
 .....

Why could it be?

Thanks in advance, Burçak Otlu

ADD REPLY
0
Entering edit mode

this is not an answer but a comment, please use "ADD COMMENT" not "SUBMIT ANSWER".

ADD REPLY
0
Entering edit mode

Now response is "OK" instead of "FORBIDDED".

so you can now validate my answer, and please, don't ask a 2nd question here.

ADD REPLY
0
Entering edit mode

Dear Pierre, How can I delete my last two posts? So that I can ask a separete question. Burçak

ADD REPLY
1
Entering edit mode
4.9 years ago
  • Use the https:// protocol instead of http://.
  • Check you're not working behing a http(s) proxy
ADD COMMENT

Login before adding your answer.

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