{"action":"created","issue":{"url":"https://api.github.com/repos/drisso/RUVSeq/issues/7","labels_url":"https://api.github.com/repos/drisso/RUVSeq/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/drisso/RUVSeq/issues/7/comments","events_url":"https://api.github.com/repos/drisso/RUVSeq/issues/7/events","html_url":"https://github.com/drisso/RUVSeq/issues/7","id":103765800,"number":7,"title":"RUVSeq DE analysis for data with replicate samples and 4 conditions","user":{"login":"sharvari14","id":7240579,"avatar_url":"https://avatars.githubusercontent.com/u/7240579?v=3","gravatar_id":"","url":"https://api.github.com/users/sharvari14","html_url":"https://github.com/sharvari14","followers_url":"https://api.github.com/users/sharvari14/followers","following_url":"https://api.github.com/users/sharvari14/following{/other_user}","gists_url":"https://api.github.com/users/sharvari14/gists{/gist_id}","starred_url":"https://api.github.com/users/sharvari14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharvari14/subscriptions","organizations_url":"https://api.github.com/users/sharvari14/orgs","repos_url":"https://api.github.com/users/sharvari14/repos","events_url":"https://api.github.com/users/sharvari14/events{/privacy}","received_events_url":"https://api.github.com/users/sharvari14/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-28T17:55:23Z","updated_at":"2015-08-28T18:29:20Z","closed_at":null,"body":"Hello,\r\n\r\nI have a question on using RUVSeq for removing batch effects for 8 samples of RNA-Seq data  - 2 batches with 4 samples each.\r\n\r\nThe example data in the tutorial shows 2 conditions with 3 replicates each:\r\nhttps://www.bioconductor.org/packages/release/bioc/vignettes/RUVSeq/inst/doc/RUVSeq.pdf\r\n\r\nFollowing the steps in section 3 to estimate factors of unwanted variation using replicate samples, I am trying to define the matrix as:\r\ndifferences <- matrix(data=c(1:2,3:4,5:6,7:8), byrow=TRUE, nrow=2)\r\nPCA plot for set3 doesn't group the replicates:\r\n![image](https://cloud.githubusercontent.com/assets/7240579/9553150/1e073464-4d8b-11e5-8f0c-3b5d7e16f97e.png)\r\n\r\nHowever, if I define matrix for pairwise condition as:\r\n> differences1 <- matrix(data=c(1:2,3:4), byrow=TRUE, nrow=2)\r\n> set3_1 <- RUVs(set, genes, k=1, differences1)\r\n> plotPCA(set3_1, col=colors[x], cex=1.2)\r\nand\r\n>differences2 <- matrix(data=c(5:6,7:8), byrow=TRUE, nrow=2)\r\n> set3_2 <- RUVs(set, genes, k=1, differences2)\r\n> plotPCA(set3_2, col=colors[x], cex=1.2)\r\n\r\nThe PCA plot for each shows grouping of replicates for the 1st 2 conditions.\r\n\r\nCould you please let me know what is the correct approach to remove batch effects from replicates and do DE analysis for pairs of conditions : Control vs. KD and Control75 vs. KD75\r\n\r\n> set\r\nSeqExpressionSet (storageMode: lockedEnvironment)\r\nassayData: 18201 features, 8 samples \r\n  element names: counts, normalizedCounts, offset \r\nprotocolData: none\r\nphenoData\r\n  sampleNames: Control_1 Control_2 ... KD75_2 (8 total)\r\n  varLabels: x\r\n  varMetadata: labelDescription\r\nfeatureData: none\r\nexperimentData: use 'experimentData(object)'\r\nAnnotation:  \r\n> pData(set)\r\n                        x\r\nControl_1     Control\r\nControl_2     Control\r\nKD_1         KD\r\nKD_2         KD\r\nControl75_1 Control75\r\nControl75_2 Control75\r\nKD75_1     KD75\r\nKD75_2     KD75\r\n\r\nThanks for all the help.\r\nSharvari"},"comment":{"url":"https://api.github.com/repos/drisso/RUVSeq/issues/comments/135854570","html_url":"https://github.com/drisso/RUVSeq/issues/7#issuecomment-135854570","issue_url":"https://api.github.com/repos/drisso/RUVSeq/issues/7","id":135854570,"user":{"login":"dtenenba","id":2286826,"avatar_url":"https://avatars.githubusercontent.com/u/2286826?v=3","gravatar_id":"","url":"https://api.github.com/users/dtenenba","html_url":"https://github.com/dtenenba","followers_url":"https://api.github.com/users/dtenenba/followers","following_url":"https://api.github.com/users/dtenenba/following{/other_user}","gists_url":"https://api.github.com/users/dtenenba/gists{/gist_id}","starred_url":"https://api.github.com/users/dtenenba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtenenba/subscriptions","organizations_url":"https://api.github.com/users/dtenenba/orgs","repos_url":"https://api.github.com/users/dtenenba/repos","events_url":"https://api.github.com/users/dtenenba/events{/privacy}","received_events_url":"https://api.github.com/users/dtenenba/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T18:29:20Z","updated_at":"2015-08-28T18:29:20Z","body":"@sharvari14 it doesn't sound like you are reporting an issue with the package. You should be asking on the support site: https://support.bioconductor.org/ . Be sure and tag your question with the package name (RUVSeq)."}}