problem with impute2databel() function

Questions about GenABEL (aka *ABEL) suite of packages
Forum rules
Please remember not to post any sensitive data on this public forum.
The first few posts of newly registered users will be moderated in order to filter out any spammers.

When get a solution to the problem you posted, please change the topic name (e.g. from "how to ..." to "[SOLVED] how to ..."). This will make it easier for the community to follow the posts yet to be attended.
taye
Posts: 4
Joined: Mon Apr 11, 2011 8:44 pm

problem with impute2databel() function

Postby taye » Mon Apr 11, 2011 9:13 pm

I used impute2databel() function to convert imputev2 imputed data into databel. I have got the error message below. Help?

genofile (impute data) has the following format
--- rsid bp A G 0.896 0.104 0 0.896 0.104 0 0.502 0.497 .................
--- rsid bp C A 0.998 0.002 0 0.998 0.002 0 0.502 0.497 ................
........

sample data file has 4 columns
ID_1 ID_2 Missing Gender Phenotype
....

The error message I have got:

Code: Select all

> impute2databel(genofile, samplefile, outfile="imputeout", makeprob=TRUE, old=FALSE)
Options in effect:
         --infile    = c(1, 1)
         --outfile   = c(2, 1)
         --skiprows  = OFF
         --skipcols  = 5
         --cnrow     = ON, using data from file '1:2'
         --rncol     = ON, using data from file 'c(31470563,'
         --transpose = ON
         --Rmatrix   = OFF
         --nanString = c(2,
Can not open file 'c(1,' for reading

ERROR in Rstaff:failed in text2fvf_R
Index file not exists: ./tmp877619.fvi
Error in checkSlotAssignment(object, name, value) :
  assignment of an object of class "NULL" is not valid for slot "data" in an object of class "databel"; is(value, "externalptr") is not TRUE

Nicola Pirastu
GenABEL senior expert
GenABEL senior expert
Posts: 151
Joined: Wed Feb 09, 2011 3:24 pm

Re: problem with impute2databel() function

Postby Nicola Pirastu » Tue Apr 12, 2011 7:52 am

I'm not sure because I've never used that function before, but it looks that you haven't specified the input files in

Code: Select all

impute2databel(genofile, samplefile, outfile="imputeout", makeprob=TRUE, old=FALSE)


My guess is that if this is the command you have used you should specify the genofile and samplefile.

Code: Select all

impute2databel(genofile="MY_IMPUTE_GENOFILE_NAME", samplefile="MY_IMPUTE_SAMPLEFILE_NAME", outfile="imputeout", makeprob=TRUE, old=FALSE)

taye
Posts: 4
Joined: Mon Apr 11, 2011 8:44 pm

Re: problem with impute2databel() function

Postby taye » Tue Apr 12, 2011 12:59 pm

I got the data read but still gives me an error message "Index file not exists: C://Taye//ubuntu//PROBABEL//databel//sm ... t.dose.fvi"
Do you know what that means? I copied the whole code below.

Code: Select all

> impute2databel(genofile=paste(data.dir, "NGRC_CHR6_BP31470560.31470570.posterior_sampld_haps_impt.impute2", sep=""),
+ samplefile=paste(data.dir, "NGRC_CHR4.sample", sep=""), outfile="C://Taye//ubuntu//PROBABEL//databel//small//imputeout", makeprob=TRUE, old=FALSE)
Options in effect:
         --infile    = C://Taye//ubuntu//PROBABEL//data//small//CHR_BP31470560.31470570.posterior_sampld_haps_impt.impute2
         --outfile   = ./tmp772043
         --skiprows  = OFF
         --skipcols  = 5
         --cnrow     = OFF
         --rncol     = ON, using column 2 of 'C://Taye//ubuntu//PROBABEL//data//small//CHR_BP31470560.31470570.posterior_sampld_haps_impt.impute2'
         --transpose = ON
         --Rmatrix   = OFF
         --nanString = NA
Number of lines in source file is 2
Number of words in source file is 11963
skiprows = 0
cnrow = 0
skipcols = 5
rncol = 2
Rmatrix = 0
numWords = 11963
Creating file with numRows = 2
Creating file with numColumns = 11958
text2fvf finished.
Index file not exists: C://Taye//ubuntu//PROBABEL//databel//small//imputeout.dose.fvi
ERROR in Rstaff:Cannot initialize output file
File C://Taye//ubuntu//PROBABEL//databel//small//imputeout.dose is already opened.
Error in checkSlotAssignment(object, name, value) :
  assignment of an object of class "NULL" is not valid for slot "data" in an object of class "databel"; is(value, "externalptr") is not TRUE
>

yurii
GenABEL developer
GenABEL developer
Posts: 263
Joined: Fri Jan 21, 2011 5:20 pm

Re: problem with impute2databel() function

Postby yurii » Wed Jun 15, 2011 5:55 am

This is somewhat difficult to answer what could be the reason (I think we need more diagnostic messages in DatABEL...).

Can you make sure that output files do not exist before you initiate conversion -- eg

rm imputeout.*

If that does not work, would be great to have a toy example dataset + script allowing to reproduce the error.

Yurii
Note that (Gen)ABELs are dynamically developing; while this post is intended to provide full information at the time of posting, please read on further posts, if any, as the topic may be updated with novel solutions at a later stage.

best regards,
Yurii

MariaG
GenABEL specialist
GenABEL specialist
Posts: 36
Joined: Thu Feb 03, 2011 12:29 pm

Re: problem with impute2databel() function

Postby MariaG » Fri Feb 15, 2013 1:47 pm

Hi!

I've got the same error, while working on MAC today:

Code: Select all

ERROR in Rstaff:failed in text2fvf_R
Index file not exists: /Volumes/Local/home/statistics/GWA/CADASIL/Input/genotypes/C1.chr17selected.databel.txt.fvi
Error in checkSlotAssignment(object, name, value) :
  assignment of an object of class "NULL" is not valid for slot "data" in an object of class "databel"; is(value, "externalptr") is not TRUE


I can see, that the question was already discussed:
http://r-forge.r-project.org/tracker/index.php?func=detail&aid=2085&group_id=505&atid=2058

So, was the problem solved or not? What should we do to let the function mach2datable() work correctly?

Thanks

Maria

Nicola Pirastu
GenABEL senior expert
GenABEL senior expert
Posts: 151
Joined: Wed Feb 09, 2011 3:24 pm

Re: problem with impute2databel() function

Postby Nicola Pirastu » Tue Feb 19, 2013 9:53 am

Hi Maria,

I think your error message is different from the one Taye got, while in his case the text2fvf finishes, in yuor case it crushes.

Could you please copy the whole DatABEL screen print also with the command line you are using?

Best

Nicola

yurii
GenABEL developer
GenABEL developer
Posts: 263
Joined: Fri Jan 21, 2011 5:20 pm

Re: problem with impute2databel() function

Postby yurii » Sat Feb 23, 2013 9:36 pm

Taye:

There may be a lot of confusion about the messages by these procedures unless you do a 'clean' run and report full error log. So the clean run is

1) got to the directory you do this analysis or even better make a new directory
2) make sure no VF files are there, e.g. 'rm *.fv?' (be careful - this will kill all these files)
3) Start R
4) Start conversion

