Skip to content

Commit

Permalink
Update _convert_anndata.py
Browse files Browse the repository at this point in the history
initial dict was placed in the wrong position in the for-loop
  • Loading branch information
zktuong committed Feb 11, 2021
1 parent 2f20a34 commit 44d54dd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scirpy/io/_convert_anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,11 @@ def to_dandelion(adata):
except:
raise ImportError("Please install dandelion: pip install sc-dandelion.")
ircelllist = to_ir_objs(adata)
data = pd.DataFrame()

contig_dicts = {}
for ix in ircelllist:
contig_dict = {}

for ix in ircelllist:
for counter, c in enumerate(ix.chains, start=1):
contig_dict = {}
cell_id = ix.cell_id
sequence_id = cell_id + "_contig_" + str(counter)
contig_dict.update(
Expand All @@ -244,6 +243,6 @@ def to_dandelion(adata):
}
)
contig_dicts[sequence_id] = contig_dict

data = pd.DataFrame.from_dict(contig_dicts, orient="index")
return ddl.Dandelion(data)
return ddl.Dandelion(ddl.load_data(data))

0 comments on commit 44d54dd

Please sign in to comment.