weng-lab / SCREEN

MIT License
8 stars 2 forks source link

Curious about curling json outputs from SCREEN and feeding them back into the API. #139

Open JakeLehle opened 2 years ago

JakeLehle commented 2 years ago

Hello,

Super happy with the database that you have put together. This is an awesome resource for researchers. So from some experiments in my lab I have a list of DMRs from DNA methylation data and I wanna use SCREEN to search for all the cCRE in these regions as part of my analysis. I could go through and search each one using the browser GUI one-by-one but that's tedious and I'm a coder so I know there is a better way.

I wanna iterate through my DMRs and curl out the cCREs in each region as well are information like if the mark is proximal or distal and if other epigenetic modifications are above that ~1.6 cutoff and are enriched for that cCRE.

I look through the html requests in the dev tools of the browser and took a stab at putting together what a request would look like as a practice.

curl 'https://screen-beta-api.wenglab.org/dataws/cre_table' \
  -H 'authority: screen-beta-api.wenglab.org' \
  -H 'accept: application/json' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'content-type: application/json' \
  -H 'origin: https://screen.wenglab.org' \
  -H 'referer: https://screen.wenglab.org/' \
  -H 'sec-ch-ua: ".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"' \
  -H 'sec-ch-ua-mobile: ?1' \
  -H 'sec-ch-ua-platform: "Android"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-site' \
  -H 'user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36' \
  --data-raw '{"uuid":"bd69d494-cc03-45fb-b368-1e7a7c552a28","assembly":"mm10","accessions":[],"coord_chrom":"chr2","coord_start":71789739,"coord_end":71811868,"gene_all_start":0,"gene_all_end":5000000,"gene_pc_start":0,"gene_pc_end":5000000,"rank_dnase_start":1.64,"rank_dnase_end":10,"rank_promoter_start":-10,"rank_promoter_end":10,"rank_enhancer_start":-10,"rank_enhancer_end":10,"rank_ctcf_start":-10,"rank_ctcf_end":10,"cellType":null,"element_type":null}' \
  --compressed

I haven't had time to poke through the output in-depth. Is this going in the right direction for the output that I'm trying to get? Do you have any resources for people trying to scrape the SCREEN database and the best way to do that?

Also, after I pull out all of cCREs Accession numbers, I wanna start running them through your API.
https://api.wenglab.org/screen_graphql/graphql Could you send over any resources/manuals for using that API so I can read through them and get a better idea of how to write my scripts and what kind of outputs I can get if I convert my DMRS into a list of accession EM**s ?

Thanks!

Jill-Moore commented 2 years ago

[weng-lab/SCREEN] Curious about curling json outputs from SCREEN and feeding them back into the API. (Issue #139)

Jill-Moore commented 2 years ago

[weng-lab/SCREEN] Curious about curling json outputs from SCREEN and feeding them back into the API. (issue #139)