mcxarray(1)
mcxarray(1) π
okay so bestie, this is a USER COMMANDS page from the mcl family, and it's literally the glow-up station where your boring array data becomes an MCL matrix. mcxarray said "let me make that data cute and comparable" and honestly? she ate. π
β¨ NAME β¨
mcxarray β transform array data to MCL matrices π¦
β¨ SYNOPSIS β¨
mcxarray [options]
mcxarray [-data fname (input data file)]
[-imx fname (input matrix file)]
[-co num ((absolute) cutoff for output values (required))]
[-skipr <num> (skip <num> data rows)]
[-skipc <num> (skip <num> data columns)]
[-o fname (output file fname)]
[--text-table (write output in full text table format)]
[-write-tab <fname> (write row labels to file)]
[-l <num> (take labels from column <num>)]
[--pearson (use Pearson correlation (default))]
[--spearman (use Spearman rank correlation)]
[--dot (use dot product)]
[--cosine (use cosine (similarity))]
[--slow-cosine (use cosine(0.5 alpha) (similarity))]
[--angle (use angle between vectors (note: a metric distance))]
[--acute-angle (use acute angle between vectors)]
[--angle-norm (use normalised angle between vectors (by pi))]
[--acute-angle-norm (use normalised acute angle between
vectors (by pi/2))]
[--sine (use sine (note: a metric distance))]
[--slow-sine (use sine(0.5 alpha) (note: a metric distance))]
[--euclid (use Euclidean distance between vectors)]
[--max (use L-oo, aka Chebyshev distance)]
[--taxi (use L-1, aka taxi, aka city-block distance)]
[-minkowski <num> (use Minkowski distance with power <num>)]
[-fp <mode> (use fingerprint measure)]
[-digits <num> (output precision)]
[--write-binary (write output in binary format)]
[-t <int> (use <int> threads)]
[-J <intJ> (a total of <intJ> jobs are used)]
[-j <intj> (this job has index <intj>)]
[-start <int> (start at column <int> inclusive)]
[-end <int> (end at column <int> EXclusive)]
[--transpose-data (work with the transposed data matrix)]
[--rank-transform (rank transform the data first)]
[-tf spec (transform result network)]
[-table-tf spec (transform input table before processing)]
[-n mode (normalize input)]
[--zero-as-na (treat zeroes as missing data)]
[--sparse (do not store zero values)]
[-write-data <fname> (write data to file)]
[-write-na <fname> (write NA matrix to file)]
[--job-info (print index ranges for this job)]
[--help (print this help)]
[-h (print this help)]
[--version (print version information)]
β¨ DESCRIPTION β¨
so mcxarray can go two ways, bestie. it can read a flat file full of array data with -data, or it can read a matrix file that satisfies the mcl input format with -imx. π
in the flat-file case, she'll work with the rows as the data vectors by default. in the matrix-file case, she'll work with the columns as the data vectors by default β and yeah, that's on purpose, because mcl matrices are presented as a listing of columns (iykyk). π«Ά
both of those defaults can be flipped with --transpose-data. main character energy.
the input data is allowed to have missing data, in the form of empty columns, NA values (not available/applicable), or NaN values (not a number). the program keeps track of all of these, and when it computes the correlation between two rows or columns it ignores every position where either one of the two has missing data. no cap, she's careful like that. π
β¨ OPTIONS β¨
π input & output basics
-datafname β (input data file) point her at the data file holding the expression values. it should be tab-separated. π-imxfname β (input matrix file) the expression values get read from a file in mcl matrix format.-ofname β (output file fname) the output file name. that's it, that's the whole vibe. π--text-tableβ (write output in full text table format) the output gets written in tabular format instead of native mcl-edge format.-digitsnum β (output precision) specify the precision to use in native interchange format.--write-binaryβ (write output in binary format) write output matrices in native binary format.-conum β ((absolute) cutoff for output values) output values of magnitude smaller than num are removed (set to zero). so heads up: negative values are removed only if their positive counterpart is smaller than num. π«Ά
π« similarity & correlation measures
--pearsonβ (use Pearson correlation (default)) the default, bestie β¨--spearmanβ (use Spearman rank correlation)--cosineβ (use cosine)--slow-cosineβ (use cosine(0.5 alpha) (similarity))--dotβ (use the dot product)
okay so all of these express the level of similarity or correlation between two vectors. but listen: the dot product is not normalised, and you should only use it with a very good reason. π¨ a few more similarity measures are provided by the fingerprint option -fp, described right below.
π§ the fingerprint zone (-fp)
-fpmode β (specify fingerprint measure)
fingerprints are how you define an entity in terms of it having or not having certain traits. which means a fingerprint can be represented by a boolean vector, and a set of fingerprints can be represented by an array of such vectors. and when you have a lot of traits and a lot of entities, the dimensions of that matrix can get big. π
the sparse storage employed by MCL-edge is ideally suited to this, and mcxarray is ideally suited to computing all pairwise comparisons between such fingerprints. currently mcxarray supports five different types of fingerprint, described below.
given two fingerprints: the number of traits unique to the first is denoted by a, the number unique to the second is denoted by b, and the number they have in common is denoted by c. πΈ
- hamming β the Hamming distance, defined as
a+b. - tanimoto β the Tanimoto similarity measure,
c/(a+b+c). - cosine β the cosine similarity measure,
c/sqrt((a+c)*(b+c)). - meet β simply the number of shared traits, identical to
c. - cover β a normalised and non-symmetric similarity measure, representing the fraction of traits shared relative to the number of traits by a single entity. this gives the value
c/(a+c)in one direction, and the valuec/(b+c)in the other. π
π¦ distance measures
--sineβ (use sine (note: a metric distance))--slow-sineβ (use sine(0.5 alpha) (note: a metric distance))--angleβ (use angle between vectors (note: a metric distance))--acute-angleβ (use acute angle between vectors)--angle-normβ (use normalised angle between vectors (by pi))--acute-angle-normβ (use normalised acute angle between vectors (by pi/2))--euclidβ (use Euclidean distance between vectors)--maxβ (use L-oo, aka Chebyshev distance)--taxiβ (use L-1, aka taxi, aka city-block, aka Manhattan distance)-minkowskinum β (use Minkowski distance with power num)
all of these express the level of dissimilarity or distance between two vectors. opposite energy from the similarity gang above. π
π skipping & labels
-skiprnum β (skip num data rows) skip the first num data rows.-skipcnum β (skip num data columns) ignore the first num data columns.-lnum β (take labels from column num) specifies to construct a tab of labels from this data column. the tab can be written to file using-write-tabfname.-write-tabfname β (write row labels to file) write a tab file. in the simple case where the labels are in the first data column it is sufficient to issue-skipc 1. if more data columns need to be skipped, you must explicitly specify the data column to take labels from with-l l. π
β‘ threads, jobs & splitting the work
-tint β (use int threads)-JintJ β (a total of intJ jobs are used)-jintj β (this job has index intj)
computing all pairwise correlations is time-intensive for large input, bestie. if you have multiple CPUs available, consider using as many threads. additionally it's possible to spread the computation over multiple jobs/machines. these three options are described in the clmprotocols manual page.
the following set of options, if given to as many commands, defines three jobs, each running four threads. π₯
-t 4 -J 3 -j 0 -o out.0
-t 4 -J 3 -j 1 -o out.1
-t 4 -J 3 -j 2 -o out.2
the output can then be collected with
mcx collect --add-matrix -o out.all out.[0-2]
π job info & manual ranges
--job-infoβ (print index ranges for this job)-startint β (start at column int inclusive)-endint β (end at column int EXclusive)
--job-info can be used to list the set of column ranges to be processed by the job as a result of the command line options -t, -J, and -j. if a job has failed, this option can be used to manually split those ranges into finer chunks, each to be processed as a new sub-job specified with -start and -end. with the latter two options, it is impossible to use parallelization of any kind (i.e. any of the -t, -J, and -j options). π
πΈ data wrangling & transforms
--transpose-dataβ (work with the transpose) work with the transpose of the input data matrix.--rank-transformβ (rank transform the data first) the data is rank-transformed prior to the computation of pairwise measures.-write-datafname β (write data to file) this writes the data that was read in to file. if--spearmanis specified, the data will be rank-transformed. β¨-write-nafname β (write NA matrix to file) this writes all positions for which no data was found to file, in native mcl matrix format.-nmode β (normalization mode) if mode is set toz, the data will be normalized based on z-score. no other modes are currently supported. π«Ά-tfspec β (transform result network)-table-tfspec β (transform input table before processing)
the transformation syntax is described in mcxio(5).
π missing data, sparsity & the rest
--zero-as-naβ (treat zeroes as missing data)
this option can be useful when reading data with the -imx option, for example after it has been loaded from label input by mcxload. an example case is the processing of a large number of probe rankings, where not all rankings contain all probe names. the rankings can be loaded using mcxload with a tab file containing all probe names. probes that are present in the ranking are given a positive ordinal number reflecting the ranking, and probes that are absent are implicitly given the value zero. with the present option mcxarray will handle the correlation computation in a reasonable way. π§
--sparseβ (do not store zero data value) with this option, internal calculations are performed on compressed data where zeroes are not stored. this can be useful when the input data is very large.
π help & version
--helpβ (print help)-hβ (print help)--versionβ (print version information)
β¨ AUTHOR β¨
Stijn van Dongen. π
β¨ SEE ALSO β¨
mcl(1), mclfaq(7), and mclfamily(7) for an overview of all the documentation and the utilities in the mcl family. π
and that's the whole page, bestie π this was mcxarray 22-282, dated 9 Oct 2022 β go forth and matrix-ify your arrays, you absolute icon πβ¨π¦
π¦ where this page comes from
- debian bookworm: mcl 1:22-282+ds-2 Β· GPL-3.0-or-later
- debian trixie: mcl 1:22-282+ds-4 Β· GPL-3.0-or-later
- ubuntu noble: mcl 1:22-282+ds-2 Β· GPL-3.0-or-later
- ubuntu questing: mcl 1:22-282+ds-4
- ubuntu resolute: mcl 1:22-282+ds-4build1 Β· GPL-3.0-or-later
- ubuntu stonking: mcl 1:22-282+ds-4build1 Β· GPL-3.0-or-later
- Copyright (c) 2022 Stijn van Dongen
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms