[BioC] regular expression for targets

Joern Toedling toedling at ebi.ac.uk
Wed Jul 16 11:11:10 CEST 2008


Try
myNames = gsub("\\_.*$","", data$targets$FileName)
Note that "names" is not a good name for a variable since there already 
is a very fundamental function called 'names', which you probably don't 
want to maks.
Regards,
Joern


DAVID ARTETA GARCIA wrote:
> Dear list,
>
> I have a set of gpr files that I have read in using read.maimages(), 
> all of them ending with the number and the date of the experiment. 
> When I plot the intensities using boxplot() I get the full name of the 
> sample, i.e. with these long endings. How can I remove these endings?
>
>> data$targets
>                                          FileName
> slide 27_3_210408           slide 27_3_210408.gpr
> slide 28_3_210408           slide 28_3_210408.gpr
> slide 31_3_210408           slide 31_3_210408.gpr
> slide 32_3_220408           slide 32_3_220408.gpr
> slide 33_3_220408           slide 33_3_220408.gpr
> .
> .
> .
>
> After looking in the archives of BioC and R I tried the following code 
> and variations of that but with no luck (I am probably far off the 
> right expression). I am trying to store the filenames under a vector 
> that can be given as argument to boxplot
>
>> names = sub('(_3_)(\.)','',data$targets,perl=TRUE)
>
> Can anyone help me?
>
> Thanks
>
> D.



More information about the Bioconductor mailing list