コード例 #1
0
# One-off script prepared to provide data to David Hibbett and Romina Gazis.
# Lists numbers of species in each fungal order.

from org.opentreeoflife.taxa import Taxonomy
import csv, sys
from taxonomies import load_fung, load_ncbi, load_gbif, load_irmng

taxonomies = [('fung', load_fung(), 'Index Fungorum'),
              ('ncbi', load_ncbi(), 'NCBI'),
              ('gbif', load_gbif(), 'GBIF'),
              ('irmng', load_irmng(), 'IRMNG'),
              ('ott', Taxonomy.getTaxonomy('tax/ott/'), 'OTT 2.9'),
          ]

def main():
    infile = open('order-counts-orders.csv', 'r')
    reader = csv.reader(infile)
    reader.next()   #header row
    taxa = ['Fungi']
    for tuple in reader:
        taxa.append(tuple[0])
    infile.close()

    write_counts(taxa)

def write_counts(taxa):
    outfile = open('order-counts.csv', 'w')
    writer = csv.writer(outfile)
    header = ['order']
    for (name, taxonomy, label) in taxonomies:
        header += [label + ' bin', label + ' sp', label + ' tip']
コード例 #2
0
# One-off script prepared to provide data to David Hibbett and Romina Gazis.
# Lists numbers of species in each fungal order.

from org.opentreeoflife.smasher import Taxonomy
import csv, sys
from taxonomies import load_fung, load_ncbi, load_gbif, load_irmng

taxonomies = [
    ("fung", load_fung(), "Index Fungorum"),
    ("ncbi", load_ncbi(), "NCBI"),
    ("gbif", load_gbif(), "GBIF"),
    ("irmng", load_irmng(), "IRMNG"),
    ("ott", Taxonomy.getTaxonomy("tax/ott/"), "OTT 2.9"),
]


def main():
    infile = open("order-counts-orders.csv", "r")
    reader = csv.reader(infile)
    reader.next()  # header row
    taxa = ["Fungi"]
    for tuple in reader:
        taxa.append(tuple[0])
    infile.close()

    write_counts(taxa)


def write_counts(taxa):
    outfile = open("order-counts.csv", "w")
    writer = csv.writer(outfile)
コード例 #3
0
# One-off script prepared to provide data to David Hibbett and Romina Gazis.
# Lists numbers of species in each fungal order.

from org.opentreeoflife.smasher import Taxonomy
import csv, sys
from taxonomies import load_fung, load_ncbi, load_gbif, load_irmng

taxonomies = [
    ('fung', load_fung(), 'Index Fungorum'),
    ('ncbi', load_ncbi(), 'NCBI'),
    ('gbif', load_gbif(), 'GBIF'),
    ('irmng', load_irmng(), 'IRMNG'),
    ('ott', Taxonomy.getTaxonomy('tax/ott/'), 'OTT 2.9'),
]


def main():
    infile = open('order-counts-orders.csv', 'r')
    reader = csv.reader(infile)
    reader.next()  #header row
    taxa = ['Fungi']
    for tuple in reader:
        taxa.append(tuple[0])
    infile.close()

    write_counts(taxa)


def write_counts(taxa):
    outfile = open('order-counts.csv', 'w')
    writer = csv.writer(outfile)
