This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there a way to create a gene neighborhood from a set of coordinates and a gff file

I have a set of coordinates for a theoretical gene and I want to make a gene neighborhood for it with a gff file for the organism is this possible without using bedtools?

my coordinate sets look as follows

sample:start:stop:strand
NZOQ01000006.1_108  : 113072:14901:1
genome sequence alignment assembly gene

is this possible without using bedtools

Can I ask why you are specifying that exception? bedtools slop generally will do this.

I was under the impression you need the input coordinates to be in bed format to use bedtools and mine are just the coordinates in a text file I have output from a hmm run. is this incorrect?

You could convert those easily to BED format.

$ more test
sample:start:stop:strand
NZOQ01000006.1_108:113072:14901:1
NZOQ01000006.1_108:113172:14961:1
NZOQ01000006.1_108:113272:14931:1
NZOQ01000006.1_108:113372:14991:1

$ awk -F ":" '{OFS="\t"}{if ($1 ~ /^NZ/) print $1,$2,$3}' test
NZOQ01000006.1_108  113072  14901
NZOQ01000006.1_108  113172  14961
NZOQ01000006.1_108  113272  14931
NZOQ01000006.1_108  113372  14991

Based on the comment you have below you are looking for bedtools intersect or bedops equivalent (@Alex may be by with that answer).

What do you mean by a "gene neighbourhood"? Do you mean a fixed distance either side of the gene? Or do you want to use the midpoint between genes?

I am looking for the closest +/-10 genes from my coordinates

0 answers

No answers yet.

Log in to answer this question.