ATMAX¶
The ATMAX command allows you to select a single row based on a maximum value of a defined column. Note that the column is treated as a number by default, to do a string comparison use the -s
option.
Using ATMAX in a nor query will give an error if binsize
input parameter is used.
Options¶
|
Returns the last value for multiple possible maximums. |
|
Grouping columns (other than bin). |
|
Assume the grouping columns are ordered. |
|
Treats the test column as a string and performs a string comparison. |
Use binsize = chrom
to aggregate for a whole chromosome and binsize = genome
to aggregate for the entire genome. Note, that the column must be a numeric column.
When using ATMAX in a NOR context, the ordered flag can both speed up the operation and reduce the memory usage significantly. Note that there are no checks to see if the order is correct - only use this option if the input stream is correctly ordered.
Examples¶
gor ... | atmax 1000 gene_start
Returns a row with the maximum gene_start value over 1000 base pairs.
gor ... | atmax chrom value_column -last -gc date
Returns a row with the maximum value_column value per chromosome. Group rows by the date column, each group is represented with a single row. If multiple maximums exist take the last one found.