Skip to content

Commit

Permalink
Added project accession assertion to the RNAcentral script
Browse files Browse the repository at this point in the history
  • Loading branch information
tgurbich committed Dec 7, 2023
1 parent 3a57072 commit f276acb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,10 @@ def get_project_accession(biosample):
study_index = col_names.index("secondary_study_accession")
for e in elements[1:]:
if not e == "":
projects.append(e.strip().split("\t")[study_index])
project_to_add = e.strip().split("\t")[study_index]
assert any(project_to_add.startswith(prefix) for prefix in
["SRP", "ERP", "DRP", "PR"]), "Incorrect project format: {}".format(project_to_add)
projects.append(project_to_add)
return set(projects)
else:
logging.error("Error when requesting study accession for biosample {}".format(biosample))
Expand Down

0 comments on commit f276acb

Please sign in to comment.