コード例 #4
0
def prepare_fungorum(ott):
    fungorum = taxonomies.load_fung()
    ott.addSource(fungorum)

    fungi_root = fungorum.taxon('Fungi')
    fungi = fungorum.select(fungi_root)
    fungi_root.trim()

    print "Fungi in Index Fungorum has %s nodes"%fungi.count()

    # *** Alignment to SILVA

    # 2014-03-07 Prevent a false match
    # https://groups.google.com/d/msg/opentreeoflife/5SAPDerun70/fRjA2M6z8tIJ
    # This is a fungus in Pezizomycotina
    # ### CHECK: was silva.taxon('Phaeosphaeria')
    # ott.notSame(ott.taxon('Phaeosphaeria', 'Rhizaria'), fungi.taxon('Phaeosphaeria', 'Ascomycota'))

    # 2014-04-08 This was causing Agaricaceae to be paraphyletic
    # ### CHECK: was silva.taxon('Morganella')
    # ott.notSame(ott.taxon('Morganella'), fungi.taxon('Morganella'))

    # 2014-04-08 More IF/SILVA bad matches
    # https://github.com/OpenTreeOfLife/reference-taxonomy/issues/63
    # The notSame directives are unnecessary if SAR is a division
    for name in ['Acantharia',     # in Venturiaceae < Fungi < Opisth. / Rhizaria < SAR
                 'Steinia',        # in Lecideaceae < Fungi / Alveolata / insect < Holozoa in irmng
                 'Epiphloea',      # in Pezizomycotina < Opisth. / Rhodophyta  should be OK, Rh. is a division
                 'Campanella',     # in Agaricomycotina < Nuclet. / SAR / Cnidaria
                 'Lacrymaria',     # in Agaricomycotina / SAR
                 #'Phialina',       # in Pezizomycotina   - not in fung
                 #'Frankia',        # in Pezizomycotina / Bacteria - not even in latest fung
                 'Bogoriella',     # in Verrucariaceae < Pezizomycotina < Euk. / Bogoriellaceae < Bacteria  should be ok
                 ]:
        # ### CHECK: was silva.taxon
        ott.notSame(ott.taxon(name), fungi.taxon(name, 'Fungi'))
    # Trichoderma harzianum, Sclerotinia homoeocarpa, Puccinia
    # triticina are removed from SILVA early
                 
    # 2014-04-25 JAR
    # There are three Bostrychias: a rhodophyte, a fungus, and a bird.
    # The fungus name is a synonym for Cytospora.
        # ### CHECK: was silva.taxon
    if fungi.maybeTaxon('Bostrychia', 'Ascomycota') != None:
        ott.notSame(ott.taxon('Bostrychia', 'Rhodophyceae'),
                    fungi.taxon('Bostrychia', 'Ascomycota'))

    # https://github.com/OpenTreeOfLife/reference-taxonomy/issues/20
    # Problem: Chlamydotomus is an incertae sedis child of Fungi.  Need to
    # find a good home for it.
    #
    # Mycobank says Chlamydotomus beigelii = Trichosporon beigelii:
    # http://www.mycobank.org/BioloMICS.aspx?Link=T&TableKey=14682616000000067&Rec=35058&Fields=All
    #
    # IF says the basionym is Pleurococcus beigelii, and P. beigelii's current name
    # is Geotrichum beigelii.  IF says the type for Trichosporon is Trichosporon beigelii,
    # and that T. beigelii's current name is Trichosporum beigelii... with no synonymies...
    # So IF does not corroborate Mycobank.
    #
    # So we could consider absorbing Chlamydotomus into Trichosoporon.  But...
    #
    # Not sure about this.  beigelii has a sister, cellaris, that should move along
    # with it, but the name Trichosporon cellaris has never been published.
    # Cb = ott.taxon('Chlamydotomus beigelii')
    # Cb.rename('Trichosporon beigelii')
    # ott.taxon('Trichosporon').take(Cb)
    #
    # Just make it incertae sedis and put off dealing with it until someone cares...

    # https://github.com/OpenTreeOfLife/reference-taxonomy/issues/79
        # ### CHECK: was silva.taxon
    ott.notSame(ott.taxon('Podocystis', 'Stramenopiles'), fungi.taxon('Podocystis', 'Fungi'))

    # https://github.com/OpenTreeOfLife/feedback/issues/45
    if False:
        ott.same(fungorum.maybeTaxon('Choanoflagellida'),
                 ott.maybeTaxon('Choanoflagellida', 'Opisthokonta'))

    # Create a homonym (the one in Fungi, not the same as the one in Alveolata)
    # so that the IF Ciliophora can map to it
    if ott.maybeTaxon('Ciliophora', 'Fungi') == None:
        cil = ott.newTaxon('Ciliophora', 'genus', 'if:7660')
        cil.setId('5343665')
        ott.taxon('Fungi').take(cil)
        cil.incertaeSedis()

    # Create a homonym (the one in Fungi, not the same as the one in Rhizaria)
    # so that the IF Phaeosphaeria can map to it
    if ott.maybeTaxon('Phaeosphaeria', 'Fungi') == None:
        cil = ott.newTaxon('Phaeosphaeria', 'genus', 'if:3951')
        cil.setId('5486272')
        ott.taxon('Fungi').take(cil)
        cil.incertaeSedis()

    return (fungi, fungorum)
