[BioC] exclude flagged spots in limma
Marcus Davy
mdavy at hortresearch.co.nz
Fri Aug 4 00:02:42 CEST 2006
Here are a few of ways;
> x
[1] 0 1 0 0 1
> (!x)*1
[1] 1 0 1 1 0
> as.numeric(!x)
[1] 1 0 1 1 0
> abs(x - 1)
[1] 1 0 1 1 0
The logical operator "!" coerces the binary vector to logical and does a
logical negation (NOT).
A weight of 0 is equivalent to an NA, a weight between 0 and 1 will be used
to do a weighted linear model using lmFit (internally lm.series etc) if the
weights matrix is in your MAList and you specify to use it in the analysis.
Marcus
On 8/4/06 2:22 AM, "Yolande Tra" <yvtsma at rit.edu> wrote:
> Hi Jose,
>
> Thank you for your reply. One problem is that value of 1 was assigned for bad
> spots and 0 for good ones. Is there a way to switch these values?
>
> Yolande
>
> ________________________________
>
> From: bioconductor-bounces at stat.math.ethz.ch on behalf of
> J.delasHeras at ed.ac.uk
> Sent: Thu 8/3/2006 7:43 AM
> To: bioconductor at stat.math.ethz.ch
> Subject: Re: [BioC] exclude flagged spots in limma
>
>
>
> Quoting Yolande Tra <yvtsma at rit.edu>:
>
>> Hi Gordon,
>>
>> I have read some of your answers regarding this issue but it does not
>> answer mine. I have 5 separate image output files from Scanalyze (not
>> one of the output listed in Limma). For each file, one of the column
>> named FLAG contains the flagged values of 1 if bad and 0 if good. Can
>> you please help me, how can I exclude these spots from the analysis.
>>
>> The following commands helped me to read each file saved ast text
>> (tab delimiter)
>>> filenames <- c("gp1.dat","gp2.dat","gp3.dat","gp4.dat","gp5.dat")
>>> RG <- read.maimages(filenames,annotation="My_spot_labels",
>> columns=list(Rf="CH1I",Gf="CH2I",Rb="CH1B",Gb="CH2B"))
>> These are the notation in Scanalyze.
>>
>> I have used one function in the archive and got the following error
>>> mywtfun <- function(exclude.flags=c(1,2,3)) function(obj) 1-(obj$Flag %in%
>> + exclude.flags)
>>> RG <- read.maimages(filenames,annotation="My_spot_labels",
>>> columns=list(Rf="CH1I",Gf="CH2I",Rb="CH1B",Gb="CH2B"),
>>> wt.fun=mywtfun(c(1)))
>> Error in "[<-"(`*tmp*`, , i, value = numeric(0)) :
>> nothing to replace with
>>
>> Thank you so much for your help.
>> Yolande
>
> Hi Yolande,
>
> you can add "manually" a component $weights to your RG object. This is
> merely a matrix with values between 0 and 1, with as many columns as
> there are slides, and as many rows as there are genes. So each column
> is a "flags" column for each slide.
>
> You can use the read.table function to read the whole data file (output
> from Scanalyze) for each slide, and then simply pick the column
> containing the flags, and use them to build the matrix. Then just
> assign RG$weights<- yourmatrix, and you're rolling...
>
> You can create your own flags from any other parameters you wish, as
> long as you end up with a number between 0 and 1, where 1 is full
> weight (good) and 0 is bad, and different degrees in between.
>
> I hope this helps.
>
> Jose
>
> --
> Dr. Jose I. de las Heras Email: J.delasHeras at ed.ac.uk
> The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131 6513374
> Institute for Cell & Molecular Biology Fax: +44 (0)131 6507360
> Swann Building, Mayfield Road
> University of Edinburgh
> Edinburgh EH9 3JR
> UK
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
______________________________________________________
The contents of this e-mail are privileged and/or confidenti...{{dropped}}
More information about the Bioconductor
mailing list