Skip to content
Snippets Groups Projects
Commit 0535c112 authored by Robert Bossy's avatar Robert Bossy
Browse files

select taxa by id list or by id path

parent 70ba0d73
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ rule all:
config['OUTDIR'] + '/taxa+id_microorganisms.trie',
config['OUTDIR'] + '/taxid_full.txt',
config['OUTDIR'] + '/taxa+id_full.txt',
config['OUTDIR'] + '/taxa+id_full.trie'
config['OUTDIR'] + '/taxa+id_full.trie',
config['OUTDIR'] + '/microorganisms-roots-paths.txt'
rule check:
......@@ -24,6 +25,17 @@ rule check:
'''{config[ALVISNLP]} -J-Xmx24G -alias taxo {input} -alias trie {output} compile-taxonomy.plan'''
rule root_paths:
output:
config['OUTDIR'] + '/microorganisms-roots-paths.txt'
input:
'microorganisms-roots.txt'
shell:
'''cut -f 5 {input} | sed -e '1d' -e '/^$/d' -e 's,$,/,' >{output}'''
rule microorganisms:
output:
config['OUTDIR'] + '/{p}_microorganisms.txt'
......
<alvisnlp-plan id="select-taxa">
<param name="list">
<alias module="taxids" param="mappingFile"/>
<alias module="tag.taxids" param="mappingFile"/>
<alias module="tag.taxroots" param="mappingFile"/>
</param>
<param name="name">
<alias module="name" param="featureValue"/>
<alias module="overlaps" param="layerName"/>
</param>
<param name="column">
<alias module="tag.taxids" param="keyColumn"/>
<alias module="tag.taxroots" param="keyColumn"/>
</param>
<param name="mode">
<alias module="tag" param="select"/>
</param>
<name class="SetFeature">
......@@ -14,12 +23,23 @@
<featureName>select-taxa-name</featureName>
</name>
<taxids class="FileMapper">
<target>documents.sections.layer:taxa</target>
<form>@taxid</form>
<targetFeatures>selected-taxa</targetFeatures>
</taxids>
<tag>
<select>taxids</select>
<taxids class="FileMapper">
<target>documents.sections.layer:taxa</target>
<form>@taxid</form>
<targetFeatures>selected-taxa</targetFeatures>
</taxids>
<taxroots class="FileMapper">
<target>documents.sections.layer:taxa</target>
<form>@path ^ "/"</form>
<operator>prefix</operator>
<targetFeatures>selected-taxa</targetFeatures>
</taxroots>
</tag>
<layer class="Action">
<target>documents.sections.layer:taxa[@selected-taxa]</target>
<action>
......@@ -30,6 +50,4 @@
<addToLayer/>
<setFeatures/>
</layer>
<ovrelaps class="RemoveOverlaps"/>
</alvisnlp-plan>
......@@ -9,8 +9,14 @@
<compiledDict>output/taxa+id_full.trie</compiledDict>
</ner-taxa>
<select-microorganisms href="select-taxa.plan">
<select-microorganisms-taxids href="select-taxa.plan">
<list>output/taxid_microorganisms.txt</list>
<name>microorganisms</name>
</select-microorganisms>
<name>microorganisms-taxids</name>
</select-microorganisms-taxids>
<select-microorganisms-taxroots href="select-taxa.plan">
<list>output/microorganisms-roots-paths.txt</list>
<name>microorganisms-taxroots</name>
<mode>taxroots</mode>
</select-microorganisms-taxroots>
</alvisnlp-plan>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment