/tools/rgenetics/rgEigPCA.xml

https://bitbucket.org/cistrome/cistrome-harvard/ · XML · 167 lines · 127 code · 40 blank · 0 comment · 0 complexity · 1d590e22ba9f5a8855232dcf51fd7359 MD5 · raw file

  1. <tool id="rgEigPCA1" name="Eigensoft:">
  2. <description>PCA Ancestry using SNP</description>
  3. <command interpreter="python">
  4. rgEigPCA.py "$i.extra_files_path/$i.metadata.base_name" "$title" "$out_file1"
  5. "$out_file1.files_path" "$k" "$m" "$t" "$s" "$pca"
  6. </command>
  7. <inputs>
  8. <param name="i" type="data" label="Input genotype data file"
  9. size="120" format="ldindep" />
  10. <param name="title" type="text" value="Ancestry PCA" label="Title for outputs from this run"
  11. size="80" />
  12. <param name="k" type="integer" value="4" label="Number of principal components to output"
  13. size="3" />
  14. <param name="m" type="integer" value="0" label="Max. outlier removal iterations"
  15. help="To turn on outlier removal, set m=5 or so. Do this if you plan on adjusting any analyses"
  16. size="3" />
  17. <param name="t" type="integer" value="5" label="# principal components used for outlier removal"
  18. size="3" />
  19. <param name="s" type="integer" value="6" label="#SDs for outlier removal"
  20. help = "Any individual with SD along one of k top principal components > s will be removed as an outlier."
  21. size="3" />
  22. </inputs>
  23. <outputs>
  24. <data name="out_file1" format="html" label="${title}_rgEig.html"/>
  25. <data name="pca" format="txt" label="${title}_rgEig.txt"/>
  26. </outputs>
  27. <tests>
  28. <test>
  29. <param name='i' value='tinywga' ftype='ldindep' >
  30. <metadata name='base_name' value='tinywga' />
  31. <composite_data value='tinywga.bim' />
  32. <composite_data value='tinywga.bed' />
  33. <composite_data value='tinywga.fam' />
  34. <edit_attributes type='name' value='tinywga' />
  35. </param>
  36. <param name='title' value='rgEigPCAtest1' />
  37. <param name="k" value="4" />
  38. <param name="m" value="2" />
  39. <param name="t" value="2" />
  40. <param name="s" value="2" />
  41. <output name='out_file1' file='rgtestouts/rgEigPCA/rgEigPCAtest1.html' ftype='html' compare='diff' lines_diff='195'>
  42. <extra_files type="file" name='rgEigPCAtest1_PCAPlot.pdf' value="rgtestouts/rgEigPCA/rgEigPCAtest1_PCAPlot.pdf" compare="sim_size" delta="3000"/>
  43. </output>
  44. <output name='pca' file='rgtestouts/rgEigPCA/rgEigPCAtest1.txt' compare='diff'/>
  45. </test>
  46. </tests>
  47. <help>
  48. **Syntax**
  49. - **Genotype data** is an input genotype dataset in Plink lped (http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml) format. See below for notes
  50. - **Title** is used to name the output files so you can remember what the outputs are for
  51. - **Tuning parameters** are documented in the Eigensoft (http://genepath.med.harvard.edu/~reich/Software.htm) documentation - see below
  52. -----
  53. **Summary**
  54. Eigensoft requires ld-reduced genotype data.
  55. Galaxy has an automatic converter for genotype data in Plink linkage pedigree (lped) format.
  56. For details of this generic genotype format, please see the Plink documentation at
  57. http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml
  58. Reading that documentation, you'll see that the linkage pedigree format is really two related files with the same
  59. file base name - a map and ped file - eg 'mygeno.ped' and 'mygeno.map'.
  60. The map file has the chromosome, offset, genetic offset and snp name corresponding to each
  61. genotype stored as separate alleles in the ped file. The ped file has family id, individual id, father id (or 0), mother id
  62. (or 0), gender (1=male, 2=female, 0=unknown) and affection (1=unaffected, 2=affected, 0=unknown),
  63. then two separate allele columns for each genotype.
  64. Once you have your data in the right format, you can upload those into your Galaxy history using the "upload" tool.
  65. To upload your lped data in the upload tool, choose 'lped' as the 'file format'. The tool form will change to
  66. allow you to navigate to and select each member of the pair of ped and map files stored on your local computer
  67. (or available at a public URL for Galaxy to grab).
  68. Give the dataset a meaningful name (replace rgeneticsData with something more useful!) and click execute.
  69. When the upload is done, your new lped format dataset will appear in your history and then,
  70. when you choose the ancestry tool, that history dataset will be available as input.
  71. **Warning for the Impatient**
  72. When you execute the tool, it will look like it has not started running for a while as the automatic converter
  73. reduces the amount of LD - otherwise eigenstrat gives biased results.
  74. **Attribution**
  75. This tool runs and relies on the work of many others, including the
  76. maintainers of the Eigensoft program, and the R and
  77. Bioconductor projects. For full attribution, source code and documentation, please see
  78. http://genepath.med.harvard.edu/~reich/Software.htm, http://cran.r-project.org/
  79. and http://www.bioconductor.org/ respectively
  80. This implementation is a Galaxy tool wrapper around these third party applications.
  81. It was originally designed and written for family based data from the CAMP Illumina run of 2007 by
  82. ross lazarus (ross.lazarus@gmail.com) and incorporated into the rgenetics toolkit.
  83. copyright Ross Lazarus 2007
  84. Licensed under the terms of the LGPL as documented http://www.gnu.org/licenses/lgpl.html
  85. but is about as useful as a sponge boat without EIGENSOFT pca code.
  86. **README from eigensoft2 distribution at http://genepath.med.harvard.edu/~reich/Software.htm**
  87. [rerla@beast eigensoft2]$ cat README
  88. EIGENSOFT version 2.0, January 2008 (for Linux only)
  89. This is the same as our EIGENSOFT 2.0 BETA release with a few recent changes
  90. as described at http://genepath.med.harvard.edu/~reich/New_In_EIGENSOFT.htm.
  91. Features of EIGENSOFT version 2.0 include:
  92. -- Keeping track of ref/var alleles in all file formats: see CONVERTF/README
  93. -- Handling data sets up to 8 billion genotypes: see CONVERTF/README
  94. -- Output SNP weightings of each principal component: see POPGEN/README
  95. The EIGENSOFT package implements methods from the following 2 papers:
  96. Patterson N. et al. 2006 PLoS Genetics in press (population structure)
  97. Price A.L. et al. 2006 NG 38:904-9 (EIGENSTRAT stratification correction)
  98. See POPGEN/README for documentation of population structure programs.
  99. See EIGENSTRAT/README for documentation of EIGENSTRAT programs.
  100. See CONVERTF/README for documentation of programs for converting file formats.
  101. Executables and source code:
  102. ----------------------------
  103. All C executables are in the bin/ directory.
  104. We have placed source code for all C executables in the src/ directory,
  105. for users who wish to modify and recompile our programs. For example, to
  106. recompile the eigenstrat program, type
  107. "cd src"
  108. "make eigenstrat"
  109. "mv eigenstrat ../bin"
  110. Note that some of our software will only compile if your system has the
  111. lapack package installed. (This package is used to compute eigenvectors.)
  112. Some users may need to change "blas-3" to "blas" in the Makefile,
  113. depending on how blas and lapack are installed.
  114. If cc is not available on your system, try "cp Makefile.alt Makefile"
  115. and then recompile.
  116. If you have trouble compiling and running our code, try compiling and
  117. running the pcatoy program in the src directory:
  118. "cd src"
  119. "make pcatoy"
  120. "./pcatoy"
  121. If you are unable to run the pcatoy program successfully, please contact
  122. your system administrator for help, as this is a systems issue which is
  123. beyond our scope. Your system administrator will be able to troubleshoot
  124. your systems issue using this trivial program. [You can also try running
  125. the pcatoy program in the bin directory, which we have already compiled.]
  126. </help>
  127. </tool>