On Thu, Aug 30, 2012 at 2:18 AM, Maria Rodrigo <mrod...@gmail.com> wrote:
> Hi Henrik,
>
> Your guess was correct, I was using download.file(), and I thought I had
> done it manually from several locations, but I must have been wrong. In any
> case, the "wb" mode has fixed the problem.

Great.

>
> I also looked at your "downloadFile" function, and tried to change
> "destfile", but it kept saving the .CDF file in the current working
> directory instead of in the annotationData folder.

FYI, there is no 'destfile' argument to downloadFile(), cf.
help("downloadFile", package="R.utils").  Instead:

> library("R.utils");
pathname <- 
downloadFile("http://bcgc.lbl.gov/cdfFiles/HuEx-1_0-st-v2,A20071112,EP/HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf";,
path="annotationData/chipTypes/HuEx-1_0-st-v2/");
> print(pathname);
[1] 
"annotationData/chipTypes/HuEx-1_0-st-v2/HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf"
> print(file.info(pathname)$size);
[1] 40108891

For anyone else reading this: R.utils::downloadFile() downloads the
atomically, i.e. it either downloads the complete file or nothing at
all.  Thus, there is no risk of getting an incomplete download, which
you may indeed get if you use utils::download.file().  This is done by
first downloading to a temporary file, which is only renamed when the
download is complete.  Just as most modern downloader are doing, e.g.
web browsers.

/Henrik

