with open('brain_region_data.csv', 'rt') as brain_open: cell_IDs+= [r[3] for r in csv.reader(brain_open)][1:] with open('neuron_data_curated.csv', 'rt') as neuron_open: cell_IDs+= [r[3] for r in csv.reader(neuron_open)][1:] with open('lost_cat.csv', 'rt') as f: cell_IDs += [r[3] for r in csv.reader(f)][1:] #print(cell_IDs) n=len(cell_IDs) #print('We have',n,'IDs') #print('') Curie_Prefixes= v.getCuriePrefixes()[1:] Curie_Prefixes.append('nlx_only') print(Curie_Prefixes) for IDs in cell_IDs: for Prefixes in Curie_Prefixes: have=(Prefixes+':'+IDs) have=v.findById(have) if have!=None: #print(IDs) NIF_Directory[Prefixes].append(IDs) count=count+1 #print(count) break if have==None: NIF_Directory['nlx_only'].append(IDs)
with open('cell_layer_data.csv', 'rt') as cell_open: cell_IDs = [r[3] for r in csv.reader(cell_open)][1:] with open('brain_region_data.csv', 'rt') as brain_open: cell_IDs += [r[3] for r in csv.reader(brain_open)][1:] with open('neuron_data_curated.csv', 'rt') as neuron_open: cell_IDs += [r[3] for r in csv.reader(neuron_open)][1:] with open('lost_cat.csv', 'rt') as f: cell_IDs += [r[3] for r in csv.reader(f)][1:] #print(cell_IDs) n = len(cell_IDs) #print('We have',n,'IDs') #print('') Curie_Prefixes = v.getCuriePrefixes()[1:] Curie_Prefixes.append('nlx_only') print(Curie_Prefixes) for IDs in cell_IDs: for Prefixes in Curie_Prefixes: have = (Prefixes + ':' + IDs) have = v.findById(have) if have != None: #print(IDs) NIF_Directory[Prefixes].append(IDs) count = count + 1 #print(count) break if have == None: NIF_Directory['nlx_only'].append(IDs)
import json import csv import json from IPython import embed from collections import * from heatmaps.scigraph_client import Graph, Vocabulary from collected import data from rdflib import * import rdflib from rdflib.namespace import RDF g = Graph() v = Vocabulary() v.getCuriePrefixes() ''' .namespace to map long names .graph to make tuples ''' ns = Namespace person = ns( "http://ontology.neuinfo.org/NIF/Backend/BIRNLex_annotation_properties.owl#Bill_Bug" ) + ns( "http://ontology.neuinfo.org/NIF/Backend/BIRNLex_annotation_properties.owl#Bill_Bug" ) #print(person) rawInput = ns( "http://ontology.neuinfo.org/NIF/Backend/BIRNLex_annotation_properties.owl#raw_import" ) nueroNames = ns( "http://ontology.neuinfo.org/NIF/Backend/BIRNLex_annotation_properties.owl#NeuroNames_abbrevSource" )