Entering edit mode
7.6 years ago
Matus
▴
70
Hello everyone,
I have experienced a problem when I was trying to find closest TSS to a peak by using this command:
bedtools closest -a file_peaks.narrowPeak -b path/genes.tss.bed > file_closestTSS.txt
The error says: * ERROR: illegal character '.' found in integer conversion of string "3216969.". Exiting... I generated genes.tss.bed file from genes.gfp file which i found in Annotations of iGenome mm10
awk 'BEGIN {FS=OFS="\t"} { if($7=="+"){tss=$4-1} else { tss=$5} print $1,tss, tss+1 ".", ".", $7, $9}' path/genes.gtf > path/genes.tss.bed
Could anyone help me please? Thank you
It seems that a dot '.' is on the wrong place (where an integer is expected).
Show how your bed file looks like, maybe it becomes clear where that might be.
I'm not sure, but don
t you need comma after
tss+1`?what is the output of
head path/genes.tss.bed
?remove the
.
attached withend
coordinates.Try following
awk 'BEGIN {FS=OFS="\t"} { if($7=="+"){tss=$4-1} else { tss=$5} print $1,tss, tss+1, ".", $7, $9}' path/genes.gtf > path/genes.tss.bed
I get this error when I use bedtools afterwards:
You need to run
bedtools sort
on this.