Skip to content

Commit 838af76

Browse files
committed
hocomoco12 data
1 parent f7c0cbd commit 838af76

18 files changed

+5802
-16
lines changed

app/controllers/macroape/scans_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def query_matrix_examples
1414
helper_method :query_matrix_examples
1515

1616
def default_params
17-
common_options = { collection: :hocomoco_11_human,
17+
common_options = { collection: :hocomoco_12_core,
1818
background: BackgroundForm.uniform,
1919
query: DataModelForm.new(
2020
effective_count: 100, pseudocount: :log,

app/controllers/perfectosape/scans_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def default_params
1414
EOS
1515

1616
{ snp_list_text: test_snps,
17-
collection: :hocomoco_11_human,
17+
collection: :hocomoco_12_core,
1818
pvalue_cutoff: 0.0005,
1919
fold_change_cutoff: 4
2020
}

app/helpers/application_helper.rb

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ def collection_motif_image(collection_name, motif, orientation)
5454
end
5555

5656
def motif_info(collection_name, motif)
57-
if [:hocomoco_11_human, :hocomoco_11_mouse].include?(collection_name)
57+
if [:hocomoco_12_core, :hocomoco_12_rsnp, :hocomoco_12_invivo, :hocomoco_12_invitro].include?(collection_name)
58+
motif_url = "https://hocomoco12.autosome.org/motif/#{motif}"
59+
elsif [:hocomoco_11_human, :hocomoco_11_mouse].include?(collection_name)
5860
motif_url = "https://hocomoco11.autosome.org/motif/#{motif}"
5961
elsif [:hocomoco_10_human, :hocomoco_10_mouse].include?(collection_name)
6062
motif_url = "https://hocomoco10.autosome.org/motif/#{motif}"
6163
elsif collection_name == :hocomoco # v9
6264
infos = /^(?<model_base>.+)_(?<model_type>f1|f2|do|si)$/.match(motif)
63-
motif_url = "http://autosome.org/HOCOMOCO/modelDetails.php?tf=#{infos[:model_base]}&model=#{infos[:model_type]}"
65+
motif_url = "https://autosome.org/HOCOMOCO/modelDetails.php?tf=#{infos[:model_base]}&model=#{infos[:model_type]}"
6466
else
6567
motif_url = nil
6668
end
@@ -82,10 +84,28 @@ def uniprot_mapping
8284
end
8385
end
8486

87+
def annotation_by_h12_collection(collection_name)
88+
@cache_annotation_by_collection ||= {}
89+
@cache_annotation_by_collection[collection_name] ||= begin
90+
collection_suffix = collection_name.split('_').last.upcase
91+
annotation_fn = Rails.root.join("public/motif_collection/H12#{collection_suffix}_annotation.jsonl")
92+
File.readlines(annotation_fn).map{|l|
93+
JSON.parse(l)
94+
}.group_by{|d|
95+
d['name']
96+
}.transform_values{|grp|
97+
raise unless grp.size == 1
98+
grp.first
99+
}
100+
end
101+
end
102+
85103
def uniprot_links(collection_name, motif)
86104
if [:hocomoco_11_human, :hocomoco_11_mouse, :hocomoco_10_human, :hocomoco_10_mouse].include?(collection_name)
87105
uniprot_name = motif[/^(?<uniprot>.+_HUMAN|.+_MOUSE)\..*/, :uniprot]
88106
return uniprot_link("#{uniprot_name}", uniprot_name)
107+
elsif [:hocomoco_12_core, :hocomoco_12_rsnp, :hocomoco_12_invivo, :hocomoco_12_invitro].include?(collection_name)
108+
uniprot_name = annotation_by_h12_collection(collection_name)[motif][:uniprot_id_human]
89109
end
90110
motif_id = motif.split.first # names in uniprot mapping aren't complete names but just first parts (e.g. `MA0512.1` for `MA0512.1 Rxra`)
91111
uniprot_names = uniprot_mapping[collection_name.to_sym][motif_id]
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
class MotifCollectionSelectorInput < SelectorFromEnumInput
2-
variants [:hocomoco_11_human, :hocomoco_11_mouse, :jaspar, :selex, :swissregulon, :homer]
2+
variants [
3+
:hocomoco_12_core, :hocomoco_12_rsnp, :hocomoco_12_invivo, :hocomoco_12_invitro,
4+
:hocomoco_11_human, :hocomoco_11_mouse, :jaspar, :selex, :swissregulon, :homer
5+
]
36
i18n_scope 'enumerize.collection'
47
end

app/validators/motif_collection_validator.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
class MotifCollectionValidator < ActiveModel::Validations::InclusionValidator
2-
VARIANTS = [:hocomoco_11_human, :hocomoco_11_mouse, :jaspar, :selex, :swissregulon, :homer]
2+
VARIANTS = [
3+
:hocomoco_12_core, :hocomoco_12_rsnp, :hocomoco_12_invivo, :hocomoco_12_invitro,
4+
:hocomoco_11_human, :hocomoco_11_mouse, :jaspar, :selex, :swissregulon, :homer
5+
]
36
def delimiter
47
VARIANTS
58
end

config/locales/en.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ en:
6868
hocomoco_10_mouse: 'HOCOMOCO-10 (mouse)'
6969
hocomoco_11_human: 'HOCOMOCO-11 (human)'
7070
hocomoco_11_mouse: 'HOCOMOCO-11 (mouse)'
71+
hocomoco_12_core: 'HOCOMOCO-12 (H12CORE)'
72+
hocomoco_12_rsnp: 'HOCOMOCO-12 (H12RSNP)'
73+
hocomoco_12_invivo: 'HOCOMOCO-12 (H12INVIVO)'
74+
hocomoco_12_invitro: 'HOCOMOCO-12 (H12INVITRO)'
7175
jaspar: 'JASPAR'
7276
selex: 'HT-SELEX'
7377
swissregulon: 'SwissRegulon'
@@ -145,23 +149,23 @@ en:
145149
collection: |
146150
Collection of transcription factor binding site models (motifs).
147151
Available collections:
148-
<a href="http://hocomoco.autosome.org/">HOCOMOCO</a>,
149-
<a href="http://jaspar.genereg.net/">JASPAR</a>,
150-
<a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2877582/">HT-SELEX</a>,
151-
<a href="http://swissregulon.unibas.ch/fcgi/sr">SwissRegulon</a>,
152-
and <a href="http://homer.salk.edu/homer/motif/motifDatabase.html">HOMER</a>.
152+
<a href="https://hocomoco.autosome.org/">HOCOMOCO</a>,
153+
<a href="https://jaspar.uio.no/">JASPAR</a>,
154+
<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2877582/">HT-SELEX</a>,
155+
<a href="https://swissregulon.unibas.ch/">SwissRegulon</a>,
156+
and <a href="http://homer.ucsd.edu/homer/motif/motifDatabase.html">HOMER</a>.
153157
pvalue_cutoff: "P-value cutoff to treat a DNA subsequence as a TF binding site."
154158
fold_change_cutoff: "Minimal P-value fold change."
155159
Macroape:
156160
ScanForm:
157161
collection: |
158162
Collection of transcription factor binding site motifs to scan.
159163
Available collections:
160-
<a href="http://autosome.org/HOCOMOCO/">HOCOMOCO</a>,
161-
<a href="http://jaspar.genereg.net/">JASPAR</a>,
162-
<a href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2877582/">HT-SELEX</a>,
163-
<a href="http://swissregulon.unibas.ch/fcgi/sr">SwissRegulon</a>,
164-
and <a href="http://homer.salk.edu/homer/motif/motifDatabase.html">HOMER</a>.
164+
<a href="https://hocomoco.autosome.org/">HOCOMOCO</a>,
165+
<a href="https://jaspar.uio.no/">JASPAR</a>,
166+
<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2877582/">HT-SELEX</a>,
167+
<a href="https://swissregulon.unibas.ch/">SwissRegulon</a>,
168+
and <a href="http://homer.ucsd.edu/homer/motif/motifDatabase.html">HOMER</a>.
165169
pvalue: 'P-value level to select the motif thresholds.'
166170
pvalue_boundary: 'Upper boundary (default) means that the obtained P-value is greater than or equal to the requested P-value.'
167171
similarity_cutoff: 'Minimal similarity to report.'

public/motif_collection/H12CORE_annotation.jsonl

Lines changed: 1443 additions & 0 deletions
Large diffs are not rendered by default.
222 KB
Binary file not shown.
758 KB
Binary file not shown.

0 commit comments

Comments
 (0)