Hi,
I'm trying to generate simulated  fastq data by mixing read from original
sample with Phix reads
So i load my sample data and phix data
library(ShortRead)
rfq.sf1<- readFastq(dir, pattern=sample.f1)
rfq.phix1 <- readFastq(dir, pattern=phix.f2)
specify the percentage of reads in the original file to be replaced by phix
reads and select ramdomly the reads to be replaced in sample and the reads
to be selected in phix
nbreads=fx.ratio/100*length(rfq.sf1)
n.sf.ids=sample(1:length(rfq.sf1),nbreads)
n.ph.ids=sample(1:length(rfq.phix1),nbreads)
but when I call
rfq.sf1[n.sf.ids]=rfq.phix1[n.ph.ids]
I get an error
Error in rfq.sf1[n.sf.ids] = rfq.phix1[n.ph.ids] :
  object of type 'S4' is not subsettable
I tried then
sread(rfq.sf1[n.sf.ids])=sread(rfq.phix1[n.ph.ids])
quality(rfq.sf1[n.sf.ids])=quality(rfq.phix1[n.ph.ids])
And i get an error too
Error in sread(rfq.sf1[n.sf.ids]) = sread(rfq.phix1[n.ph.ids]) :
  could not find function "sread<-"
Error in quality(rfq.sf1[n.sf.ids]) = quality(rfq.phix1[n.ph.ids]) :
  could not find function "quality<-"
what will be the method to use to replace theses reads ?
Thanks in advance for suggestions.


Kind regards
Ramzi
----------------------------------------------------------------

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-sig-sequencing mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to