Skip to content

Commit

Permalink
Merge pull request #38 from kids-first/printurl
Browse files Browse the repository at this point in the history
🔊 Print the dbgap manifest URL
  • Loading branch information
fiendish authored Sep 17, 2021
2 parents 6e8942b + 8fc2254 commit b4699b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kf_utils/dbgap/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ def get_latest_sample_status(phs_id, required_status="released"):
version = None
while True:
phs_string = f"{phs_id}.v{version}" if version is not None else phs_id
print(f"Querying dbGaP for study {phs_string}")
url = (
"https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/"
f"GetSampleStatus.cgi?study_id={phs_string}&rettype=xml"
)

print(f"Querying dbGaP for study {phs_string}")
print(f"Manifest URL -> {url}")

data = Session(status_forcelist=(502, 503, 504)).get(url)
if data.status_code != 200:
tried[phs_string] = f"status {data.status_code}"
Expand Down

0 comments on commit b4699b4

Please sign in to comment.