コード例 #5
0
def prepare_fungorum(ott):
    fungorum = taxonomies.load_fung()
    fungorum.setTarget(ott)

    fungi_root = fungorum.taxon('Fungi')
    fungi = fungorum.select(fungi_root)
    fungi_root.trim()

    print "Fungi in Index Fungorum has %s nodes" % fungi.count()

    # *** Alignment to SILVA

    # 2014-03-07 Prevent a false match
    # https://groups.google.com/d/msg/opentreeoflife/5SAPDerun70/fRjA2M6z8tIJ
    # This is a fungus in Pezizomycotina
    # ### CHECK: was silva.taxon('Phaeosphaeria')
    # ott.notSame(ott.taxon('Phaeosphaeria', 'Rhizaria'), fungi.taxon('Phaeosphaeria', 'Ascomycota'))

    # 2014-04-08 This was causing Agaricaceae to be paraphyletic
    # ### CHECK: was silva.taxon('Morganella')
    # ott.notSame(ott.taxon('Morganella'), fungi.taxon('Morganella'))

    # 2014-04-08 More IF/SILVA bad matches
    # https://github.com/OpenTreeOfLife/reference-taxonomy/issues/63
    # The notSame directives are unnecessary if SAR is a division
    for name in [
            'Acantharia',  # in Venturiaceae < Fungi < Opisth. / Rhizaria < SAR
            'Steinia',  # in Lecideaceae < Fungi / Alveolata / insect < Holozoa in irmng
            'Epiphloea',  # in Pezizomycotina < Opisth. / Rhodophyta  should be OK, Rh. is a division
            'Campanella',  # in Agaricomycotina < Nuclet. / SAR / Cnidaria
            'Lacrymaria',  # in Agaricomycotina / SAR
            #'Phialina',       # in Pezizomycotina   - not in fung
            #'Frankia',        # in Pezizomycotina / Bacteria - not even in latest fung
            'Bogoriella',  # in Verrucariaceae < Pezizomycotina < Euk. / Bogoriellaceae < Bacteria  should be ok
    ]:
        # ### CHECK: was silva.taxon
        ott.notSame(ott.taxon(name), fungi.taxon(name, 'Fungi'))
    # Trichoderma harzianum, Sclerotinia homoeocarpa, Puccinia
    # triticina are removed from SILVA early

    # 2014-04-25 JAR
    # There are three Bostrychias: a rhodophyte, a fungus, and a bird.
    # The fungus name is a synonym for Cytospora.
    # ### CHECK: was silva.taxon
    if fungi.maybeTaxon('Bostrychia', 'Ascomycota') != None:
        ott.notSame(ott.taxon('Bostrychia', 'Rhodophyceae'),
                    fungi.taxon('Bostrychia', 'Ascomycota'))

    # https://github.com/OpenTreeOfLife/reference-taxonomy/issues/20
    # Problem: Chlamydotomus is an incertae sedis child of Fungi.  Need to
    # find a good home for it.
    #
    # Mycobank says Chlamydotomus beigelii = Trichosporon beigelii:
    # http://www.mycobank.org/BioloMICS.aspx?Link=T&TableKey=14682616000000067&Rec=35058&Fields=All
    #
    # IF says the basionym is Pleurococcus beigelii, and P. beigelii's current name
    # is Geotrichum beigelii.  IF says the type for Trichosporon is Trichosporon beigelii,
    # and that T. beigelii's current name is Trichosporum beigelii... with no synonymies...
    # So IF does not corroborate Mycobank.
    #
    # So we could consider absorbing Chlamydotomus into Trichosoporon.  But...
    #
    # Not sure about this.  beigelii has a sister, cellaris, that should move along
    # with it, but the name Trichosporon cellaris has never been published.
    # Cb = ott.taxon('Chlamydotomus beigelii')
    # Cb.rename('Trichosporon beigelii')
    # ott.taxon('Trichosporon').take(Cb)
    #
    # Just make it incertae sedis and put off dealing with it until someone cares...

    # https://github.com/OpenTreeOfLife/reference-taxonomy/issues/79
    # ### CHECK: was silva.taxon
    ott.notSame(ott.taxon('Podocystis', 'Stramenopiles'),
                fungi.taxon('Podocystis', 'Fungi'))

    # https://github.com/OpenTreeOfLife/feedback/issues/45
    if False:
        ott.same(fungorum.maybeTaxon('Choanoflagellida'),
                 ott.maybeTaxon('Choanoflagellida', 'Opisthokonta'))

    # Create a homonym (the one in Fungi, not the same as the one in Alveolata)
    # so that the IF Ciliophora can map to it
    if ott.maybeTaxon('Ciliophora', 'Fungi') == None:
        cil = ott.newTaxon('Ciliophora', 'genus', 'if:7660')
        cil.setId('5343665')
        ott.taxon('Fungi').take(cil)
        cil.incertaeSedis()

    # Create a homonym (the one in Fungi, not the same as the one in Rhizaria)
    # so that the IF Phaeosphaeria can map to it
    if ott.maybeTaxon('Phaeosphaeria', 'Fungi') == None:
        cil = ott.newTaxon('Phaeosphaeria', 'genus', 'if:3951')
        cil.setId('5486272')
        ott.taxon('Fungi').take(cil)
        cil.incertaeSedis()

    return (fungi, fungorum)