Danis102 / seqpac

seqpac - A Framework for small RNA analysis in R using Sequence-Based Counts
7 stars 0 forks source link

PAC_deseq - main_factor #12

Closed lovisaor closed 4 years ago

lovisaor commented 4 years ago

Should default instead be the last factor provided in model? (since design = model)

lovisaor commented 4 years ago

Also noticed that main_factor is ignored

model =~flowcell+Sampled+Intervention, main_factor="Intervention" returns: logFC_flowcell_2_vs_1

Danis102 commented 4 years ago

Main_factor is not the "main factor" in the model. I see that the naming is confusing and will change it. Main_factor is rather a way to control the orientation of the factor categories. Say for instance that you have your "control" samples presented first in the pheno table but want deseq to make log2FC treamtent vs control. If you don't specify your treatment/control factor the log2FC will be generated as control vs treatment since by default factor level will be set to c(control, treatment). By specifying main_factor argument you can make sure that "treatment" is presented first in the factor levels, and therefore log2FC will be generated treatment vs control, and not control vs treatment.

Danis102 commented 4 years ago

I have updated the PAC_deseq function so that main_factor is removed and the comparative factor level (group) is instead controlled by pheno_target[[2]]. Thus if pheno_target=list("groups", c("treatment", "control")), where "groups" is a column in Pheno, then log2FC should become treatment vs control, while if pheno_target=list("groups", c("control", "treatment")) then log2FC becomes control vs treatment.