Error: all(unlist(md_cols) %in% names(md)) is not TRUE
0
0
Entering edit mode
@582b8f2e
Last seen 19 months ago
China

Hi, An error occurred when I used the prePdata function: all (unlist (md_cols)% in% names (md)) is not TRUE:

> sce <- prepData(samp, Panel, Sample_sheet, features = Panel$fcs_colname)
Error in prepData(samp, Panel, Sample_sheet, features = Panel$fcs_colname) : 
  all(unlist(md_cols) %in% names(md)) is not TRUE

I checked Sample_ sheet$file_ The file name of name and flowSet are consistent. Why does this error occur? Can someone give me some guidance? Thank you.

The complete code is as follows (Panel is built by myself)

library(tidyverse)
Sample_sheet<-read.table("Sample_sheet.txt",header=T)
head(data.frame(md))


#fcs 文件
#BiocManager::install("cytofWorkflow",ask=F,update=F)
library(cytofWorkflow) 
p1='CLEAN_date/'
fs1=list.files(p1,'*fcs' )
samp <- read.flowSet(files = fs1,path = p1)


#Panel
library(readxl)
Panel <- colnames(samp)
Panel <- as.data.frame(Panel)
#Panel <- Panel[c(3:51),]
Panel <- as.data.frame(Panel)


Panel[,2] <- pData(parameters(samp[[1]]))$desc
colnames(Panel)[1] <- "fcs_colname"
colnames(Panel)[2] <- "antigen"


all(Panel$fcs_colname %in% colnames(samp))
#[1] TRUE
all(Sample_sheet$file_name %in% rownames(samp@phenoData))
#[1] TRUE


#------------------------2. -----------------------
#BiocManager::install("CATALYST")
library(CATALYST)

Sample_sheet$group <- factor(Sample_sheet$group, levels = c("WT","MH","MH(mut)"))
Sample_sheet$Sample_id <- factor(Sample_sheet$Sample_id, 
                       levels = Sample_sheet$Sample_id[order(Sample_sheet$group)])

# SingleCellExperiment
sce <- prepData(samp, Panel, Sample_sheet, features = Panel$fcs_colname)#实现了第2步得数据转换,arcsinh
Error in prepData(samp, Panel, Sample_sheet, features = Panel$fcs_colname) : 
  all(unlist(md_cols) %in% names(md)) is not TRUE
cytofWorkflow • 1.3k views
ADD COMMENT
0
Entering edit mode

The error seems to be unrelated to the FCS file names and panel, but points to a discrepancy between md (your Sample_sheet) and md_cols. By default, md is expected to contain columns named "file_name", "sample_id", "patient_id", "condition". If this is not the case, please adjust md_cols accordingly. Perhaps have a look at the documentation at ?prepData for more details.

ADD REPLY

Login before adding your answer.

Traffic: 466 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6