bio-gemma-wrapper 0.98 → 0.98.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +46 -2
  3. data/VERSION +1 -1
  4. data/bin/gemma-wrapper +8 -8
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8f36b92e82dda9e1e592724204521f9f4f1a950
4
- data.tar.gz: 077abf1c1a704ab93a27627d511aeba0dbf6b4c5
3
+ metadata.gz: b7a8bfe787236f397dba6e05aef202486ba53389
4
+ data.tar.gz: 9fe2398ed3fcd053e8258f73a64b1610bfddf9e2
5
5
  SHA512:
6
- metadata.gz: b49bb2c9362eb7babd2cf20f640fc7806719a8c82e31f93a97b4517d5c2777bd4ae55b9e5a1fd37df5f22e63e2673fa01ca4afbc4e07de6955391d77bd7f90fb
7
- data.tar.gz: 863ef847e4ddff6b544a733e001bcd2291c73ab394573a299d54a8f2581066fb423b40be052ce6a440c1daffbd6ddb7500c5f01b7ce2de0e38e4277c8ae9e53e
6
+ metadata.gz: 0a691906f13da3469597517d160874315f5962822b0273757d33c37283c2a9a98da9a41d08c51e4ed7854b3d3593f9d96ac81d59212690edd628a2677499d501
7
+ data.tar.gz: 5d4b898ff3566f52652cbb7db6597dc245e9a5da6b0d9da107de81deec0d51c02c822762e0ab921a2309c1dbc3455b55c1adc5fe94c891e31a9c32cb6d343f2e
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Gem Version](https://badge.fury.io/rb/bio-gemma-wrapper.svg)](https://badge.fury.io/rb/bio-gemma-wrapper)
1
+ [![gemma-wrapper gem version](https://badge.fury.io/rb/bio-gemma-wrapper.svg)](https://badge.fury.io/rb/bio-gemma-wrapper)
2
2
 
3
3
  # GEMMA wrapper caches K between runs with LOCO support
4
4
 
@@ -128,6 +128,23 @@ default. If you want something else provide a --cache-dir, e.g.
128
128
 
129
129
  will store K in ~/.gemma-cache.
130
130
 
131
+ ### GWA
132
+
133
+ Run the LMM using the K's captured in K.json using the --input
134
+ switch
135
+
136
+ gemma-wrapper --json --loco --input K.json -- \
137
+ -g test/data/input/BXD_geno.txt.gz \
138
+ -p test/data/input/BXD_pheno.txt \
139
+ -c test/data/input/BXD_covariates2.txt \
140
+ -a test/data/input/BXD_snps.txt \
141
+ -lmm 2 -maf 0.1 \
142
+ -debug > GWA.json
143
+
144
+ Running it twice should show that GWA is not recomputed.
145
+
146
+ /tmp/9e411810ad341de6456ce0c6efd4f973356d0bad.log.txt CACHE HIT!
147
+
131
148
  ### LOCO
132
149
 
133
150
  Recent versions of GEMMA have LOCO support for a single chromosome
@@ -163,6 +180,33 @@ GWA.json contains the file names of every chromosome
163
180
  The -k switch is injected automatically. Again output switches are not
164
181
  allowed (-o, -outdir)
165
182
 
183
+ ### Permutations
184
+
185
+ Permutations can be run with and without LOCO. First create K
186
+
187
+ gemma-wrapper --json -- \
188
+ -g test/data/input/BXD_geno.txt.gz \
189
+ -p test/data/input/BXD_pheno.txt \
190
+ -gk \
191
+ -debug > K.json
192
+
193
+ Next, using K.json, permute the phenotypes with something like
194
+
195
+ gemma-wrapper --json --loco --input K.json \
196
+ --permutate 100 --permute-phenotype test/data/input/BXD_pheno.txt -- \
197
+ -g test/data/input/BXD_geno.txt.gz \
198
+ -p test/data/input/BXD_pheno.txt \
199
+ -c test/data/input/BXD_covariates2.txt \
200
+ -a test/data/input/BXD_snps.txt \
201
+ -lmm 2 -maf 0.1 \
202
+ -debug > GWA.json
203
+
204
+ This should get the 95% significant and 67% suggestive thresholds:
205
+
206
+ ["95 percentile (significant) ", 2.015475e-05, 4.7]
207
+ ["67 percentile (suggestive) ", 2.015475e-05, 4.7]
208
+
209
+
166
210
  ## Copyright
167
211
 
168
- Copyright (c) 2017 Pjotr Prins. See [LICENSE.txt](LICENSE.txt) for further details.
212
+ Copyright (c) 2017,2018 Pjotr Prins. See [LICENSE.txt](LICENSE.txt) for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.98
1
+ 0.98.1
@@ -40,7 +40,7 @@ Gemma gets used from the path. You can override by setting
40
40
  env GEMMA_COMMAND=path/bin/gemma gemma-wrapper ...
41
41
 
42
42
  "
43
- # These are used for testing compatibility
43
+ # These are used for testing compatibility with the gemma tool
44
44
  GEMMA_V_MAJOR = 98
45
45
  GEMMA_V_MINOR = 0
46
46
 
@@ -213,15 +213,15 @@ raise "Expected GEMMA -g genotype file switch" if geno_idx == nil
213
213
  pheno_idx = gemma_args.index '-p'
214
214
  hashme =
215
215
  if DO_COMPUTE_KINSHIP and pheno_idx != nil
216
- p [pheno_idx,gemma_args[pheno_idx+2..-1]]
216
+ # Remove the phenotype file from the hash
217
217
  gemma_args[0..pheno_idx-1] + gemma_args[pheno_idx+2..-1]
218
218
  else
219
219
  gemma_args
220
220
  end
221
221
 
222
- if DO_COMPUTE_GWA
223
- raise "Did not expect GEMMA -p phenotype file switch" if pheno_idx
224
- hashme += ['-p', options[:permute_phenotypes]] if options[:permute_phenotypes]
222
+ if DO_COMPUTE_GWA and options[:permute_phenotypes]
223
+ raise "Did not expect GEMMA -p phenotype whith permutations (only use --permutate-phenotypes)" if pheno_idx
224
+ hashme += ['-p', options[:permute_phenotypes]]
225
225
  end
226
226
 
227
227
  require 'digest/sha1'
@@ -254,7 +254,7 @@ invoke_gemma = lambda do |extra_args, cache_hit = false|
254
254
  cmd="#{GEMMA_COMMAND} #{GEMMA_ARGS.join(' ')} #{extra_args.join(' ')}"
255
255
  record[:gemma_command] = cmd
256
256
  return if cache_hit
257
- # debug.call cmd
257
+ debug.call cmd
258
258
  errno =
259
259
  if options[:json]
260
260
  # capture output
@@ -350,7 +350,7 @@ else
350
350
  json_in = JSON.parse(File.read(options[:input]))
351
351
  raise "JSON problem, file #{options[:input]} is not -gk derived" if json_in["type"] != "K"
352
352
 
353
- pfn = options[:phenotypes] # can be nil
353
+ pfn = options[:permute_phenotypes] # can be nil
354
354
  k_files = json_in["files"].map { |rec| [rec[0],rec[2]] }
355
355
  k_files.each do | chr, kfn | # call a GWA for each chromosome
356
356
  gwas.call(chr,kfn,pfn)
@@ -358,7 +358,7 @@ else
358
358
  # Permute
359
359
  if options[:permutate]
360
360
  ps = []
361
- raise "You should supply --phenotype with gemma-wrapper --permutate" if not pfn
361
+ raise "You should supply --permute-phenotypes with gemma-wrapper --permutate" if not pfn
362
362
  File.foreach(pfn).with_index do |line, line_num|
363
363
  ps << line
364
364
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-gemma-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.98'
4
+ version: 0.98.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pjotr Prins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-19 00:00:00.000000000 Z
11
+ date: 2018-11-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: GEMMA wrapper adds LOCO and permutation support. Also caches K between
14
14
  runs with LOCO support