Hi,

thank you.  I can reproduce this.  Explanation and fix below.

On Fri, Aug 14, 2015 at 5:27 PM, Guillaume Devailly <gdevai...@gmail.com> wrote:
> Hi,
>
> I was trying to run this :
> http://www.aroma-project.org/howtos/createCdfFromBioconductorPlatformDesignInfo/
> to create a mighty cdf file for HuGene-2_0-st affymetrix array from this
> bioconductor annotation package.
>
> When running the example code (after installing the appropriate packages) :
>
> library("aroma.affymetrix")
> library("pd.hugene.1.0.st.v1")
> pathname <- writeCdf(pd.hugene.1.0.st.v1, tags =
> "pd.hugene.1.0.st.v1,HB20110111", overwrite = TRUE)
>
> I obtained this error:
>> pathname <- writeCdf(pd.hugene.1.0.st.v1,
>> tags="pd.hugene.1.0.st.v1,HB20110111", overwrite=TRUE)
> Loading required namespace: pdInfoBuilder
> Generating CDF file from Platform Design (PD) package...
>  Platform Design (PD) package: pd.hugene.1.0.st.v1
>  Output path: annotationData/chipTypes/HuGene-1_0-st-v1
>  Filename: HuGene-1_0-st-v1,pd.hugene.1.0.st.v1,HB20110111.cdf
>  Pathname to generated CDF:
> annotationData/chipTypes/HuGene-1_0-st-v1/HuGene-1_0-st-v1,pd.hugene.1.0.st.v1,HB20110111.cdf
>  Chip type: HuGene-1_0-st-v1
>  Tags: pd.hugene.1.0.st.v1,HB20110111
>  Chip type dimensions: 1050x1050
>  Total number of cells (probes): 1102500
>  Querying Platform Design database...
>   Units by: transcript
>   Names by: fsetid
>   Available database tables:
>   [1] "chrom_dict" "core_mps"   "featureSet" "level_dict" "pmfeature"
>   [6] "table_info" "type_dict"
>   SQL query:
>
>         SELECT DISTINCT
> --          fid,
>           meta_fsetid AS probeset_id,
>           atom,
>           x,
>           y
>         FROM pmfeature
>         INNER JOIN core_mps USING(fsetid)
>         ORDER BY probeset_id, atom
>
>   'data.frame': 861493 obs. of  4 variables:
>    $ probeset_id: int  7892501 7892501 7892501 7892501 7892502 7892502
> 7892502 7892502 7892503 7892503 ...
>    $ atom       : int  1 2 3 5 7 10 11 12 13 14 ...
>    $ x          : int  870 28 638 888 108 411 918 958 928 495 ...
>    $ y          : int  110 899 469 863 984 622 657 949 361 447 ...
>   'data.frame': 861493 obs. of  4 variables:
>    $ probeset_id: int  7892501 7892501 7892501 7892501 7892502 7892502
> 7892502 7892502 7892503 7892503 ...
>    $ atom       : int  1 2 3 5 7 10 11 12 13 14 ...
>    $ x          : int  870 28 638 888 108 411 918 958 928 495 ...
>    $ y          : int  110 899 469 863 984 622 657 949 361 447 ...
>   Number of cells (probes) in PD database: 861493 (78.14%) of 1102500
>  Querying Platform Design database...done
>  Number of units: 33297
>  Unit names: 7892501, 7892502, 7892503, ..., 8180418
>  Average number of cells per units: 25.87
>  List of 3
>   $ 7892501:'data.frame':       4 obs. of  4 variables:
>    ..$ probeset_id: int [1:4] 7892501 7892501 7892501 7892501
>    ..$ atom       : int [1:4] 1 2 3 5
>    ..$ x          : int [1:4] 870 28 638 888
>    ..$ y          : int [1:4] 110 899 469 863
>   $ 7892502:'data.frame':       4 obs. of  4 variables:
>    ..$ probeset_id: int [1:4] 7892502 7892502 7892502 7892502
>    ..$ atom       : int [1:4] 7 10 11 12
>    ..$ x          : int [1:4] 108 411 918 958
>    ..$ y          : int [1:4] 984 622 657 949
>   $ 7892503:'data.frame':       4 obs. of  4 variables:
>    ..$ probeset_id: int [1:4] 7892503 7892503 7892503 7892503
>    ..$ atom       : int [1:4] 13 14 17 18
>    ..$ x          : int [1:4] 928 495 316 840
>    ..$ y          : int [1:4] 361 447 686 698
> Error in affxparser::writeCdf(...) :
>   unused argument (pathname =
> "annotationData/chipTypes/HuGene-1_0-st-v1/HuGene-1_0-st-v1,pd.hugene.1.0.st.v1,HB20110111.cdf")
>
>
> I am a simple R user and not an advanced package-maker wizard, so what I
> will say next is likely to be absurd, but:
>
> 1) AffyGenePDInfo.writeCdf.R source code:
> setMethodS3("writeCdf", "AffyGenePDInfo", function(this, tags=c("*"),
> unitsBy=c("transcript", "exon"), namesBy=c("fsetid", "id"), path=NULL,
> overwrite=FALSE, verbose=TRUE, ...) {
> [...]
>   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>   # Writing CDF file
>   # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>   pathname <- .writeCdf(ffs, pathname=pathname, overwrite=overwrite,
> verbose=less(verbose));
> [...]
> }
>
> setMethodS3("writeCdf", "PDInfoList", function(ffs, pathname,
> overwrite=FALSE, ..., verbose=TRUE) {
> [...]
>  pathnameT <- pushTemporaryFile(pathname, verbose=verbose);
>
>   .writeCdf(pathnameT, cdfheader=cdfHeader, cdf=cdfList,
>                   cdfqc=NULL, verbose=verbose, overwrite=overwrite);
> [...]
> }
> I am totaly confused by what is this .writeCdf function. Is it the writeCdf
> function from affxparser package?
>
> 2) affxparser::writeCdf first parameter is fname and not pathname. Hence the
> error?
> writeCdf(fname, cdfheader, cdf, cdfqc, overwrite=FALSE, verbose=0)