If something went wrong, fix your code, and repeat from 1) again. There are more 'elegant' ways from inside the R involving 'unlink' and 'rm' and 'gc', but above is kind of bullet-proof

Note the message "File C:[...]imputeout.dose is already opened." - this suggests that you are ALREADY working with this file eg from other R session or something else.

Maria:

I think in your case, as Nicola points out, something is 'wrong' with the text file as 'text2fvf' fails
Note that (Gen)ABELs are dynamically developing; while this post is intended to provide full information at the time of posting, please read on further posts, if any, as the topic may be updated with novel solutions at a later stage.

best regards,
Yurii

PSmith
Posts: 3
Joined: Thu Jun 28, 2012 9:51 am

Re: problem with impute2databel() function

Postby PSmith » Mon Mar 04, 2013 3:30 pm

I am having a similar problem that I hope someone can help me with. I'm not getting any output files as a consequence.

The command I'm typing in R is:

impute2databel(genofile="genofile",samplefile="samplefile",outfile="test_outfile",makeprob=TRUE,old=FALSE)

The output I'm getting is:

Options in effect:
--infile = genofile
--outfile = ./tmp873074
--skiprows = OFF
--skipcols = 5
--cnrow = OFF
--rncol = ON, using column 2 of 'genofile'
--transpose = ON
--Rmatrix = OFF
--nanString = NA
Can not open file 'genofile' for reading

ERROR in Rstaff:failed in text2fvf_R
Index file not exists: ./tmp873074.fvi
Error in checkSlotAssignment(object, name, value) :
assignment of an object of class “NULL” is not valid for slot ‘data’ in an object of class “databel”; is(value, "externalptr") is not TRUE

Nicola Pirastu
GenABEL senior expert
GenABEL senior expert
Posts: 151
Joined: Wed Feb 09, 2011 3:24 pm

Re: problem with impute2databel() function

Postby Nicola Pirastu » Wed Mar 06, 2013 7:53 pm

Hi,

PSmith:

it looks that it cannot read the "genofile" file.
Given that you've checked that the file is in the right directory and that it is in the right format, I would check that you have permission to read the file.


I'd like to add also a small piece to the discussion:

while a student in our lab was converting some .gen files she started getting the usual error. She was doing this using a small R script from the command prompt with R CMD ad a bash cycle. She also used screen to let it do all chromosomes one after the other.

The only way to go around it was to close the screen and make a new one. Not sure why this happens but if you are using screens try to close and create a new one at each conversion.

Nicola.

yurii
GenABEL developer
GenABEL developer
Posts: 263
Joined: Fri Jan 21, 2011 5:20 pm

Re: problem with impute2databel() function

Postby yurii » Fri Mar 08, 2013 10:33 am

BTW, I have noticed that with DatA I need to use full and not relative file names, e.g.

/home/username/data/mydata.gen

would work

but

~/data/mydata.gen

would not

Not sure if this is Mac OS specific issue

Yurii
Note that (Gen)ABELs are dynamically developing; while this post is intended to provide full information at the time of posting, please read on further posts, if any, as the topic may be updated with novel solutions at a later stage.

best regards,
Yurii


Return to “GenABEL”

Who is online

Users browsing this forum: No registered users and 12 guests