Tag Info

6

R supports logistic regression, which would seem to be the most efficient method for tackling this question. Assuming the "Chemo" variable is the type of chemo the code would be something like: glm( (response_to_chemo == "yes") ~ BMI + Chemo + Predictor + DJANGO + gender, family="binomial") EDIT: Corrected a typo (added a missing double quote)

5

I would suggest looking at some of the documentation. As far as I can tell, the intention of the package is to visualize and organize correlation coefficient estimates. It does not seem that the author of the package has any interest in p-value estimation. If you are interested in computing p-values, I would suggest using a different tool, such as the ...

4

Here is a solution using the pheatmap library to cluster and visualise the correlation matrix, then extract the groups from the cluster dendrograms: gen <- read.csv(file = "TF_NORMAL_NEW_40.txt", header = TRUE, row.names = 1, sep = ",") gendat <- t(gen) library(corrplot) library(Hmisc) macolor = colorRampPalette(c("navyblue", "white", "red"))(100) ...

4

Since Spearman is a rank-based test, it relies on you being able to accurately decide on the ranking of your observations by some metric (usually the magnitude of the numbers). If two observations have identical values (are tied), then they cannot be definitively ranked. Since the ranks are not unique, exact p-values cannot be determined. e.g. in your data, ...

3

It means the distribution is heavily skewed and has a 'long-tail', thus the variance is much greater than the mean. In other words most values are around zero, with a small number of values having extreme values. [ You need to check the goodness of fit because that is saying the deviation from a power-laws distribution is just significant. So it ain't quite ...

3

You can use the cells argument to only display the data for a specific subset of cells. For example to extract the values for a cluster 2: # The cluster identity is stored in the meta.data # In this example there is a clustering column called "RNA_snn_res.0.7" # but any metadata column can be used clust2.cells <- rownames(Seurat.data@meta.data[...

3

You can't compute a correlation matrix when you have more than ~46000 rows, since a standard R matrix can have a maximum of 2^31-1 values. Have a look at packages like bigcor. Alternatively, consider if having 3+ billion correlation values is really useful.

3

Nice data and good question. It is called "outlier" analysis or the analysis of the residual. Its an easy analysis, but . You calculated the standard deviation using the regression slope as the 'mean' and retain data within 1.96 standard deviations. You can plot the data like this and if you are lucky will see the residual forming a nice 'normal ...

3

You don't absolutely need to perform any further steps before calculating the correlation. However you would likely benefit from the following sort of workflow: Transform your data with vst() or robust log (see the DESeq2 vignette) so genes are on a more or less similar scale. Select the top 300-500 most variable genes Use this subset with to compute sample-...

3

The general approach would be to loop through every column starting at column 2. You can use numeric indexes to do that. For each column, check its type. If it is a factor, use your chisq.test method. If it is of numeric type, use your t.test approach. Write the results to a list so you can parse them later. This will be a good exercise for you in trying ...

2

Your calculations seem right, perhaps there was an error on their side. I also looked at the number of samples reported, but they use the same amount of samples in each case. Because they are testing whether Linc-ZNF469-3 is different in several tissues, they should have used a multiple test correction for the p-value (although reporting the original ...

2

You have category-based variables as well as variables based on continuous data. The best-option could be linear Mixed- effects model for your research purpose. Chi-square test and t-test may be used to cross-validate or re-examine the outcome of LME model.

2

First of all, RNASeq is extremely sensitive to batch effects. Are these matched controls processed at the same time as the tumors? IF they are not, lots of your differences will be caused by batch effect, and not cancer. I believe the best strategy is to merge the FPKM columns and perform correlation analyses of my gene of interest (GOI) versus all other ...

1

Here is a suggested workaround: Generate a p-value table using one of these tools: RcmdrMisc::rcorr.adjust() psych::corr.test() Then use corrr:as_cordf() to generate the tidy dataframe with the same structure as a regular corrr correlation table. Personally, I have used the Hmisc::rcorr() package, and it works well: Hmisc::rcorr() %>% [[('P') %>% ...

1

You can use mapply(). ta and tb being transposed data frames of your A and B data frames respectively: > mapply(cor, ta, tb)[mapply(cor, ta, tb) > 0.5] G_3 G_5 G_9 G_10 G_11 G_15 G_20 G_23 G_25 G_26 G_33 G_40 G_43 G_48 G_57 G_60 0.5346591 0.8066507 0.8379777 0.6752681 ...

1

It will not improve your correlation most likely, unless the zeros are not missing at random: library(Seurat) data <- pbmc_small data[["percent.mt"]] <- PercentageFeatureSet(data, pattern = "^MT-") data <- NormalizeData(data) genes <-c("HLA-DRA","LYZ") countdata = pbmc_small[["RNA"]]@data countdata <- t(as.matrix(countdata)[genes,]) plot(...

1

I found the LDheatmap package in R very helpful at calculating linkage disequilibrium. You can make plots such as this:

1

"Mutually exclusive" is not a precise statistical term because it could be seen as independence. Anyway if truly mutually exclusive AND their behaviour follows periodicity, i.e. sine waves, which it might do in a cell cycle, i.e. the cells divide at periodic intervals, you can do this via asynchronicity. If the gene expression can be described under ...

1

Actually I found an easy and efficient way. import pandas as pd import numpy as np import scipy import math import openpyxl from openpyxl import Workbook from scipy.stats import pearsonr from scipy.stats import spearmanr from scipy.stats import kendalltau pro=pd.read_csv('m_test.csv', index_col=0) xInds = [] yInds = [] for i in range(len(pro.index)): ...

1

You don't need g2 to go from 0 to din.index, just from 0 to g1 - 1. This way, you'll end up calculating just for the "lower triangle": g1-> 0 1 2 3 g2 0 #(0,0 to 0,1-1 = nothing) 1 X #(1,0 to 1,1-1 = 1,0) 2 X X #(2,0 to 2,2-1 = 2,0; 2,1) 3 X X X #(3,0 to 3,3-1 = 3,0; 3,1 and 3,2) 4 ...

1

Ok I think I roughly get what you want to get. Below I simulate something that's like your data because you provided two identical matrices. #3 TE, 10 tissue, random values # number of tissue M1 = matrix(rnorm(30),3,10) rownames(M1) = paste("TE",1:3,sep="_") colnames(M1) = paste("Tissue",letters[1:10],sep="_") ## make gene matrix, , random values M2 = ...

1

The problem with correlations in relative scale is know on the literature, it has been suggested to change to other metrics. So I wouldn't use it for internal control. As you can see on figure 3 of the linked article the correlation on the absolute scale tend to be higher. So I would say this is within expectations. As other way for internal controls are ...

1

I would use the p-value/FDR which each method returns to rank the gene list for that method in order from 'most likely to be DE' to least likely. You would then have three ranked lists of genes - you would put the actual rankings in for each gene - 1 for the top ranked, 2 for the next, etc. You could then carry out, say Spearman's rank correlation on the ...

1

Like haci mentioned, you can use the apply family of functions to loop over all your columns. apply(data,2, function(path_name){ summary(lm(data$Proteome_size ~ path_name -1))$adj.r.squared }) this gives you the adjusted r square value for your linear model, and apply(data,2, function(path_name){ summary(lm(data$Proteome_size ~ path_name -1))$...

1

One option is to use one of the apply family functions. If you enclose your code above (which generates errors by the way) in a function, you can then "apply" this function on the rows or columns of your data with something like apply(X, MARGIN, FUN, …), the margin being 1 for rows or 2 for columns (as in your case).

Only top voted, non community-wiki answers of a minimum length are eligible