ChromoMap Error in 1:nrow(temp.df) : argument of length 0
0
0
Entering edit mode
4.4 years ago
kousi31 ▴ 100

I am trying to plot the distribution of genes on chromosome using chromoMap.
I prepared a chromosome_file. txt as per manual

NC_037545.1     1       202105980   
NC_037546.1     1       188952477
NC_037547.1     1       175630833

and Annotation_file.txt as

LOC112581744    NC_037545.1     6566415 6567888   
LOC112582356   NC_037545.1     8234378 8238149   
LOC112582960    NC_037545.1    12240957        12245030   
LOC112582972    NC_037545.1     12499447     12505618

I am getting as Error in 1:nrow(temp.df) : argument of length 0

I tried searching Google for answers an found an answer as

it's the classic gotcha of, with a matrix with one dimension of length 1, without drop=FALSE, R converts a matrix to a vector

I think it is bcoz of the chromosome start position being one in all columns. I don't know where to specify drop=FALSE

I am new to R. Kindly help.

R chromoMap software error • 2.9k views
ADD COMMENT
0
Entering edit mode

Do you have a variable named temp.df? If not, you need to find out where this error happens (which function call) and check its input parameters - if one or more of them is a data.frame, ensure all subsetting operations are done in this manner

df[row_filter_if_any, col_filter_if_any, drop = FALSE]

Let's say you need the first row and/or first column, it could be

df[1, , drop = FALSE] #only rows 1
df[, 1, drop = FALSE] # only col 1

If you're not sure how many rows or columns would be returned, use the general format specified above.

ADD REPLY
0
Entering edit mode

The software takes the file directly from the working directory. If I use data.frame to import the data, it is not recognizing the object.

> setwd("~/lr/chromomap/")
> library(chromoMap)
> chromoMap("chromosome_file.txt","de_lncrna.annotation")
********************************** __ __ ************
** __**|__ * __* __ * __ __ * __ *|  |  |* __ * __ **
**|__**|  |*|  *|__|*|  |  |*|__|*|  |  |*|_ |*|__|**
***********************************************|   **
*************** by Lakshay Anand ********************
OUTPUT: 
Number of Chromosome sets: 1 
Number of Chromosomes in set  1 : 25 
Processing data.. 
Number of annotations in data set  1 : 121 
Error in 1:nrow(temp.df) : argument of length 0

I tried to use data.frame

> chromosome.f <- data.frame("chromosome_file.txt", row.names = NULL, stringsAsFactors = T)
> annotation.f <- data.frame("de_lncrna.annotaion", row.names = NULL,stringsAsFactors = T)
> chromoMap("chromosome.f","annotation.f")
********************************** __ __ ************
** __**|__ * __* __ * __ __ * __ *|  |  |* __ * __ **
**|__**|  |*|  *|__|*|  |  |*|__|*|  |  |*|_ |*|__|**
***********************************************|   **
*************** by Lakshay Anand ********************
OUTPUT: 
Number of Chromosome sets: 1 
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'chromosome.f': No such file or directory

According to the manual once input file is created, directly import the text file

Once you have your input files ready, begin creating chromosomes plots like a pro. The simplest annotation plot can be created using the following command:

>library(chromoMap)
> chromoMap("chromosome_file.txt","annotation_file.txt")
  
ADD REPLY
0
Entering edit mode

The software looks really badly written, I wonder if CRAN does any QC before accepting packages. Is this the best package you can find for your purposes?

In any case, I think you'd be better off emailing the author at the email mentioned in the manual (although there are two emails specified in the manual and one of them looks like a typo, but to be safe, add both of them as recipients.)

ADD REPLY

Login before adding your answer.

Traffic: 1675 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6