the feature file is not .gz and upon just leaving the gunzip command and follwing didnt help either, it only wrote an empty genes.bed file
Intersect genomic locations with genes
I have a bed file containing genomic locations and A or B compartment annotations, how do i find the genes in these location from this bed file. I was doing a hic data analysis
This is my domain file generated from compartment analysis of hic data, if anybody has worked with hic data or knows hic data analysis ,it would be really helpful
• 2,023 views
•
link
1 answer
get a bed file with the genes eg:
gunzip -c in.gtf.gz |\
awk -F '\t' '($3=="gene") {G="."; N=split($9,a,/[; "]*/); for(i=1;i+1<=N;i++){if(a[i]=="gene_name") {G=a[i+1];break;}} printf("%s\t%d\t%d\t%s\n",$1,int($4)-1,$5,G);}' |\
sort -t $'\t' -k1,1 -k2,2n > genes.bed
and then use bedtools intersect
• 0 views
•
link
• 0 views
•
link
the feature file is not .gz
this is obviously just an example, I'm not supposed to know your environment.
so don't use gunzip !
• 0 views
•
link
Log in to answer this question.
it exceeds the total words allowed limit, but this is the basic format, it contains the genomic locations of each chromosome followed by if it falls into A or B compartments followed by an ensulation score.
yes but you don't have to paste the whole file. The first 10 rows would have been ok.
my bad, i misunderstood, here is the file format