shenlab-sinai / ngsplot

Quick mining and visualization of NGS data by integrating genomic databases
Other
252 stars 65 forks source link

Configuring variables...Error in if (!all(genome.coord$start <= genome.coord$end)) { : missing value where TRUE/FALSE needed #82

Closed vidaletal closed 5 years ago

vidaletal commented 5 years ago

Hi all, I'm receiving an error if I try to use custom .bed files.

When I ran the following command:

ngs.plot.r -G hg19 -R bed -E /Users/raphael/Desktop/Projects/Occupancy_of_other_proteins/Repeat_Masker_hg19/Human.Alu.family.in.hg19.bed -C /Users/raphael/Desktop/Projects/Occupancy_of_other_proteins/bam/CDC81.bam -O CDC.Alu -T CDC.in.Alu.sites -L 1000 -FL 75 -P 0

this error appears:

Configuring variables...Error in if (!all(genome.coord$start <= genome.coord$end)) { : missing value where TRUE/FALSE needed Calls: SetupPlotCoord -> ReadBedCoord In addition: Warning messages: 1: In Ops.factor(bed.coord[, 2], 1) : ‘+’ not meaningful for factors 2: In Ops.factor(genome.coord$start, genome.coord$end) : ‘<=’ not meaningful for factors Execution halted

If I ran this one: ngs.plot.r -G hg19 -R tss -C /Users/raphael/Desktop/Projects/Occupancy_of_other_proteins/bam/CDC81.bam -O CDC.Alu -T CDC.in.Alu.sites -L 1000 -FL 75 -P 0

Works totally fine.

Head of the .bed file looks fine:

chrom<tab>start<tab>end<tab>strand

> head(Human_Alu_family_in_hg19.bed) chrom start end strand chr1 26790 27053 + chr1 31435 31733 + chr1 35366 35499 + chr1 39623 39924 + chr1 40628 40729 - chr1 51584 51880 + chr1 61862 62160 - chr1 76892 77201 + chr1 80804 81096 + chr1 87125 87413 - chr1 90920 91213 + chr1 93728 94031 -

Also:

> all(Human_Alu_family_in_hg19.bed$start <= Human_Alu_family_in_hg19.bed$end) [1] TRUE

Can anyone shed some light?

Many thanks,

Raphael

vidaletal commented 5 years ago

I sorted the issue. Letting here in case someone need:

if you download from USCS in R: setwd("") as.data.frame(read.table(file = "Original_bed", header = F,sep = "\t"))->BED BED<-BED[,c(1,2,3,6,4,5)] write.table(BED, file = "FIXED.txt",quote =F,row.names = F,col.names = F, sep = "\t",eol = "\r")