too-many-cells 0.1.12.1 → 0.1.12.2
raw patch · 3 files changed
+26/−4 lines, 3 filesdep ~hierarchical-spectral-clustering
Dependency ranges changed: hierarchical-spectral-clustering
Files
- app/Main.hs +3/−1
- src/TooManyCells/Matrix/Utility.hs +20/−0
- too-many-cells.cabal +3/−3
app/Main.hs view
@@ -101,7 +101,7 @@ , minModularity :: Maybe Double <?> "([Nothing] | DOUBLE) Nearly the same as --min-distance, but for clustering instead of drawing (so the output json tree can be larger). Stopping criteria to stop at the node with DOUBLE modularity. So a node N with L and R children will stop with this criteria the distance at N to L and R is < DOUBLE. Does not include L and R in the final result." , minDistance :: Maybe Double <?> "([Nothing] | DOUBLE) Stopping criteria to stop at the node immediate after a node with DOUBLE distance. So a node N with L and R children will stop with this criteria the distance at N to L and R is < DOUBLE. Includes L and R in the final result." , minDistanceSearch :: Maybe Double <?> "([Nothing] | DOUBLE) Similar to --min-distance, but searches from the leaves to the root -- if a path from a subtree contains a distance of at least DOUBLE, keep that path, otherwise prune it. This argument assists in finding distant nodes."- , smartCutoff :: Maybe Double <?> "([Nothing] | DOUBLE) Whether to set the cutoffs for --min-size, --max-proportion, --min-distance, and --min-distance-search based off of the distributions (median + (DOUBLE * MAD)) of all nodes. To use smart cutoffs, use this argument and then set one of the three arguments to an arbitrary number, whichever cutoff type you want to use. --min-size distribution is log2 transformed."+ , smartCutoff :: Maybe Double <?> "([Nothing] | DOUBLE) Whether to set the cutoffs for --min-size, --max-proportion, --min-distance, and --min-distance-search based off of the distributions (median + (DOUBLE * MAD)) of all nodes. To use smart cutoffs, use this argument and then set one of the four arguments to an arbitrary number, whichever cutoff type you want to use. --min-proportion distribution is log2 transformed." , customCut :: [Int] <?> "([Nothing] | NODE) List of nodes to prune (make these nodes leaves). Invoked by --custom-cut 34 --custom-cut 65 etc." , dendrogramOutput :: Maybe String <?> "([dendrogram.svg] | FILE) The filename for the dendrogram. Supported formats are PNG, PS, PDF, and SVG." , matrixOutput :: Maybe String <?> "([Nothing] | FOLDER | FILE.csv) Output the filtered and normalized (not including TfIdfNorm) matrix in this folder under the --output directory in matrix market format or, if a csv file is specified, a dense csv format. Like input, features are rows. See --matrix-output-transpose."@@ -347,6 +347,8 @@ -- Check for empty matrix. when (V.null . getRowNames $ processedSc) $ error "Matrix is empty. Check --filter-thresholds, --normalization, or the input matrix for over filtering or incorrect input format."++ liftIO . mapM_ print . matrixValidity $ processedSc return processedSc
src/TooManyCells/Matrix/Utility.hs view
@@ -22,6 +22,7 @@ , writeMatrixLike , isCsvFile , getMatrixOutputType+ , matrixValidity ) where -- Remote@@ -234,3 +235,22 @@ -- | Get matrix output format from input name. getMatrixOutputType :: FilePath -> MatrixFileFolder getMatrixOutputType x = bool (MatrixFolder x) (MatrixFile x) . isCsvFile $ x++-- | Check validity of matrix.+matrixValidity :: (MatrixLike a) => a -> Maybe String+matrixValidity mat+ | rows /= numCells || cols /= numFeatures =+ Just $ "Warning: mismatch in number of (features, cells) ("+ <> show numFeatures+ <> ","+ <> show numCells+ <> ") with matrix (rows, columns) ("+ <> show cols+ <> ","+ <> show rows+ <> "), will probably result in error."+ | otherwise = Nothing+ where+ (rows, cols) = S.dimSM . getMatrix $ mat+ numCells = V.length . getRowNames $ mat+ numFeatures = V.length . getColNames $ mat
too-many-cells.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: too-many-cells-version: 0.1.12.1+version: 0.1.12.2 license: GPL-3 license-file: LICENSE copyright: 2019 Gregory W. Schwartz@@ -65,7 +65,7 @@ foldl >=1.4.2, graphviz >=2999.20.0.2, hierarchical-clustering >=0.4.6,- hierarchical-spectral-clustering >=0.4.0.2,+ hierarchical-spectral-clustering >=0.4.1.1, hmatrix >=0.19.0.0, inline-r >=0.9.2, lens >=4.16.1,@@ -114,7 +114,7 @@ filepath >=1.4.2, find-clumpiness >=0.2.3.1, graphviz >=2999.20.0.2,- hierarchical-spectral-clustering >=0.4.0.2,+ hierarchical-spectral-clustering >=0.4.1.1, inline-r >=0.9.2, lens >=4.16.1, matrix-market-attoparsec >=0.1.0.8,