for every interval flanking_features.py $input1 $input2 $out_file1 $direction #if isinstance( $input1.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__): -1 1,4,5,7 --gff1 #else: -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol} #end if #if isinstance( $input2.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__): -2 1,4,5,7 --gff2 #else: -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol} #end if .. class:: infomark **What it does** For every interval in the **interval** dataset, this tool fetches the **closest** upstream and / or downstream features from the **features** dataset. ----- .. class:: warningmark **Note:** Every line should contain at least 3 columns: chromosome number, start and stop coordinates. If any of these columns is missing or if start and stop coordinates are not numerical, the lines will be treated as invalid and skipped. The number of skipped lines is documented in the resulting history item as a "data issue". If the strand column is missing from your input interval dataset, the intervals will be considered to be on positive strand. You can add a strand column to your input dataset by using the *Text Manipulation->Add column* tool. For GFF files, features are added as a GTF-style attribute at the end of the line. ----- **Example** If the **intervals** are:: chr1 10 100 Query1.1 chr1 500 1000 Query1.2 chr1 1100 1250 Query1.3 and the **features** are:: chr1 120 180 Query2.1 chr1 140 200 Query2.2 chr1 580 1050 Query2.3 chr1 2000 2204 Query2.4 chr1 2500 3000 Query2.5 Running this tool for **Both Upstream and Downstream** will return:: chr1 10 100 Query1.1 chr1 120 180 Query2.1 chr1 500 1000 Query1.2 chr1 140 200 Query2.2 chr1 500 1000 Query1.2 chr1 2000 2204 Query2.4 chr1 1100 1250 Query1.3 chr1 580 1050 Query2.3 chr1 1100 1250 Query1.3 chr1 2000 2204 Query2.4