Operation

Divide

Applies to:  Numeric Dataset, Numeric Map, Numeric Variable and Region Dataset
Returns: Numeric Dataset, Numeric Map, Numeric Variable or Region Dataset   (The type of the returned object will depend on the source object)

Description

The "divide" operation is a division operator which will divide the value (or values) of a numeric data object by a specified amount. For Numeric Datasets the operation will be applied to all positions in the sequences, and for Numeric Maps it will be applied to all entries in the map (including the "default" value). The operation can also be applied to Region Datasets to divide the value of numeric properties of regions or to remove strings from a "text" property. By default the operation will be applied to the "score" property of the regions unless a different property is specified. Note that if the "amount" argument (divisor) has a value of 0 for an entry, the division will not be carried out but the original value will be retained for that entry.

Arguments

NameDescription
property Specifies which property of the data object to divide. For Numeric Datasets, Numeric Maps and Numeric Variables this will simply be the "value", but for Region Datasets you can select which property of the regions to divide or append to (the default is "score"). Note that user-defined region properties will not be shown in the drop-down list in the operation dialog, but it is still possible to type in the name other properties.
amount Specifies the amount by which the values in the source object should be divided. If the amount is a literal number or a Numeric Variable, each potential value in the source object will be divided by the same amount. If the source object is a Numeric Dataset and the "amount" is also a Numeric Dataset, the value of each position in the source will be divided by the value in the same position in the "amount" dataset. If the source is a Numeric Dataset and the "amount" is a Sequence Numeric Map, the values of all positions in each sequence are divided by the value for that sequence in the map (so each sequence is potentially divided by a different value). If both the source and "amount" are Numeric Maps of the same type, the entries in the source map will be divided by the corresponding values in the "amount" map. If the source is a Region Dataset and the "amount" is a Numeric Dataset, the region property can be divided by a value derived from the values in the Numeric Dataset which are covered by the region. This value could be e.g. the minimum, maximum, average, median or sum of all values within the region or it could be the value of a single position at the center, start or end of the region ("start" and "end" refers to the lowest and highest genomic coordinates of the region with respect to the direct strand. The "relativeStart" and "relativeEnd" positions refer to the most upstream and most downstream position in the region when viewed relative to the orientation of the sequence, and the "regionStart" and "regionEnd" values refer to the most upstream and most downstream positions relative to the orientation of the region itself). If the region is a "motif" region, it is also possible to use "weighted average" or "weighted sum" where the values in each position are weighted by the information content of the motif in the corresponding position. If the operation is applied to a "text" property of a Region Dataset, the "amount" should either be a literal string enclosed in parentheses or a Text Variable. The given text entries will be removed from the existing text property if present.

Conditions: position condition or region condition

Examples


# Divides the value of data object X by 10. If X is a Numeric Dataset/Numeric Map/Region Dataset, all positions/entries/regions in the data object will be divided by 10.
divide X by 10

# Returns a new track containing the quotient of the two tracks in each position
newNumericTrack = divide Track1 by Track2

# Divides the values for the entries in the first map by the corresponding entries in the second map
divide Map1 by Map2

# Divides the current 'score' property of each region in the track with the average value of the NumericTrack within the region
divide RegionTrack[score] by average NumericTrack

# Removes the three strings 'one', 'two' and 'three' from the text-property 'numbers' of every region in the Region Dataset.
divide RegionTrack[numbers] by "one,three"


See Also: increase, decrease, multiply, set