Not sure if your reads are PhredQuality or SolexaQuality depending on
the Fastq file format version.

It looks as though you want to extract the quality matrix, does this work?

qual <- SolexaQuality(quality(quality(reads)))
as(qual, "matrix")

Marcus


On Sat, Mar 17, 2012 at 2:37 AM, wang peter <wng.peter@gmail.com> wrote:

> hello all
> when i runned the scripts to clean the fastq data, it reported an error.
> but if i run it step by step, it has no problem
>
> reads <- readFastq(fastqfile);
> seqs <- sread(reads);
> qual <- SolexaQuality(quality(quality(reads)))
>
> that is the error place:
> myqual_mat <- matrix(charToRaw(as.character(unlist(qual))),
> nrow=length(qual), byrow=TRUE)
>
> Error in .Call(.NAME, ..., PACKAGE = PACKAGE) :
>  negative length vectors are not allowed
> Calls: trimRead ... matrix -> charToRaw -> unlist -> unlist -> .Call2 ->
> .Call
> Execution halted
>
>
> R version 2.14.1 (2011-12-22)
> Platform: x86_64-redhat-linux-gnu (64-bit)
>
> 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=C                 LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> --
> shan gao
> Room 231(Dr.Fei lab)
> Boyce Thompson Institute
> Cornell University
> Tower Road, Ithaca, NY 14853-1801
> Office phone: 1-607-254-1267(day)
> Official email:sg839@cornell.edu
> Facebook:http://www.facebook.com/profile.php?id=100001986532253
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

