Skip to content

Commit

Permalink
fix(multithreading): Error if there are no transcripts
Browse files Browse the repository at this point in the history
As previously discussed, we elect to fail fast and hard if there are no
transcripts. More graceful solutions to follow.

Closes: #1
  • Loading branch information
rbpatt2019 committed Jun 15, 2021
1 parent 42d61f8 commit 6fa6cd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/multithreading/biomart.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ def concurrent_biomart(file: str, output: str) -> None:
output : str
Where to write the results to
Raises
------
IndexError
If there are no transcipts to process in ``file``
"""
logger.info(f"Processing file {file}")
df = pd.read_csv(file, index_col=None)
transcripts = df.loc[:, "transcriptId"].unique().tolist()
if len(transcripts := df.loc[:, "transcriptId"].unique().tolist()) == 0:
logging.error(f'There are no transcripts for {file}. Raising index error')
raise IndexError
s = BMSession(transcripts, output)
s.biomart_request()

Expand Down

0 comments on commit 6fa6cd2

Please sign in to comment.