You did a pretty good job nailing this one down.  The .writeCdf() is a
light-weight wrapper for calling affxparser::writeCdf() with the
feature of loading and the affxparser package. It's a trick to please
R CMD check and CRAN.

The problem you're experiencing is because there is a typo in
writeCdf() for class AffyGenePDInfo; It should call writeCdf()
(without the period) such that writeCdf() for PDInfoList is called
which in turn calls .writeCdf() which calls affxparser::writeCdf().
This bug was introduce in January 2015, cf.
https://github.com/HenrikBengtsson/aroma.affymetrix/blame/master/R/AffyGenePDInfo.writeCdf.R#L295

I've fixed this in the develop branch, which you can install as:

source("http://callr.org/install#HenrikBengtsson/aroma.affymetrix@develop";)

This should install aroma.affymetrix 2.13.2-9000 ("-9000" indicates
develop version).

Thank you

Henrik

>
> 3) aroma is loading affxparser itself, and is masking the writeCdf function:
> Loading required package: affxparser
>
> Attaching package: âaffxparserâ
>
> The following object is masked from âpackage:aroma.affymetrixâ:
>
>     writeCdf
>
> and the annotation package:
> Attaching package: âoligoâ
>
> The following object is masked _by_ package:aroma.affymetrix:
>
>     writeCdf
>
>
> Reversing the order of package loading did not solved the issue.
> I am having the same issue when generating the cdf for the HuGene-2_0-st
> array.
>
> Thanks,
>
> Guillaume
>
>> sessionInfo()
> R version 3.2.0 (2015-04-16)
> Platform: x86_64-unknown-linux-gnu (64-bit)
> Running under: Scientific Linux release 6.5 (Carbon)
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats4    parallel  stats     graphics  grDevices utils     datasets
> [8] methods   base
>
> other attached packages:
>  [1] pd.hugene.1.0.st.v1_3.14.1 Biobase_2.28.0
>  [3] oligoClasses_1.30.0        RSQLite_1.0.0
>  [5] DBI_0.3.1                  Biostrings_2.36.3
>  [7] XVector_0.8.0              IRanges_2.2.5
>  [9] S4Vectors_0.6.2            BiocGenerics_0.14.0
> [11] aroma.light_2.4.0          aroma.affymetrix_2.13.2
> [13] aroma.core_2.13.1          R.devices_2.13.0
> [15] R.filesets_2.8.0           R.utils_2.1.0
> [17] R.oo_1.19.0                oligo_1.32.0
> [19] affxparser_1.40.0          R.methodsS3_1.7.0
>
> loaded via a namespace (and not attached):
>  [1] BiocInstaller_1.18.4  pdInfoBuilder_1.32.1  GenomeInfoDb_1.4.1
>  [4] base64enc_0.1-3       iterators_1.0.7       tools_3.2.0
>  [7] zlibbioc_1.14.0       digest_0.6.8          aroma.apd_0.6.0
> [10] bit_1.1-12            preprocessCore_1.30.0 R.cache_0.10.0
> [13] ff_2.2-13             foreach_1.4.2         R.rsp_0.20.0
> [16] PSCBS_0.44.0          DNAcopy_1.42.0        codetools_0.2-14
> [19] matrixStats_0.14.2    GenomicRanges_1.20.5  splines_3.2.0
> [22] R.huge_0.9.0          Cairo_1.5-8           affyio_1.36.0
>
> --
> --
> 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/
>
> ---
> You received this message because you are subscribed to the Google Groups
> "aroma.affymetrix" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to aroma-affymetrix+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
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/

--- 
You received this message because you are subscribed to the Google Groups 
"aroma.affymetrix" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to aroma-affymetrix+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to