[BioC] Small bug in function 'countskip.FASTA.entries' from package 'altcdfenvs'
lgautier@altern.org
lgautier at altern.org
Wed Nov 16 17:59:46 CET 2005
> Dear Laurent Gautier,
>
> First of all, let me express my gratitudine and compliments for the
> very important package you contributed and I apologize for this long
> message (that I am CCing to the BioC list).
>
> I'm currently using 'altcdfenvs' to re-map probe sequences from Affy
> MOE430 2.0 arrays and I noticed a small but reproducible bug in the
> function 'countskip.FASTA.entries'.
>
<snip>
> Why?
>
> When I inspected the source of function 'countskip.FASTA.entries', I
> noticed that the argument defining the connection to the file
> containing the FASTA entries was missing. The function was therefore
> using the 'con' object found in the global environment, rather than the
> one passed as an argument. But when R was reloaded, the 'con' object
> disappeared and the error showed up. In other words, the vignette code
> chunk worked fine for me just by chance! ;-)
?! I thought I fixed that some time ago !!
Well, it seems I did not.
But anyway, congratulations for tracking that sneaky one down !
> I thus changed the function in the following way:
>
> ### My personal modification of function 'countskip.FASTA.entries'
> ### to allow a file connection to be passed to the function
> my.countskip.FASTA.entries <- function (con, linebreaks = 3000) {
> i <- as.integer(0)
> fs <- read.FASTA.entry(con)
> while (!identical(fs$header, character(0)) && !identical(fs$sequence,
> NULL)) {
> i <- i + 1
> fs <- read.FASTA.entry(con)
> }
> return(i)
> }
> ### End of my modified function
>
> When I now modify my test function to use 'my.countskip.FASTA.entries'
> instead of 'countskip.FASTA.entries', I have no errors regardless
> whether I'm working in a fresh or older R session... In addition, now
> I'm allowed to have more than one file connection around and specify
> the one I would like to pass to 'my.countskip.FASTA.entries'...
>
> BTW, what is the argument 'linebreaks' good for? It seems not to be
> used inside the function...
hoho... one more glitch...
"linebreaks" should be passed to "read.FASTA.entry".
> Hope this feed-back was worth reporting!
It surely was worth reporting it.
Thanks for this.
Fixes should be in the repository during the week-end.
Best,
Laurent
> Thank you again and best wishes,
> Norman
>
> > sessionInfo()
> R version 2.2.0, 2005-10-06, powerpc-apple-darwin7.9.0
>
> attached base packages:
> [1] "tools" "methods" "stats" "graphics" "grDevices" "utils"
> [7] "datasets" "base"
>
> other attached packages:
> altcdfenvs makecdfenv matchprobes affy Biobase
> "1.4.0" "1.8.0" "1.2.1" "1.8.1" "1.8.0"
>
> Norman Pavelka
> Department of Biotechnology and Bioscience
> University of Milano-Bicocca
> Piazza della Scienza, 2
> 20126 Milan, Italy
>
> Phone: +39 02 6448 3556
> Fax: +39 02 6448 3552
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>
More information about the Bioconductor
mailing list