Skip to content

Commit

Permalink
table
Browse files Browse the repository at this point in the history
  • Loading branch information
pjotrp committed Jul 26, 2014
1 parent f26bc97 commit b089e83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sparql/extra/gwp/blast2.rq
Expand Up @@ -28,7 +28,7 @@
<% end %>
{

# :Mi_CDS_cluster00100_NP_001022867 :cluster :Mi_CDS_cluster00100 .
# :Mi_CDS_cluster00100_NP_001022867 gwp:cluster :Mi_CDS_cluster00100 .
# :Mi_CDS_cluster00100_NP_001022867 a :blast_match .
# :Mi_CDS_cluster00100_NP_001022867 rdf:label "Mi_CDS_cluster00100_NP_001022867" .
# :Mi_CDS_cluster00100_NP_001022867 :homolog_species "Ce" .
Expand Down
2 changes: 1 addition & 1 deletion sparql/extra/gwp/gen_table.sh
Expand Up @@ -14,4 +14,4 @@ for species in Bm Bx Ce Cb Gp Mi Mh Pi Pp Sr Ts ; do
./gen_table2.rb species=$species source=$source |egrep ^cat >> $fn
done
done
bio-table --merge tmp/* > table2.tsv
bio-table --merge tmp/*.tsv > table2.tsv
10 changes: 5 additions & 5 deletions sparql/extra/gwp/gen_table2.rb
Expand Up @@ -52,7 +52,7 @@
# Note that catH overlaps with catA and that catH is larger than all PSC(!)
catH = csv_parse.call("env HASH=\"by_cluster=1,species=#{species},source1=#{TYPE}\" ../../../scripts/sparql-csv.sh blast2.rq").drop(1).flatten
# ==== catH
assert(catH.size == 29,"Expect 29 was #{catH.size}") if do_assert
assert(catH.size == 36,"Expect 36 was #{catH.size}") if do_assert

# ---- 2b. Annotate plantP only (&)
# catH contains all ann PSC. So we can select those that
Expand Down Expand Up @@ -123,7 +123,7 @@

minc_cluster_plantp = ann.keys.select { |k| ann[k].include?(:plant_pathogen) }
p [:plantP, minc_cluster_plantp.size ]
assert(minc_cluster_plantp.size == 13) if do_assert
assert(minc_cluster_plantp.size == 9) if do_assert

# ---- 2c and 2d. Annotated in ann! (&)

Expand All @@ -140,16 +140,16 @@
# ==== we have catA orange and red!
otherA = catA - plant_pathogenA
p [:orange, otherA.size]
assert(otherA.size == 4,otherA.size.to_s) if do_assert
assert(otherA.size == 6,otherA.size.to_s) if do_assert

# ---- Now we can have the unique PSC (catC green) (&)
catC = all - catA - catH
p [:unique_PSC, catC.size]
assert(catC.size == 14,"Was #{catC.size}") if do_assert
assert(catC.size == 7,"Was #{catC.size}") if do_assert

assert(catA & catC == [],"There should be no overlap between catA and catC")
catB = all - catA - catC
assert(catB.size == 21,catB.size) if do_assert
assert(catB.size == 28,catB.size) if do_assert

# ---- Fetch conserved (catB)
p '** all **********************'
Expand Down

0 comments on commit b089e83

Please sign in to comment.