Esempio n. 1
0
def get_tree_info(id_map):
	taxon_map = {}
	gene_seq_map = {}
	species_map = {}
	for label, seqid in id_map.iteritems():
		print >> sys.stderr, "processing ", label, seqid
		idp = miscParses.parsed_accID(seqid)
		# now we annotate it with (a) species name; (b) closest downstream gene description
		r = NCBI.get_acc_gb(idp.acc)
		species_name = r.annotations['organism']
		species_map[idp.acc] = species_name
		if idp.strand == +1:
			gene = NCBI.get_closest_downstream_gene(r, idp.end, idp.strand)
		else:
			gene = NCBI.get_closest_downstream_gene(r, idp.start, idp.strand)
		if gene is None:
			taxon_map[label] = 'Unknown'
			gene_seq_map[seqid] = None
			continue
		# TODO: put this into a phyloXML format!!
		# for now....let's just do normal newick
		gene_seq_map[seqid] = gene
		newname = label + '-' + species_name + '::' 
		if 'product' in gene.qualifiers:
			newname += gene.qualifiers['product'][0]
		elif 'note' in gene.qualifiers:
			newname += gene.qualifiers['note'][0]
		elif 'gene' in gene.qualifiers:
			newname += gene.qualifiers['gene']
		taxon_map[label] = newname
	return taxon_map, gene_seq_map, species_map
Esempio n. 2
0
def map_tree_taxon(tree_filename, id_map):
	taxon_map = {}
	gene_seq_map = {}
	t = dendropy.Tree.get_from_path(tree_filename, 'newick')
	for n in t.leaf_nodes():
		# n.taxon.label is like 'T1', id_map maps back to <acc>/<start>-<end>
		idp = miscParses.parsed_accID(id_map[n.taxon.label])
		# now we annotate it with (a) species name; (b) closest downstream gene description
		r = NCBI.get_acc_gb(idp.acc)
		species_name = r.annotations['organism']
		if idp.strand == +1:
			gene = NCBI.get_closest_downstream_gene(r, idp.end, idp.strand)
		else:
			gene = NCBI.get_closest_downstream_gene(r, idp.start, idp.strand)
		# TODO: put this into a phyloXML format!!
		# for now....let's just do normal newick
		gene_seq_map[n.taxon.label] = gene.qualifiers['translation']
		newname = n.taxon.label + '-' + species_name + '::' + gene.qualifiers['product'][0]
		taxon_map[n.taxon.label] = newname
		n.taxon.label = newname
	return t, taxon_map, gene_seq_map
Esempio n. 3
0
        print('6:Récupérer et afficher une entrée Prosite ')
        print(
            "7:Lancer un scan avec l'outil ScanProsite et afficher les motifs trouvés"
        )
        print('8:Traduire une signature Prosite en une expréssion Python')
        print('9:Vérifier si une signature existe dans une séquence')
        print(
            '10:Télécharger une entrée PDB puis afficher cette entrée ou non selon votre choix '
        )
        print("Q: Pour Quitter")
        choix = input("Entrez votre choix: ")
        if choix == '1':
            Lecture.Programme()

        elif choix == '2':
            NCBI.programme()

        elif choix == '3':
            Recuperer_SwissProt.programme()

        elif choix == '4':
            AlignementGlobLoc.programme()

        elif choix == '5':
            Fragmentation.programme()

        elif choix == '6':
            RecupererEntreeProsite.programme()

        elif choix == '7':
            ScanProsite.programme()