Treatment vector error

5 views
Skip to first unread message

Anita Wray

unread,
Mar 10, 2026, 1:48:49 PMMar 10
to methylkit_discussion
Hello, 

I am trying to read in 8 files via the following code:

file_list <- list("./EPI1028EH_S291_L002_R.combined_mbias.tsv",
"./EPI1028EL_S292_L002_R.combined_mbias.tsv",
"./EPI1028FH_S293_L002_R.combined_mbias.tsv",
"./EPI1028FL_S294_L002_R.combined_mbias.tsv",
"./V0124H_S287_L002_R.combined_mbias.tsv",  
"./V0124L_S288_L002_R.combined_mbias.tsv" ,  
"./V0373H_S289_L002_R.combined_mbias.tsv" ,  
"./V0373L_S290_L002_R.combined_mbias.tsv")

sample_ids <- c('EPI1028EH','EPI1028EL','EPI1028FH',"EPI1028FL",
                "V0124H",'V0124L','V0373H','V0373L')


 myobj=methRead(file_list,
        sample.id= sample_ids,
        treatment = c(1,1,1,1,1,1,1,1),
        assembly = 'sminiatus',
           context="CpG")

But I keep getting the following error:
Error in if (is.na(treatment)) stop("Treatment vector is missing.") : the condition has length > 1

It seems like when I run (is.na(treatment)) I get multiple FALSE outputs, but I can't seem to figure out how to fix it. Ideally I could just eliminate the treatment vector entirely (it's not needed in my case) but any solution would be appreciated.

Best, 
Anita

Alexander Blume

unread,
Mar 13, 2026, 3:06:50 PMMar 13
to methylkit_...@googlegroups.com
Hi Anita,

You may need to convert your sample.ids to a list via as.list() function.

Also, I am not sure we support reading from methylation bias files, but feel free to give it a shot. The details section of the methRead help gives more information about the pipeline argument and reading supported/custome files.

Best,
Alex

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/methylkit_discussion/1a42e85e-b7d1-43c3-8bd1-d8dda8617745n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages