Entering edit mode
7.3 years ago
1769mkc
★
1.2k
So
gene HSC LSC fc
ACTR6 0.6032459633 2.24405896 3.7199734379
APEX1 6.0443930667 5.18402206 0.8576579985
APOBEC3C 3.5626328667 4.61072292 1.2941897446
APOBEC3H-2.952164 -0.398966118 0.135143616
ARID1A 3.8456664333 2.75774774 0.7171052892
ARID1B 3.4017756 2.33561938 0.6865883158
file1$fc <- (file1$LSC/file1$HSC)
HSC_LSC_fold_Change <-file1 %>%
mutate(FOLD_UP_DOWN = ifelse((fc) > 2.5, "up", "down"))
I m doing something like this am i doing it correctly ?is this the way one would calculate fold change ?
Do suggest if im doing something wrong
I don't think your fold change values are correct. Could you explain why you have negative values in your HSC and LSC columns, please? Have those values been log-transformed, and if so, shouldn't the fc column should be LSC - HSC?
Note that log(B / A) = log(B) - log(A)
yes these are log transformed values yes this i get it
Note that log(B / A) = log(B) - log(A)' so i just have to subtract the log transformed values ?is that what you are suggesting
Yes, subtract one from the other, and label the column logFC, so you remember that the data is trasnformed.
You shouldn't be treating things that "aren't upregulated" as being downregulated. I think it wold be better to split the values as follows (if you consider it appropriate to define up/down-regulation based on fold-change alone), if you genuinely do want to split at ~ 2^2.5 ~ 5-fold as your cut-off
cut(logFC, breaks = c(-Inf, -2.5, 2.5, Inf), include.lowest = TRUE, labels = c("DOWN", "NC", "UP"))
where do i include your code in my code
can you tell me ...?
Within
mutate
:thank you for the code since i have pretty basic use of R i dont know how these simple yet effective things to do...but thank you again
can you explain ..this so if i get -2.5 then down and 2.5 .....but when do i get NC?
Run some experiments:
Read the helppage for
cut
please post example data here including fc groups
edited my post please have a look at it again
if expression values are logged, then you should be simply subtracting between the groups. Your FC column is incorrect, considering the values for LSC and HSC. Since your comparison is between LSC and HSC (in that order), subtract HSC from LSC (assuming that expression values are in log2). That should give you the FC.
FC cutoff used in your code is 2.5 and 2^2.5 is 5.656854. Is that what you are looking for? Your code is modified as below:
output:
From the above table, let us say any gene with above 1.08 fold change (log2) is up regulated, any gene below 1.08 fold change (log2) is down regulated and any gene between 1.08 and -1.08 is NC, then the code would be:
output:
NC= did not change, up=upregulated and down=downregulated. FC CO 1.08 is arbitrary.
thankyou for making it clear
i understand your the complete picture so to make it clear i m taking HSC as my control and LSC those are disease cell so that would be my test ..so i have to subtract LSC from HSC isnt it?
you'd usually subtract the control from the non-control value (ie, LSC - HSC)
Yes, from your description. Did you do statistical test before you chose genes of interest?
these are the differentlially expressed genes I got this data from SeqMonk ...it did a deseq2 analysis im using that data