RGLab / QUALIFIER

Qualitiy control for gated flow cytometry data
6 stars 1 forks source link

Problem taking in metadata file whose column "name" contains fcs file with spaces #50

Open JauntyJJS opened 8 years ago

JauntyJJS commented 8 years ago

Hi,

I was trying to test the function qaPreprocess for my own dataset after getting getQAStats to work. However, I have received some error when I tried to call it

db<-new.env() initDB(db) GT <- readRDS("C:\Users\selvaje1\Desktop\FlowCytoStuff\GT.rds") suppressWarnings(write.table(GT@data@phenoData@data,file="C:\Users\selvaje1\Desktop\FlowCytoStuff\metadata.csv",append=FALSE,quote=FALSE,sep=',',eol="\n",na='',dec=".",row.names=FALSE,col.names=!file.exists("C:\Users\selvaje1\Desktop\FlowCytoStuff\metadata.csv")))

qaPreprocess(db=db,gs=GT,metaFile="C:\Users\selvaje1\Desktop\FlowCytoStuff\metadata.csv",isRaw = T, isMFI = T)

In addition: Warning message: In fread(metaFile) : Starting data input on line 2 and discarding line 1 because it has too few or too many items to be column names or data: name

I suspect that fread was not reading the right things and I was right.

fread("C:\Users\selvaje1\Desktop\FlowCytoStuff\metadata.csv") A01 KAB344-25uM.fcs 1: A01 VC.fcs 2: A02 KAB344-5uM.fcs 3: A02 VC.fcs 4: A03 KAB344-1uM.fcs 5: A03 VC.fcs 6: A04 KAB344-0.2uM.fcs 7: A04 VC.fcs 8: A05 KAB344-0.04uM.fcs 9: A06 KAB344-0.008uM.fcs 10: A07 LOA447-20uM.fcs 11: A08 LOA447-4uM.fcs 12: A09 LOA447-0.8uM.fcs 13: A10 LOA447-0.16uM.fcs 14: A11 LOA447-0.032uM.fcs 15: A12 LOA447-0.0064uM.fcs 16: B01 KAB344-25uM.fcs 17: B01 VC.fcs 18: B02 KAB344-5uM.fcs 19: B02 VC.fcs 20: B03 KAB344-1uM.fcs 21: B03 VC.fcs 22: B04 KAB344-0.2uM.fcs 23: B04 VC.fcs 24: B05 KAB344-0.04uM.fcs 25: B06 KAB344-0.008uM.fcs 26: B07 LOA447-20uM.fcs 27: B08 LOA447-4uM.fcs 28: B09 LOA447-0.8uM.fcs 29: B10 LOA447-0.16uM.fcs 30: B11 LOA447-0.032uM.fcs 31: B12 LOA447-0.0064uM.fcs A01 KAB344-25uM.fcs

It seems that fread reads space as an indicator of a new column, I tried fread("C:\Users\selvaje1\Desktop\FlowCytoStuff\metadata.csv",sep=",") and got what I need

                   name

1: A01 KAB344-25uM.fcs 2: A01 VC.fcs 3: A02 KAB344-5uM.fcs 4: A02 VC.fcs 5: A03 KAB344-1uM.fcs 6: A03 VC.fcs 7: A04 KAB344-0.2uM.fcs 8: A04 VC.fcs 9: A05 KAB344-0.04uM.fcs 10: A06 KAB344-0.008uM.fcs 11: A07 LOA447-20uM.fcs 12: A08 LOA447-4uM.fcs 13: A09 LOA447-0.8uM.fcs 14: A10 LOA447-0.16uM.fcs 15: A11 LOA447-0.032uM.fcs 16: A12 LOA447-0.0064uM.fcs 17: B01 KAB344-25uM.fcs 18: B01 VC.fcs 19: B02 KAB344-5uM.fcs 20: B02 VC.fcs 21: B03 KAB344-1uM.fcs 22: B03 VC.fcs 23: B04 KAB344-0.2uM.fcs 24: B04 VC.fcs 25: B05 KAB344-0.04uM.fcs 26: B06 KAB344-0.008uM.fcs 27: B07 LOA447-20uM.fcs 28: B08 LOA447-4uM.fcs 29: B09 LOA447-0.8uM.fcs 30: B10 LOA447-0.16uM.fcs 31: B11 LOA447-0.032uM.fcs 32: B12 LOA447-0.0064uM.fcs name

However, typing qaPreprocess(db=db,gs=GT,metaFile="C:\Users\selvaje1\Desktop\FlowCytoStuff\metadata.csv",sep=",",isRaw = T, isMFI = T) gives the same error, implying that the sep did not go into the fread function

Attached are the files needed to reproduce this error GT.zip

Is it possible for fread to take in sep="," since we expect metadata to be a csv file or have ... to include other functions to pass to fread besides getQAStats ?

Thank you.

Regards, Jeremy