Skip to content

Commit

Permalink
Fix Error 500 NCBI maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumitti committed Sep 3, 2024
1 parent 2dece0a commit e87de35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tfinder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ def get_dna_sequence(prom_term, upstream, downstream, chraccver, chrstart, chrst

# Request for DNA sequence
url = f"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id={chraccver}&from={start}&to={end}&rettype=fasta&retmode=text"
print(url)
response = requests.get(url)

if response.status_code == 200:
Expand All @@ -418,6 +419,9 @@ def get_dna_sequence(prom_term, upstream, downstream, chraccver, chrstart, chrst
sequence = NCBIdna.reverse_complement(dna_sequence)

return sequence
else:
print(f"NCBI is under maintenance. Error {response.status_code}: {str(response.text)}")
return f"NCBI is under maintenance. Error {response.status_code}: {str(response.text)}"

@staticmethod
def reverse_complement(dna_sequence):
Expand Down

0 comments on commit e87de35

Please sign in to comment.