Skip to content

Commit

Permalink
fixing behavior of the -f option to not override the user choice, ref…
Browse files Browse the repository at this point in the history
…s #27347
  • Loading branch information
maximilianh committed May 28, 2021
1 parent ea785af commit 30a2b27
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cbPyLib/cellbrowser/seurat.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ def cbImportSeurat_parseArgs(showHelp=False):
parser.add_option("-n", "--name", dest="datasetName", action="store",
help="Dataset name for generated cellbrowser.conf. If not specified, the last component of -o will be used.")

parser.add_option("-f", "--inFormat", dest="inFormat", action="store",
help="the format of the input file. Either 'rds' or 'rdata'. Default %default. If input filename ends with .rdata or .robj, defaults to rdata.", default="rds")
parser.add_option("-f", "--inFormat", dest="inFormat", action="store",
help="the format of the input file. Either 'rds' or 'rdata'. If nothing is specified and the input filename ends with .rdata or .robj, the option defaults to rdata, otherwise rds is used.")

parser.add_option("", "--htmlDir", dest="htmlDir", action="store",
help="do not only convert to tab-sep files but also run cbBuild to"
Expand Down Expand Up @@ -505,9 +505,12 @@ def cbImportSeurat(inFname, outDir, datasetName, options):

cmds = readExportScript(cmds)

inExt = splitext(inFname.lower())[1]
if inExt in [".robj", ".rdata"]:
inFormat="rdata"
if inFormat is None:
inExt = splitext(inFname.lower())[1]
if inExt in [".robj", ".rdata"]:
inFormat="rdata"
else:
inFormat = "rds"

if inFormat=="rds":
cmds.append("message('Reading %s as .rds file')" % inFname)
Expand Down

0 comments on commit 30a2b27

Please sign in to comment.