nolanlab / spade

SPADE: Spanning Tree Progression of Density Normalized Events
Other
46 stars 23 forks source link

SPADE.driver -> SPADE.FCSToTree -> SPADE.cluster -> nrow issue #111

Open jk86754 opened 9 years ago

jk86754 commented 9 years ago

Hi,

Please see my error below:

~$ ./runSPADE.R -num_threads 6 Loading required package: igraph Loading required package: methods Loading required package: Rclusterpp Loading required package: Rcpp Loading required package: RcppEigen Downsampling file: T Cell 1_001.fcs Estimated downsampling-I progress: 0% ... Estimated downsampling-I progress: 69% ... Estimated downsampling-I progress: 55% ... Estimated downsampling-I progress: 41% ... Estimated downsampling-I progress: 28% ... Estimated downsampling-I progress: 96% ... Estimated downsampling-I progress: 14% ... Estimated downsampling-I progress: 83% ... Estimated downsampling-I progress: 100% ... Targeting 60258 events for output/T Cell 1_001.fcs.density.fcs Downsampling file: /home/jozsef/FCS/052814 AL_T Cell 1_001.fcs Estimated downsampling-I progress: 0% ... Estimated downsampling-I progress: 18% ... Estimated downsampling-I progress: 54% ... Estimated downsampling-I progress: 91% ... Estimated downsampling-I progress: 100% ... Targeting 48093 events for output/052814 AL_T Cell 1_001.fcs.density.fcs Downsampling file: /home/jozsef/FCS/101014 AL_T Cell 1_001.fcs Estimated downsampling-I progress: 0% ... Estimated downsampling-I progress: 52% ... Estimated downsampling-I progress: 39% ... Estimated downsampling-I progress: 90% ... Estimated downsampling-I progress: 13% ... Estimated downsampling-I progress: 65% ... Estimated downsampling-I progress: 100% ... Targeting 66736 events for output/101014 AL_T Cell 1_001.fcs.density.fcs Downsampling file: 052214 AL_T Cell 1_001.fcs Estimated downsampling-I progress: 0% ... Estimated downsampling-I progress: 52% ... Estimated downsampling-I progress: 21% ... Estimated downsampling-I progress: 72% ... Estimated downsampling-I progress: 41% ... Estimated downsampling-I progress: 93% ... Estimated downsampling-I progress: 10% ... Estimated downsampling-I progress: 62% ... Estimated downsampling-I progress: 31% ... Estimated downsampling-I progress: 100% ... Targeting 84349 events for output/052214 AL_T Cell 1_001.fcs.density.fcs Clustering files... Warning messages: 1: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. 2: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. 3: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. 4: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. 5: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. 6: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. 7: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. 8: In write.FCS(out_frame, outfilename) : 'write.FCS' is not fully tested and should be considered as experimental. Error in nrow(tbl) : error in evaluating the argument 'x' in selecting a method for function 'nrow': Error in apply(mat, 2, tform) : dim(X) must have a positive length Calls: SPADE.transform.matrix -> apply Calls: SPADE.driver -> SPADE.FCSToTree -> SPADE.cluster -> nrow Execution halted

Help would be appreciated.

zbjornson commented 9 years ago

Hello, Could you please provide your runSPADE.R file? Can you also please look at the FCS files that have been created after SPADE got that far and make sure none are 0 bytes? Thanks, Zach

jk86754 commented 9 years ago

Zach,

Thanks for the quick response.

Please find the runSPADE.R file below:

