Answers.Body: <p>I would simply look at co-variance across the entire dataset and examine values >0.8 in the first instance rather than select 1000 genes. </p>
  
  <p>With your approach sampling 1000 genes can be criticised for selective sampling and the way to get around this is to perform replicates, with (bootstraps) or without replacement. You could produce e.g. 1000 replicates of 1000 genes and perform co-variance on each replicate to examine Y = X. </p>
  
  <p>Python has a specific permutation/combinations module call itertools, which is different to random resampling and doesn't need replicates</p>
  
  <pre><code>from itertools import combinations
  X = [1,2,3]
  Y = [1,2,3]
  print (list(combinations(iterable, 1000) + X + Y))
  </code></pre>
  
  <hr>
  
  <p>The standard way is to sample is,</p>
  
  <pre><code>from random import sample 
  mygenes = [1, 2, 3, 4, 5]  
  
  print(sample(mygenes,3)) 
  </code></pre>
  
  <p><strong>Output</strong> </p>
  
  <pre><code>[2, 4, 5]
  </code></pre>
  
  <p>There is nuance and further funcationality ... I cannot remember is "sample" is with or without replacement (its quite a big deal)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-06T05:01:05.237Z
Answers.Text: thanks a lot, Mike ! very helpful ! wondering if possible to recommend any package in R has the functions for bootstrapping, or similar functions as in itertools. thanks a lot !
Answers.UserDisplayName: Bogdan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-07T15:34:58.077Z
Answers.Text: Hi @bogdan, I don't use R so can't recommend anything.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-06T02:17:31.220Z
Answers.LastActivityDate: 2020-03-06T11:00:46.777Z
Answers.LastEditDate: 2020-03-06T11:00:46.777Z
Answers.UserDisplayName: M__
Body: <p>please would you let me know, is there a package in R/python/C that has implemented <strong>randomization/permutation tests for joint genomic analyses</strong> </p>
  
  <p>(an example of joint genomic analyses -- when jointly considering both GENE EXPRESSION and PROTEIN BINDING along the DNA).</p>
  
  <p>The context of my question is the following :</p>
  
  <p>let's consider <strong>1000 UP_REGULATED genes with increased PROTEIN X and with a HISTONE MARK Y :</strong></p>
  
  <p>in order to show that PROTEIN X is related to HISTONE MARK Y for 1000 UP-REGULATED genes, what "controls" would you use for the comparison :</p>
  
  <p>-- 1000 RANDOM GENES (and multiple randomization tests)</p>
  
  <p>-- 1000 UP-REG GENES with NO PROTEIN X, NO HISTONE MARK Y</p>
  
  <p>-- 1000 UP-REG GENES with PROTEIN X, and NO HISTONE MARK Y</p>
  
  <p>-- 1000 UP-REG GENES with NO PROTEIN X, and with HISTONE MARK Y</p>
  
  <p>-- 1000 NOT-UP-REG GENES with NO PROTEIN X, NO HISTONE MARK Y</p>
  
  <p>-- 1000 NOT-UP-REG GENES with PROTEIN X, and NO HISTONE MARK Y</p>
  
  <p>-- 1000 NOT-UP-REG GENES with NO PROTEIN X, and with HISTONE MARK Y</p>
  
  <p>-- anything else ? </p>
  
  <p>any suggestions are very welcome. thanks a lot,</p>
  
  <p>bogdan</p>
  
  <p>ps : 've posted a similar question on BioC website : <a href="https://support.bioconductor.org/p/128828/" rel="nofollow noreferrer">https://support.bioconductor.org/p/128828/</a></p>
  
Tags: <phylogenetics><r><phylogeny>
Title: a package with randomization/permutation tests for genomic analyses
ThreadText: # a package with randomization/permutation tests for genomic analyses
  
  (Asked by: username_0 on 2020-03-05)
  
  please would you let me know, is there a package in R/python/C that has implemented **randomization/permutation tests for joint genomic analyses**
  
  (an example of joint genomic analyses -- when jointly considering both GENE EXPRESSION and PROTEIN BINDING along the DNA).
  
  The context of my question is the following :
  
  let's consider **1000 UP\_REGULATED genes with increased PROTEIN X and with a HISTONE MARK Y :**
  
  in order to show that PROTEIN X is related to HISTONE MARK Y for 1000 UP-REGULATED genes, what "controls" would you use for the comparison :
  
  -- 1000 RANDOM GENES (and multiple randomization tests)
  
  -- 1000 UP-REG GENES with NO PROTEIN X, NO HISTONE MARK Y
  
  -- 1000 UP-REG GENES with PROTEIN X, and NO HISTONE MARK Y
  
  -- 1000 UP-REG GENES with NO PROTEIN X, and with HISTONE MARK Y
  
  -- 1000 NOT-UP-REG GENES with NO PROTEIN X, NO HISTONE MARK Y
  
  -- 1000 NOT-UP-REG GENES with PROTEIN X, and NO HISTONE MARK Y
  
  -- 1000 NOT-UP-REG GENES with NO PROTEIN X, and with HISTONE MARK Y
  
  -- anything else ?
  
  any suggestions are very welcome. thanks a lot,
  
  username_0
  
  ps : 've posted a similar question on BioC website : <https://support.bioconductor.org/p/128828/>
  
  **Tags:** phylogenetics, r, phylogeny
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-03-06. Score: 1
  
  I would simply look at co-variance across the entire dataset and examine values >0.8 in the first instance rather than select 1000 genes.
  
  With your approach sampling 1000 genes can be criticised for selective sampling and the way to get around this is to perform replicates, with (bootstraps) or without replacement. You could produce e.g. 1000 replicates of 1000 genes and perform co-variance on each replicate to examine Y = X.
  
  Python has a specific permutation/combinations module call itertools, which is different to random resampling and doesn't need replicates
  
  ```
  from itertools import combinations
  X = [1,2,3]
  Y = [1,2,3]
  print (list(combinations(iterable, 1000) + X + Y))
  
  ```
  
  ---
  
  The standard way is to sample is,
  
  ```
  from random import sample 
  mygenes = [1, 2, 3, 4, 5]  
  
  print(sample(mygenes,3)) 
  
  ```
  
  **Output**
  
  ```
  [2, 4, 5]
  
  ```
  
  There is nuance and further funcationality ... I cannot remember is "sample" is with or without replacement (its quite a big deal)
  
  > **Comments:**
  > **username_0**: thanks a lot, Mike ! very helpful ! wondering if possible to recommend any package in R has the functions for bootstrapping, or similar functions as in itertools. thanks a lot !  
  > **username_1**: Hi @username_0, I don't use R so can't recommend anything.  
  
  ---
  
  