>
> Thank you very much for your help!!
>
> Best,
> María
>
>
> On 29 August 2012 21:37, Henrik Bengtsson
> <henrik.bengts...@aroma-project.org> wrote:
>>
>> As a follow up, my guess is that you're using download.file() in R to
>> download the file, correct?  If so, you *have to* to set argument
>> mode="wb".  Better/much safer, use:
>>
>> library("R.utils");
>>
>> downloadFile("http://bcgc.lbl.gov/cdfFiles/HuEx-1_0-st-v2,A20071112,EP/HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf";);
>>
>> /Henrik
>>
>> On Wed, Aug 29, 2012 at 11:52 AM, Henrik Bengtsson
>> <henrik.bengts...@aroma-project.org> wrote:
>> > Ok, there is something wrong with your downloads. Downloading that URL
>> > should give you a file that is exactly 40,108,891 bytes.  Your
>> > downloaded file is of a different size.  I don't know how you're
>> > downloading and with what software, but I recommend that you try
>> > using a different software, a different computer, and as an extreme
>> > backup from a different internet connection (work vs home)?
>> >
>> > /Henrik
>> >
>> > On Wed, Aug 29, 2012 at 9:01 AM, Maria Rodrigo <mrod...@gmail.com>
>> > wrote:
>> >> Hi Henrik,
>> >>
>> >> Sorry, I also checked the file size and checksum and I forgot to add
>> >> them to
>> >> the email; they do not match your results, see below:
>> >>
>> >>
>> >>> cdf <- AffymetrixCdfFile$byChipType(chipType,
>> >> +                     tags = "coreR3,A20071112,EP")
>> >>> cdf
>> >> AffymetrixCdfFile:
>> >> Path: annotationData/chipTypes/HuEx-1_0-st-v2
>> >> Filename: HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf
>> >> Filesize: 38.26MB
>> >> Chip type: HuEx-1_0-st-v2,coreR3,A20071112,EP
>> >> RAM: 0.00MB
>> >>
>> >> File format: v4 (binary; XDA)
>> >> Dimension: 10x3328
>> >> Number of cells: 33280
>> >> Number of units: 1226050061
>> >> Cells per unit: 0.00
>> >>
>> >> Number of QC units: 65536
>> >>> getFileSize(cdf)
>> >> [1] 40119256
>> >>> getChecksum(cdf)
>> >> [1] "4edf1818f913069ba314e1358fc232a5"
>> >>> packageDescription("affxparser")
>> >> Package: affxparser
>> >> Version: 1.28.1
>> >> Date: 2012-03-30
>> >> Title: Affymetrix File Parsing SDK
>> >> Author: Henrik Bengtsson, James Bullard, Robert Gentleman, Kasper
>> >>         Daniel Hansen, Martin Morgan
>> >> Maintainer: Kasper Daniel Hansen <khan...@jhsph.edu>
>> >> Description: Package for parsing Affymetrix files (CDF, CEL, CHP,
>> >>         BPMAP, BAR).  It provides methods for fast and memory efficient
>> >>         parsing of Affymetrix files using the Affymetrix' Fusion SDK.
>> >>         Both ASCII- and binary-based files are supported.  Currently,
>> >>         there are methods for reading chip definition file (CDF) and a
>> >>         cell intensity file (CEL).  These files can be read either in
>> >>         full or in part.  For example, probe signals from a few
>> >>         probesets can be extracted very quickly from a set of CEL files
>> >>         into a convenient list structure.
>> >> FusionDetails: Fusion SDK v1.1.0
>> >> License: LGPL (>= 2)
>> >> Depends: R (>= 2.6.0)
>> >> Suggests: R.utils (>= 1.9.11), AffymetrixDataTestFiles
>> >> LazyLoad: yes
>> >> biocViews: Infrastructure, DataImport
>> >> Packaged: 2012-06-27 05:14:14 UTC; biocbuild
>> >> Built: R 2.15.1; i386-pc-mingw32; 2012-06-27 10:04:17 UTC; windows
>> >>
>> >> -- File: C:/Programmer/R/R-2.15.1/library/affxparser/Meta/package.rds
>> >>
>> >> Thanks!!
>> >>
>> >> Maria
>> >>
>> >>
>> >>
>> >> On 28 August 2012 21:05, Henrik Bengtsson
>> >> <henrik.bengts...@aroma-project.org> wrote:
>> >>>
>> >>> Comments below...
>> >>>
>> >>> On Tue, Aug 28, 2012 at 4:06 AM, Maria Rodrigo <mrod...@gmail.com>
>> >>> wrote:
>> >>> > Hi Henrik,
>> >>> >
>> >>> > Thanks for your reply.
>> >>> >
>> >>> > I have checked what you ask for and the information from my cdf file
>> >>> > and
>> >>> > yours does not match, see output of "> cdf" in the code below. I
>> >>> > have
>> >>> > downloaded the file again from:
>> >>> >
>> >>> >
>> >>> > http://bcgc.lbl.gov/cdfFiles/HuEx-1_0-st-v2,A20071112,EP/HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf
>> >>> >
>> >>> > I also downloaded the zipped folder
>> >>> > HuEx-1_0-st-v2,R3,A20071112,EP.zip,
>> >>> > containing .CDF files for core, extended, full and more. Their names
>> >>> > do
>> >>> > not
>> >>> > include R3, but just the date. I tried the file for core probesets
>> >>> > contained
>> >>> > in the zipped folder,  and this one matches yours 100% (see output
>> >>> > of ">
>> >>> > cdf2" below).
>> >>>
>> >>> Let's skip this approach and focus on the first one.
>> >>>
>> >>> >
>> >>> > Do you think there might be something wrong with the .CDF file on
>> >>> > the
>> >>> > website, or do you think it gets corrupted when I download it? I
>> >>> > have
>> >>> > downloaded it from several places, many times, I must say.
>> >>> >
>> >>> >> cdf <- AffymetrixCdfFile$byChipType(chipType,
>> >>> > +                     tags = "coreR3,A20071112,EP")
>> >>> >
>> >>> >> cdf
>> >>> > ## AffymetrixCdfFile:
>> >>> > ## Path: annotationData/chipTypes/HuEx-1_0-st-v2
>> >>> > ## Filename: HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf
>> >>> > ## Filesize: 38.26MB
>> >>> >
>> >>> > ## Chip type: HuEx-1_0-st-v2,coreR3,A20071112,EP
>> >>> > ## RAM: 0.00MB
>> >>> > ## File format: v4 (binary; XDA)
>> >>> > ## Dimension: 10x3328
>> >>> > ## Number of cells: 33280
>> >>> > ## Number of units: 1226050061
>> >>> > ## Cells per unit: 0.00
>> >>> > ## Number of QC units: 65536
>> >>>
>> >>> And what does:
>> >>>
>> >>> > getFileSize(cdf)
>> >>> > getChecksum(cdf)
>> >>>
>> >>> give?  That's critical in order to confirm that your download is not
>> >>> corrupt.  Also, what does the following give:
>> >>>
>> >>> > packageDescription("affxparser")
>> >>>
>> >>> /Henrik
>> >>>
>> >>> >> cdf2 <- AffymetrixCdfFile$byChipType(chipType,
>> >>> > +                     tags = "core,A20071112,EP")
>> >>> >> cdf2
>> >>> >
>> >>> > ## AffymetrixCdfFile:
>> >>> > ## Path: annotationData/chipTypes/HuEx-1_0-st-v2
>> >>> > ## Filename: HuEx-1_0-st-v2,core,A20071112,EP.cdf
>> >>> > ## Filesize: 38.25MB
>> >>> > ## Chip type: HuEx-1_0-st-v2,core,A20071112,EP
>> >>> >
>> >>> > ## RAM: 0.00MB
>> >>> > ## File format: v4 (binary; XDA)
>> >>> > ## Dimension: 2560x2560
>> >>> > ## Number of cells: 6553600
>> >>> > ## Number of units: 18708
>> >>> > ## Cells per unit: 350.31
>> >>> > ## Number of QC units: 1
>> >>> >
>> >>> > On 27 August 2012 02:09, Henrik Bengtsson
>> >>> > <henrik.bengts...@aroma-project.org> wrote:
>> >>> >>
>> >>> >> Hi,
>> >>> >>
>> >>> >> I see nothing wrong with your script.  I suspect that the CDF
>> >>> >> you've
>> >>> >> downloaded got corrupted or something.  Do you get the same output
>> >>> >> as
>> >>> >> below:
>> >>> >>
>> >>> >> > library("aroma.affymetrix")
>> >>> >> > cdf <- AffymetrixCdfFile$byChipType(chipType, tags =
>> >>> >> > "coreR3,A20071112,EP");
>> >>> >> > cdf
>> >>> >> ## AffymetrixCdfFile:
>> >>> >> ## Path: annotationData/chipTypes/HuEx-1_0-st-v2
>> >>> >> ## Filename: HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf
>> >>> >> ## Filesize: 38.25MB
>> >>> >> ## Chip type: HuEx-1_0-st-v2,coreR3,A20071112,EP
>> >>> >> ## RAM: 0.00MB
>> >>> >> ## File format: v4 (binary; XDA)
>> >>> >> ## Dimension: 2560x2560
>> >>> >> ## Number of cells: 6553600
>> >>> >> ## Number of units: 18708
>> >>> >> ## Cells per unit: 350.31
>> >>> >> ## Number of QC units: 1
>> >>> >> > getFileSize(cdf)
>> >>> >> [1] 40108891
>> >>> >> > getChecksum(cdf)
>> >>> >> [1] "e7b0bacd27699534d125b16266d7cc09"
>> >>> >>
>> >>> >> /Henrik
>> >>> >>
>> >>> >>
>> >>> >> On Wed, Aug 15, 2012 at 4:30 AM, Maria Rodrigo-Domingo
>> >>> >> <mrod...@gmail.com> wrote:
>> >>> >> > Dear aroma team,
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > I am using aroma.affymetrix for the exon array and I am having
>> >>> >> > trouble
>> >>> >> > using
>> >>> >> > one of your custom .CDF files. It is the one for core
>> >>> >> > transcripts:
>> >>> >> > “HuEx-1_0-st-v2,coreR3,A20071112,EP.CDF”, listed in
>> >>> >> > http://aroma-project.org/node/122, under R3.  I get an error when
>> >>> >> > setting up
>> >>> >> > the cel set with that .CDF file: there seems to be  a mismatch
>> >>> >> > between
>> >>> >> > the
>> >>> >> > number of cells on the .CDF file and on the .CEL files (please,
>> >>> >> > see
>> >>> >> > below).
>> >>> >> > I report the output of sessionInfo() and traceback() after the
>> >>> >> > code.
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > I have tried several other of your custom .CDF files (R3:
>> >>> >> > extended
>> >>> >> > and
>> >>> >> > full,
>> >>> >> > R2: core) and I do not get any errors. I am actually using one
>> >>> >> > .CDF
>> >>> >> > file
>> >>> >> > called  “HuEx-1_0-st-v2,core,A20071112,EP.CDF” that works just
>> >>> >> > fine.
>> >>> >> > The
>> >>> >> > only difference in the name is the missing R3 and I only realized
>> >>> >> > after
>> >>> >> > my
>> >>> >> > supervisor tried to test my script. I downloaded it one year ago
>> >>> >> > and
>> >>> >> > I
>> >>> >> > assumed it was yours, but I cannot remember where I got it from
>> >>> >> > and
>> >>> >> > cannot
>> >>> >> > trace it back.
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > I have downloaded the core R3 .CDF file several times from
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > http://bcgc.lbl.gov/cdfFiles/HuEx-1_0-st-v2,A20071112,EP/HuEx-1_0-st-v2,coreR3,A20071112,EP.cdf,
>> >>> >> > to make sure I have the right version.
>> >>> >> >
>> >>> >> > Do you think there might be something wrong about the available
>> >>> >> > file?
>> >>> >> > Any
>> >>> >> > ideas on how to solve this problem? Thank you very much for your
>> >>> >> > help.
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > Best,
>> >>> >> >
>> >>> >> > Maria Rodrigo
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> >> ds <- "AffyColonCancer"
>> >>> >> >
>> >>> >> >> chipType <- "HuEx-1_0-st-v2"
>> >>> >> >
>> >>> >> >> cdf <- AffymetrixCdfFile$byChipType(chipType, tags =
>> >>> >> >> "coreR3,A20071112,EP")
>> >>> >> >
>> >>> >> >> cs <- AffymetrixCelSet$byName(ds, cdf = cdf)
>> >>> >> >
>> >>> >> > Error in method(static, ...) :
>> >>> >> >
>> >>> >> > [2012-08-15 12:47:07] Exception: Failed to setup a data set for
>> >>> >> > any
>> >>> >> > of 1
>> >>> >> > data directories located. The following reasons were reported:
>> >>> >> > (1)
>> >>> >> > Cannot
>> >>> >> > set CDF. The specified CDF structure
>> >>> >> > ('HuEx-1_0-st-v2,coreR3,A20071112,EP')
>> >>> >> > is not compatible with the chip type ('HuEx-1_0-st-v2') of the
>> >>> >> > CEL
>> >>> >> > file.
>> >>> >> > The
>> >>> >> > number of cells do not match: 33280 != 6553600 (while trying
>> >>> >> > 'rawData/AffyColonCancer/HuEx-1_0-st-v2').
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> >   at #02. method(static, ...)
>> >>> >> >
>> >>> >> >           - method() is in environment 'aroma.affymetrix'
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> >   at #01. AffymetrixCelSet$byName(ds, cdf = cdf)
>> >>> >> >
>> >>> >> >           - AffymetrixCelSet$byName() is local of the calling
>> >>> >> > function
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> >> sessionInfo()
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > R version 2.15.1 (2012-06-22)
>> >>> >> >
>> >>> >> > Platform: i386-pc-mingw32/i386 (32-bit)
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > locale:
>> >>> >> >
>> >>> >> > [1] LC_COLLATE=Danish_Denmark.1252  LC_CTYPE=Danish_Denmark.1252
>> >>> >> > LC_MONETARY=Danish_Denmark.1252 LC_NUMERIC=C
>> >>> >> >
>> >>> >> > [5] LC_TIME=Danish_Denmark.1252
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > attached base packages:
>> >>> >> >
>> >>> >> > [1] stats     graphics  grDevices utils     datasets  methods
>> >>> >> > base
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > other attached packages:
>> >>> >> >
>> >>> >> > [1] aroma.affymetrix_2.5.0 affxparser_1.28.1      aroma.apd_0.2.3
>> >>> >> > R.huge_0.4.1           aroma.core_2.5.0       aroma.light_1.24.0
>> >>> >> >
>> >>> >> >  [7] matrixStats_0.5.2      R.rsp_0.8.2
>> >>> >> > R.devices_2.1.1
>> >>> >> > R.filesets_1.1.5       digest_0.5.2           R.cache_0.6.2
>> >>> >> >
>> >>> >> > [13] R.utils_1.12.1         R.oo_1.9.8
>> >>> >> > R.methodsS3_1.4.2
>> >>> >> > BiocInstaller_1.4.7
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> > loaded via a namespace (and not attached):
>> >>> >> >
>> >>> >> > [1] tools_2.15.1
>> >>> >> >
>> >>> >> >
>> >>> >> >
>> >>> >> >> traceback()
>> >>> >> >
>> >>> >> > 11: modStop(cond)
>> >>> >> >
>> >>> >> > 10: abort.condition(cond)
>> >>> >> >
>> >>> >> > 9: abort(cond)
>> >>> >> >
>> >>> >> > 8: abort.default(msg, call = call)
>> >>> >> >
>> >>> >> > 7: abort(msg, call = call)
>> >>> >> >
>> >>> >> > 6: throw.Exception(Exception(...))
>> >>> >> >
>> >>> >> > 5: throw(Exception(...))
>> >>> >> >
>> >>> >> > 4: throw.default(msg)
>> >>> >> >
>> >>> >> > 3: throw(msg)
>> >>> >> >
>> >>> >> > 2: method(static, ...)
>> >>> >> >
>> >>> >> > 1: AffymetrixCelSet$byName(ds, cdf = cdf)
>> >>> >> >
>> >>> >> > --
>> >>> >> > When reporting problems on aroma.affymetrix, make sure 1) to run
>> >>> >> > the
>> >>> >> > latest
>> >>> >> > version of the package, 2) to report the output of sessionInfo()
>> >>> >> > and
>> >>> >> > traceback(), and 3) to post a complete code example.
>> >>> >> >
>> >>> >> >
>> >>> >> > You received this message because you are subscribed to the
>> >>> >> > Google
>> >>> >> > Groups
>> >>> >> > "aroma.affymetrix" group with website
>> >>> >> > http://www.aroma-project.org/.
>> >>> >> > To post to this group, send email to
>> >>> >> > aroma-affymetrix@googlegroups.com
>> >>> >> > To unsubscribe and other options, go to
>> >>> >> > http://www.aroma-project.org/forum/
>> >>> >>
>> >>> >> --
>> >>> >> When reporting problems on aroma.affymetrix, make sure 1) to run
>> >>> >> the
>> >>> >> latest version of the package, 2) to report the output of
>> >>> >> sessionInfo()
>> >>> >> and
>> >>> >> traceback(), and 3) to post a complete code example.
>> >>> >>
>> >>> >>
>> >>> >> You received this message because you are subscribed to the Google
>> >>> >> Groups
>> >>> >> "aroma.affymetrix" group with website
>> >>> >> http://www.aroma-project.org/.
>> >>> >> To post to this group, send email to
>> >>> >> aroma-affymetrix@googlegroups.com
>> >>> >> To unsubscribe and other options, go to
>> >>> >> http://www.aroma-project.org/forum/
>> >>> >
>> >>> >
>> >>> > --
>> >>> > When reporting problems on aroma.affymetrix, make sure 1) to run the
>> >>> > latest
>> >>> > version of the package, 2) to report the output of sessionInfo() and
>> >>> > traceback(), and 3) to post a complete code example.
>> >>> >
>> >>> >
>> >>> > You received this message because you are subscribed to the Google
>> >>> > Groups
>> >>> > "aroma.affymetrix" group with website http://www.aroma-project.org/.
>> >>> > To post to this group, send email to
>> >>> > aroma-affymetrix@googlegroups.com
>> >>> > To unsubscribe and other options, go to
>> >>> > http://www.aroma-project.org/forum/
>> >>>
>> >>> --
>> >>> When reporting problems on aroma.affymetrix, make sure 1) to run the
>> >>> latest version of the package, 2) to report the output of
>> >>> sessionInfo() and
>> >>> traceback(), and 3) to post a complete code example.
>> >>>
>> >>>
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups
>> >>> "aroma.affymetrix" group with website http://www.aroma-project.org/.
>> >>> To post to this group, send email to aroma-affymetrix@googlegroups.com
>> >>> To unsubscribe and other options, go to
>> >>> http://www.aroma-project.org/forum/
>> >>
>> >>
>> >> --
>> >> When reporting problems on aroma.affymetrix, make sure 1) to run the
>> >> latest
>> >> version of the package, 2) to report the output of sessionInfo() and
>> >> traceback(), and 3) to post a complete code example.
>> >>
>> >>
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "aroma.affymetrix" group with website http://www.aroma-project.org/.
>> >> To post to this group, send email to aroma-affymetrix@googlegroups.com
>> >> To unsubscribe and other options, go to
>> >> http://www.aroma-project.org/forum/
>>
>> --
>> When reporting problems on aroma.affymetrix, make sure 1) to run the
>> latest version of the package, 2) to report the output of sessionInfo() and
>> traceback(), and 3) to post a complete code example.
>>
>>
>> You received this message because you are subscribed to the Google Groups
>> "aroma.affymetrix" group with website http://www.aroma-project.org/.
>> To post to this group, send email to aroma-affymetrix@googlegroups.com
>> To unsubscribe and other options, go to
>> http://www.aroma-project.org/forum/
>
>
> --
> When reporting problems on aroma.affymetrix, make sure 1) to run the latest
> version of the package, 2) to report the output of sessionInfo() and
> traceback(), and 3) to post a complete code example.
>
>
> You received this message because you are subscribed to the Google Groups
> "aroma.affymetrix" group with website http://www.aroma-project.org/.
> To post to this group, send email to aroma-affymetrix@googlegroups.com
> To unsubscribe and other options, go to http://www.aroma-project.org/forum/

-- 
When reporting problems on aroma.affymetrix, make sure 1) to run the latest 
version of the package, 2) to report the output of sessionInfo() and 
traceback(), and 3) to post a complete code example.


You received this message because you are subscribed to the Google Groups 
"aroma.affymetrix" group with website http://www.aroma-project.org/.
To post to this group, send email to aroma-affymetrix@googlegroups.com
To unsubscribe and other options, go to http://www.aroma-project.org/forum/

Reply via email to