#!/usr/bin/env Rscript
# ^^set this to your Rscript path
#
# runSPADE:  R wrapper script for SPADE tree construction
# Erin Simonds - esimonds@stanford.edu
# Version 2.5 - June 29, 2012
# Autogenerated by CytoSPADE
#
# Command line instructions:
#   1) Make sure the first line of this file is your Rscript path (found in the same directory as R)
#
#   2) Move the entire directory containing this script and the FCS file(s) to be analyzed to the computer on which you will run SPADE
#
#   3) In a command shell, navigate to the folder containing this script and the FCS file(s) to be analyzed
#
#   4) Make this script executable.  At the command line, run:
#   $ chmod +x runSPADE.R
#
#   5a) For normal use (not in a load sharing or compute cluster): At the command line, run:
#   $ ./runSPADE.R [-num_threads=X] [-file_to_process=Y]
#   where X is the number of threads you wish to use (default = 1)
#   Y is the name of the file to process (default = use file(s) specified in this script)
#       Note that parameters in brackets may be omitted.
#
#   5b) For Sun Gridengine: At the command line, run:
#   $ qsub -cwd -j y -b y -m e -M username@domain.ext [-pe threaded A] ./runSPADE.R [-num_threads=X] [-file_to_process=Y]
#   where username@domain.ext is your e-mail address to e-mail when the job is done,
#   A is the number of slots to reserve with Gridengine,
#   X is the number of threads to use in SPADE (usually the same as A) (default = 1).
#   Y is the name of the file to process (default = use file(s) specified in this script)
#       Note that parameters in brackets may be omitted.
#
#   5c) For Platform LSF: At the command line, run:
#   $ bsub [-n A -R "span[hosts=1]"] ./runSPADE.R [-num_threads=X] [-file_to_process=Y]
#   A is the number of slots to reserve with LSF,
#   X is the number of threads to use in SPADE (usually the same as A) (default = 1).
#   Y is the name of the file to process (default = use file(s) specified in this script)
#       Note that parameters in brackets may be omitted. (Note that the brackets surrounding "hosts=1" do not indicate an optional parameter.)
#
# Interactive instructions:
#   1) Move the entire directory containing this script and the FCS file(s) to be analyzed to the computer on which you will run SPADE
#   2) In an interactive R session, change the working directory to the folder created in step 1
#   3) At the R command line, run: source("runSPADE.R")
#
#BEGIN AUTOGENERATED DATA
FILE_TO_PROCESS="/site/ne/home/karjo01/FCS"
CLUSTERING_MARKERS=c("PE-A")
PANELS=list(
list(
panel_files=c(),
median_cols=NULL,
reference_files=NULL,
fold_cols=NULL
),
list(
panel_files=c("sample1.fcs","sample2.fcs","sample3","sample4.fcs"),
median_cols=NULL,
reference_files=NULL,
fold_cols=NULL
))
TRANSFORMS=flowCore::arcsinhTransform(a=0, b=0.007)
DOWNSAMPLED_EVENTS=NULL
DOWNSAMPLING_TARGET_PCTILE=0.05
TARGET_CLUSTERS=200
CLUSTERING_SAMPLES=50000
DOWNSAMPLING_EXCLUDE_PCTILE=0.01
NODE_SIZE_SCALE_FACTOR=1.2
NORMALIZE="global"
OUTPUT_DIR="output/"
#END AUTOGENERATED DATA
LIBRARY_PATH=NULL
NUM_THREADS <- 8
for (e in commandArgs()) {
    ta <- strsplit(e,"=",fixed=TRUE)
    if( ta[[1]][1] == "-num_threads") {
        NUM_THREADS <- ta[[1]][2]
    }
    if( ta[[1]][1] == "-file_to_process") {
        FILE_TO_PROCESS <- ta[[1]][2]
    }
}
Sys.setenv("OMP_NUM_THREADS"=NUM_THREADS)
library("spade",lib.loc=LIBRARY_PATH)
LAYOUT_FUNCTION=layout.kamada.kawai
SPADE.driver(FILE_TO_PROCESS, file_pattern="*.fcs", out_dir=OUTPUT_DIR, 
             cluster_cols=CLUSTERING_MARKERS, panels=PANELS, transforms=TRANSFORMS, 
             layout=LAYOUT_FUNCTION, downsampling_target_pctile=DOWNSAMPLING_TARGET_PCTILE, 
             downsampling_exclude_pctile=DOWNSAMPLING_EXCLUDE_PCTILE, k=TARGET_CLUSTERS, clustering_samples=CLUSTERING_SAMPLES)
LAYOUT_TABLE <- read.table(paste(OUTPUT_DIR,"layout.table",sep=""))
MST_GRAPH <- read.graph(paste(OUTPUT_DIR,"mst.gml",sep=""),format="gml")
SPADE.plot.trees(MST_GRAPH,OUTPUT_DIR,file_pattern="*fcs*Rsave",layout=as.matrix(LAYOUT_TABLE),out_dir=paste(OUTPUT_DIR,"pdf",sep=""),size_scale_factor=NODE_SIZE_SCALE_FACTOR)
Sys.unsetenv("OMP_NUM_THREADS")

To answer your question about output files, none of them are 0 bytes.

Thank you for your help,

Joe

ghost commented 9 years ago

Erin,

I have try recently to run CytoSPADE, but I could not find the correct combination of CytoScape and CytoSpade. Could you tell me what is your current software setup, meaning the version (or download link) of both software (and eventually you operating system)?

Best, Samuel

zbjornson commented 9 years ago

Hi Joe, You have a blank panel:

panel_files=c(),
median_cols=NULL,
reference_files=NULL,
fold_cols=NULL
),

Try deleting that.

zbjornson commented 9 years ago

@bioinfoxtra please see https://github.com/nolanlab/spade/issues/91#issuecomment-38395244

jk86754 commented 9 years ago

Zach,

I deleted the empty panel as you suggested. I still get the same error message. The output files seem to be written fine just like last time.

Thanks,

Joe

zbjornson commented 9 years ago

Hi Joe, Hmm. Which output files are you getting? It looks like you will have .density.fcs files, but not .cluster.fcs files. Thanks!

jk86754 commented 9 years ago

That is correct. I get 'density.fcs' and 'downsample.fcs' files.