Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Fix #170
Browse files Browse the repository at this point in the history
  • Loading branch information
dweemx committed Mar 16, 2020
1 parent 5bfb615 commit a02ee0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/utils/bin/sc_file_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ def add_sample_id(adata, args):
adata = adata[:, np.sort(adata.var.index)]
adata.write_h5ad(filename="{}.h5ad".format(FILE_PATH_OUT_BASENAME))

elif INPUT_FORMAT == 'h5ad' and OUTPUT_FORMAT == 'h5ad':
adata = sc.read_h5ad(
FILE_PATH_IN
)
adata = add_sample_id(
adata=adata,
args=args
)
adata.write_h5ad(filename="{}.h5ad".format(FILE_PATH_OUT_BASENAME))
else:
raise Exception(
"File format conversion {0} --> {1} hasn't been implemented yet.".format(INPUT_FORMAT, OUTPUT_FORMAT))
Expand Down
6 changes: 1 addition & 5 deletions src/utils/processes/utils.nf
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ process SC__FILE_CONVERTER {
break;
}

if(inputDataType == "h5ad")
"""
cp ${f} "${sampleId}.SC__FILE_CONVERTER.h5ad"
"""
else if(inputDataType == "10x_atac_cellranger_mex" && outputDataType == "cistopic_rds")
if(inputDataType == "10x_atac_cellranger_mex" && outputDataType == "cistopic_rds")
"""
${binDir}create_cistopic_object.R \
--tenx_path ${f} \
Expand Down

0 comments on commit a02ee0a

Please sign in to comment.