xref_regions: If I were smart I would use an I/GRanges for this.

View source: R/variants.R

xref_regionsR Documentation

If I were smart I would use an I/GRanges for this.

Description

But I was asked to get the closest feature if it is not inside one. I am not sure how to do that with a ranges. Sadly, I think it will be easier for me to just iterate over the sequence_df and query each feature on that chromosome/scaffold.

Usage

xref_regions(
  sequence_df,
  gff,
  bin_width = 600,
  feature_type = "protein_coding_gene",
  feature_start = "start",
  feature_end = "end",
  feature_strand = "strand",
  feature_chr = "seqnames",
  feature_type_column = "type",
  feature_id = "ID",
  feature_name = "description",
  name_type = NULL,
  desc_column = "description"
)

Arguments

sequence_df

dataframe of sequence regions of interest.

gff

gff annotations against which to hunt.

bin_width

size of the regions of interest (e.g. the amplicon size)

feature_type

What feature type to hunt for?

feature_start

Column containing the starts.

feature_end

Column containing the ends.

feature_strand

Column containing strand information.

feature_chr

Column containing the chromosome names.

feature_type_column

Column containing the feature types.

feature_id

Column with the IDs (coming from the gff tags).

feature_name

Column with the descriptive name.

name_type

I dont remember, I think this allows one to limit the search to a feature type.

desc_column

Use this column to extract full-text gene descriptions.


elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.