Skip to content

Commit

Permalink
bypass attr
Browse files Browse the repository at this point in the history
  • Loading branch information
jkobject committed Jul 17, 2024
1 parent 36c7b37 commit 5aaeb26
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scdataloader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ def getBiomartTable(
res.columns = attr + attributes
if type(res) is not type(pd.DataFrame()):
raise ValueError("should be a dataframe")
res = res[~(res["ensembl_gene_id"].isna() & res["hgnc_symbol"].isna())]
res.loc[res[res.hgnc_symbol.isna()].index, "hgnc_symbol"] = res[
res.hgnc_symbol.isna()
]["ensembl_gene_id"]

res = res[~(res["ensembl_gene_id"].isna())]
if "hgnc_symbol" in res.columns:
res = res[res["hgnc_symbol"].isna()]
res.loc[res[res.hgnc_symbol.isna()].index, "hgnc_symbol"] = res[
res.hgnc_symbol.isna()
]["ensembl_gene_id"]
return res


Expand Down

0 comments on commit 5aaeb26

Please sign in to comment.