I have one file tab
and one file lrt$fitted.values
. I would like to take the IDs GeneID
from tab
and filter out the rows in lrt$fitted.values
that matches this GeneID
I tried something like this:
grep(tab$GeneID,lrt$fitted.values)
my files:
tab
GeneID logFC logCPM LR PValue FDR
hsa-miR-20b-5p|hsa-mir-20b hsa-miR-20b-5p|hsa-mir-20b -1.802771 5.28974 14.69575 0.0001263309 0.02728747
head(lrt$fitted.values)
124G 356G 126G 235G 46G 243G 82G 68G 192G
hsa-let-7a-5p|hsa-let-7a-1 32183.896 29310.569 69804.995 66689.788 59921.623 64198.314 31899.265 59945.275 56539.4487
hsa-let-7a-5p|hsa-let-7a-2 32180.380 29307.367 69797.369 66682.502 59915.077 64186.624 31895.780 59934.359 56529.1532
hsa-let-7a-5p|hsa-let-7a-3 32103.732 29237.562 69631.124 66523.676 59772.369 64016.191 31819.810 59775.218 56379.0534
hsa-let-7b-5p|hsa-let-7b 12255.487 11161.337 26581.438 25395.180 22817.893 23257.116 12147.101 21716.368 20482.5400
hsa-let-7c-5p|hsa-let-7c 1120.679 1020.626 2430.686 2322.211 2086.537 1105.720 1110.767 1032.467 973.8072
hsa-let-7d-5p|hsa-let-7d 2955.159 2691.327 6409.567 6123.525 5502.065 5455.887 2929.024 5094.443 4804.9994
I am assuming your files are loaded into R as dataframes (based on the $
). If you want to filter the lrt$fitted.values
dataframe based on a list of exclusion values I would do something like this:
#list of exclusion values
negvalues <- tab$GeneID
# exclude those values based on rownames.
df <- lrt$fitted.values
df[!rownames(df) %in% negvalues,]
%in%
will check for membership in the list; !
will negate the lookup.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.