Skip to content

Commit

Permalink
Fix reference logic in variant submission script
Browse files Browse the repository at this point in the history
  • Loading branch information
markquintontulloch committed Jan 15, 2025
1 parent b6983be commit 5923178
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
15 changes: 7 additions & 8 deletions scripts/AGR/agr_variations.def
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,26 @@ From 1
Tag Reference

Colonne 3
Width 12
Optional
Hidden
Width 12
Optional
Hidden
Show_Tag
From 2
Tag Database
Condition MEDLINE
Tag Database

Colonne 4
Width 12
Optional
Hidden
Visible
Class
Class Text
Right_of 3
Tag HERE
Tag HERE

Colonne 5
Width 12
Optional
Hidden
Visible
Class
Class Text
Right_of 4
Expand Down
32 changes: 17 additions & 15 deletions scripts/AGR/make_agr_variations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,23 @@ def execute_wquery(query,wquery,outfile='/tmp/tablemaker.outfile')
def parse_output(outfile)
results=Hash.new
File.open(outfile).each{|line|
line.chomp!
line.gsub!('"','')
c = line.split("\t")
if !results[c[0]]
results[c[0]]=Hash.new # WBVarXXX
results[c[0]]["name"] = c[0] # WBVarXXX
end
if !c[1].empty?
results[c[0]]["paper"]||=Hash.new # WBPaperXXX
results[c[0]]["paper"][c[1]] = (c[2].nil? or c[2].empty?) ? 'n/a' : c[2] # PubmedID
end
if c[3]
results[c[0]][:strains]||=[] # WBStrains
results[c[0]][:strains].push(c[3]) # adds WBStrainId
end
line.chomp!
line.gsub!('"','')
if !line["Europe_PMC"]
c = line.split("\t")
if !results[c[0]]
results[c[0]]=Hash.new # WBVarXXX
results[c[0]]["name"] = c[0] # WBVarXXX
end
if !c[1].empty?
results[c[0]]["paper"]||=Hash.new # WBPaperXXX
results[c[0]]["paper"][c[1]] = (c[4].nil? or c[4].empty?) ? 'n/a' : c[4] # PubmedID
end
if c[5]
results[c[0]][:strains]||=[] # WBStrains
results[c[0]][:strains].push(c[5]) # adds WBStrainId
end
end
}
# File.unlink(outfile)
return results
Expand Down

0 comments on commit 5923178

Please sign in to comment.