germ 0.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/lib/maf.rb +17 -0
  3. data/lib/mutation_set.rb +10 -1
  4. data/lib/seg.rb +21 -0
  5. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64855f9c2948d62bdb9852a39efdb04ed70c9628
4
- data.tar.gz: 9573d639fa846e9f6581221621b9adf4978895a7
3
+ metadata.gz: 3a4f41cd9269ca3dac6c2f6aed317103b8dee554
4
+ data.tar.gz: 19785403be3ea861ee1e22eda126555d342fc486
5
5
  SHA512:
6
- metadata.gz: d12a898d9e70a0554284e46d31ca51f0573b7a98abf1b4443f5b546ec45b3a790d4d35dc77bed97a3efd04365f3ddbc4e69698f31f3a71b16b57dc69b5aa4121
7
- data.tar.gz: 0bc1bceb1363b210e7b3190693571d16c4ece1bc749440ab629f20c6a9bd02dcafaf955b749ee2c5b2056cde22814abdaa9a59d80c7c701659f7390868d8eba2
6
+ metadata.gz: 77bb6c57b56ca7a7780f7c1691f5f0d99bb9dd6192ded7d49f9a8c92b45e8a73943fe7337e45b056e5302e41718341090b91c437a0b52ab198df5cc15e19bae4
7
+ data.tar.gz: c763e9bd0a52518b57367c477399f17d804d343ef4af639a30550bd30e66aecae374be0c6f8fe918dc5973b1d5dc45849ef235ab842dc75f60f1d7db0dc1e944
data/lib/maf.rb CHANGED
@@ -18,6 +18,23 @@ class Maf < Mutation::Collection
18
18
  :verification_status => :str, :validation_status => :str,
19
19
  :mutation_status => :str, :sequencing_phase => :str, :sequence_source => :str,
20
20
  :validation_method => :str, :score => :str
21
+
22
+ default_sleeve :hugo_symbol => :Hugo_Symbol, :entrez_gene_id => :Entrez_Gene_Id,
23
+ :center => :Center, :ncbi_build => :NCBI_Build,
24
+ :chromosome => :Chromosome, :start_position => :Start_Position,
25
+ :end_position => :End_Position, :strand => :Strand,
26
+ :variant_classification => :Variant_Classification, :variant_type => :Variant_Type,
27
+ :reference_allele => :Reference_Allele, :tumor_seq_allele1 => :Tumor_Seq_Allele1,
28
+ :tumor_seq_allele2 => :Tumor_Seq_Allele2, :dbsnp_rs => :dbSNP_RS,
29
+ :dbsnp_val_status => :dbSNP_Val_Status, :tumor_sample_barcode => :Tumor_Sample_Barcode,
30
+ :matched_norm_sample_barcode => :Matched_Norm_Sample_Barcode, :match_norm_seq_allele1 => :Match_Norm_Seq_Allele1,
31
+ :match_norm_seq_allele2 => :Match_Norm_Seq_Allele2, :tumor_validation_allele1 => :Tumor_Validation_Allele1,
32
+ :tumor_validation_allele2 => :Tumor_Validation_Allele2, :match_norm_validation_allele1 => :Match_Norm_Validation_Allele1,
33
+ :match_norm_validation_allele2 => :Match_Norm_Validation_Allele2, :verification_status => :Verification_Status,
34
+ :validation_status => :Validation_Status, :mutation_status => :Mutation_Status,
35
+ :sequencing_phase => :Sequencing_Phase, :sequence_source => :Sequence_Source,
36
+ :validation_method => :Validation_Method, :score => :Score
37
+
21
38
  might_have :tumor_var_freq => :float,
22
39
  :tumor_ref_count => :int, :t_ref_count => :int,
23
40
  :normal_ref_count => :int, :n_ref_count => :int,
@@ -107,6 +107,10 @@ class Mutation
107
107
  @optional = terms
108
108
  end
109
109
 
110
+ def default_sleeve sleeve=nil
111
+ @default_sleeve ||= sleeve
112
+ end
113
+
110
114
  def comments c
111
115
  @comment = c
112
116
  end
@@ -128,7 +132,7 @@ class Mutation
128
132
  # get types from required
129
133
  opts[:types] = types_from_required opts
130
134
  super obj, opts
131
- @header = required unless @header
135
+ default_header unless @header
132
136
  @mutation_config = YAML.load_file(opts[:mutation_config]) if opts[:mutation_config]
133
137
  end
134
138
 
@@ -139,6 +143,11 @@ class Mutation
139
143
  types.merge(opts[:types] || {})
140
144
  end
141
145
 
146
+ def default_header
147
+ @header = required
148
+ @sleeve = self.class.default_sleeve.clone
149
+ end
150
+
142
151
  def enforce_header
143
152
  create_sleeve
144
153
  raise "File lacks required headers: #{missing_required.join(", ")}" unless missing_required.empty?
@@ -0,0 +1,21 @@
1
+ require 'hash_table'
2
+ require 'genomic_locus'
3
+
4
+ class SegFile < HashTable
5
+ include IntervalList
6
+ def initialize obj=nil, opts={}
7
+ opts = opts.merge(:header => { :sample_name => :str, :chromosome => :str,
8
+ :start => :int, :stop => :int,
9
+ :num_probes => :int, :segment_mean => :float },
10
+ :skip_header => :true, :idx => :sample_name)
11
+ super obj, opts
12
+ end
13
+ class Segment < HashLine
14
+ include GenomicLocus
15
+ alias_key :seqname, :chromosome
16
+ def copy
17
+ self.class.new @hash.clone, @table
18
+ end
19
+ end
20
+ line_class Segment
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: germ
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saurabh Asthana
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-04 00:00:00.000000000 Z
11
+ date: 2014-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: extlib
@@ -63,6 +63,7 @@ files:
63
63
  - lib/oncotator.rb
64
64
  - lib/gtf/gene.rb
65
65
  - lib/sam.rb
66
+ - lib/seg.rb
66
67
  - lib/mutation.rb
67
68
  - lib/hash_table.rb
68
69
  - lib/genomic_locus.rb