<commit_before>// BridgeDb,
// An abstraction layer for identifer mapping services, both local and online.
// Copyright 2006-2009 BridgeDb developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package org.bridgedb.bio;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

import org.bridgedb.DataSource;
import org.bridgedb.DataSourcePatterns;

/**
 * Definition of many common biological DataSources.
 * Meta data about these Data Sources, such as URL templates,
 * are read from a bundled text file. Call the init() method
 * at the start of your program to initialize all meta data.  
 */
public class BioDataSource 
{
	public static final DataSource TAIR = DataSource.register (
		 "A", "TAIR").asDataSource();
	public static final DataSource AGILENT = DataSource.register (
		"Ag", "Agilent").asDataSource();
	public static final DataSource BIOGRID = DataSource.register (
		"Bg", "BioGrid").asDataSource();
	public static final DataSource CINT = DataSource.register (
		"C", "Cint").asDataSource();
	public static final DataSource CCDS = DataSource.register (
		"Cc", "CCDS").asDataSource();
	public static final DataSource CAS = DataSource.register (
		"Ca", "CAS").asDataSource();
	public static final DataSource CHEBI = DataSource.register (
		"Ce", "ChEBI").asDataSource();
	public static final DataSource HMDB = DataSource.register (
		"Ch", "HMDB").asDataSource();
	public static final DataSource KEGG_COMPOUND = DataSource.register (
		"Ck", "Kegg Compound").asDataSource();
	public static final DataSource PUBCHEM = DataSource.register (
		"Cp", "PubChem").asDataSource();
	public static final DataSource CHEMSPIDER = DataSource.register (
		"Cs", "Chemspider").asDataSource();
	public static final DataSource SGD = DataSource.register (
		"D", "SGD").asDataSource();
	public static final DataSource ENZYME_CODE = DataSource.register (
		"E", "EC Number").asDataSource();
	public static final DataSource ECOLI = DataSource.register (
		"Ec", "Ecoli").asDataSource();
	public static final DataSource EMBL = DataSource.register (
		"Em", "EMBL").asDataSource();
	/** @deprecated use one of the organism-specific system codes instead */ 
	public static final DataSource ENSEMBL = DataSource.register (
		"En", "Ensembl").asDataSource();
	public static final DataSource ENSEMBL_MOSQUITO = DataSource.register (
		"EnAg", "Ensembl Mosquito").asDataSource();
	public static final DataSource GRAMENE_ARABIDOPSIS = DataSource.register (
		"EnAt", "Gramene Arabidopsis").asDataSource();
	public static final DataSource ENSEMBL_BSUBTILIS = DataSource.register (
		"EnBs", "Ensembl B. subtilis").asDataSource();
	public static final DataSource ENSEMBL_COW = DataSource.register (
		"EnBt", "Ensembl Cow").asDataSource();
	public static final DataSource ENSEMBL_CELEGANS = DataSource.register (
		"EnCe", "Ensembl C. elegans").asDataSource();
	public static final DataSource ENSEMBL_DOG = DataSource.register (
		"EnCf", "Ensembl Dog").asDataSource();
	public static final DataSource ENSEMBL_FRUITFLY = DataSource.register (
		"EnDm", "Ensembl Fruitfly").asDataSource();
	public static final DataSource ENSEMBL_ZEBRAFISH = DataSource.register (
		"EnDr", "Ensembl Zebrafish").asDataSource();
	public static final DataSource ENSEMBL_ECOLI = DataSource.register (
		"EnEc", "Ensembl E. coli").asDataSource();
	public static final DataSource ENSEMBL_CHICKEN = DataSource.register (
		"EnGg", "Ensembl Chicken").asDataSource(); 
	public static final DataSource ENSEMBL_HUMAN = DataSource.register (
		"EnHs", "Ensembl Human").asDataSource();
	public static final DataSource ENSEMBL_MOUSE = DataSource.register (
		"EnMm", "Ensembl Mouse").asDataSource();
	public static final DataSource GRAMENE_RICE = DataSource.register (
		"EnOj", "Gramene Rice").asDataSource();
	public static final DataSource ENSEMBL_CHIMP = DataSource.register (
		"EnPt", "Ensembl Chimp").asDataSource();
	public static final DataSource ENSEMBL_HORSE = DataSource.register (
		"EnQc", "Ensembl Horse").asDataSource();
	public static final DataSource ENSEMBL_RAT = DataSource.register (
		"EnRn", "Ensembl Rat").asDataSource();
	public static final DataSource ENSEMBL_SCEREVISIAE = DataSource.register (
		"EnSc", "Ensembl Yeast").asDataSource();
	public static final DataSource ENSEMBL_XENOPUS = DataSource.register (
		"EnXt", "Ensembl Xenopus").asDataSource();
	public static final DataSource FLYBASE = DataSource.register (
		"F", "FlyBase").asDataSource();
	public static final DataSource GENBANK = DataSource.register (
		"G", "GenBank").asDataSource(); 
	public static final DataSource CODELINK = DataSource.register (
		"Ge", "CodeLink").asDataSource(); 
	public static final DataSource GRAMENE_GENES_DB = DataSource.register (
		"Gg", "Gramene Genes DB").asDataSource(); 
	public static final DataSource GRAMENE_LITERATURE = DataSource.register (
		"Gl", "Gramene Literature").asDataSource();
	public static final DataSource GRAMENE_PATHWAY = DataSource.register (
		"Gp", "Gramene Pathway").asDataSource();
	public static final DataSource GEN_PEPT = DataSource.register (
		"Gp", "GenPept").asDataSource(); 
	public static final DataSource HUGO = DataSource.register (
		"H", "HUGO").asDataSource();
	public static final DataSource HSGENE = DataSource.register (
		"Hs", "HsGene").asDataSource();
	public static final DataSource INTERPRO = DataSource.register (
		"I", "InterPro").asDataSource();
	public static final DataSource ILLUMINA = DataSource.register (
		"Il", "Illumina").asDataSource(); 
	public static final DataSource IPI = DataSource.register (
		"Ip", "IPI").asDataSource(); 
	public static final DataSource IRGSP_GENE = DataSource.register (
		"Ir", "IRGSP Gene").asDataSource();
	public static final DataSource ENTREZ_GENE = DataSource.register (
		"L", "Entrez Gene").asDataSource();
	public static final DataSource MGI = DataSource.register (
		"M", "MGI").asDataSource();
	public static final DataSource MIRBASE = DataSource.register (
		"Mb", "miRBase").asDataSource();
	public static final DataSource MAIZE_GDB = DataSource.register (
		"Mg", "MaizeGDB").asDataSource();
	public static final DataSource NASC_GENE = DataSource.register (
		"N", "NASC Gene").asDataSource(); 
	public static final DataSource NUGOWIKI = DataSource.register (
		"Nw", "NuGO wiki").asDataSource();
	public static final DataSource OTHER = DataSource.register (
		"O", "Other").asDataSource();
	public static final DataSource ORYZA_BASE = DataSource.register (
		"Ob", "Oryzabase").asDataSource();
	public static final DataSource OMIM = DataSource.register (
		"Om", "OMIM").asDataSource();
	public static final DataSource RICE_ENSEMBL_GENE = DataSource.register (
		"Os", "Rice Ensembl Gene").asDataSource();
	public static final DataSource PDB = DataSource.register (
		"Pd", "PDB").asDataSource();
	public static final DataSource PFAM = DataSource.register (
		"Pf", "Pfam").asDataSource();
	public static final DataSource PLANTGDB = DataSource.register (
		"Pl", "PlantGDB").asDataSource(); 
	public static final DataSource REFSEQ = DataSource.register (
		"Q", "RefSeq").asDataSource();
	public static final DataSource RGD = DataSource.register (
		"R", "RGD").asDataSource(); 
	public static final DataSource RFAM = DataSource.register (
		"Rf", "Rfam").asDataSource();
	public static final DataSource UNIPROT = DataSource.register (
		"S", "Uniprot/TrEMBL").asDataSource();
	public static final DataSource SNP = DataSource.register (
		"Sn", "dbSNP").asDataSource();
	public static final DataSource SYMBOL = DataSource.register (
		"Sym", "Symbol").asDataSource();
	public static final DataSource GENE_ONTOLOGY = DataSource.register (
		"T", "GeneOntology").asDataSource();
        public static final DataSource GOSLIM_CC = DataSource.register (
                "Tc", "GOSlimCC").asDataSource();
        public static final DataSource GOSlim_BP = DataSource.register (
                "Tb", "GOSlimBP").asDataSource();
        public static final DataSource GOSLIM_MF = DataSource.register (
                "Tm", "GOSlimMF").asDataSource();
	public static final DataSource TIGR = DataSource.register (
		"Ti", "TIGR").asDataSource(); 
	public static final DataSource UNIGENE = DataSource.register (
		"U", "UniGene").asDataSource();
	public static final DataSource UCSC = DataSource.register (
		"Uc", "UCSC Genome Browser").asDataSource();
	public static final DataSource WORMBASE = DataSource.register (
		"W", "WormBase").asDataSource();
        public static final DataSource WIKIGENE = DataSource.register (
                "Wg", "WikiGene").asDataSource();
	public static final DataSource WIKIPEDIA = DataSource.register (
		"Wi", "Wikipedia").asDataSource();
	public static final DataSource WHEAT_GENE_CATALOG = DataSource.register (
		"Wc", "Wheat gene catalog").asDataSource(); 
	public static final DataSource WHEAT_GENE_NAMES = DataSource.register (
		"Wn", "Wheat gene names").asDataSource();
	public static final DataSource WHEAT_GENE_REFERENCES= DataSource.register (
		"Wr", "Wheat gene refs").asDataSource();
	public static final DataSource AFFY = DataSource.register (
		"X", "Affy").asDataSource();
	public static final DataSource ZFIN = DataSource.register (
		"Z", "ZFIN").asDataSource();

	/* 
	 * Make patterns of regular expressions for matching 
	 * the gene identifiers with specific gene databases.
	 * (see, 
	 * http://www.childrens-mercy.org/stats/model/arrayDataManagement.htm ) 
	 */	
	private static final Map<Organism, DataSource> ensemblBySpecies = new HashMap<Organism, DataSource>();

	static {
		DataSourcePatterns.registerPattern(<commit_msg>removing temp fixes from repo<commit_after>// BridgeDb,
// An abstraction layer for identifer mapping services, both local and online.
// Copyright 2006-2009 BridgeDb developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package org.bridgedb.bio;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

import org.bridgedb.DataSource;
import org.bridgedb.DataSourcePatterns;

/**
 * Definition of many common biological DataSources.
 * Meta data about these Data Sources, such as URL templates,
 * are read from a bundled text file. Call the init() method
 * at the start of your program to initialize all meta data.  
 */
public class BioDataSource 
{
	public static final DataSource TAIR = DataSource.register (
		 "A", "TAIR").asDataSource();
	public static final DataSource AGILENT = DataSource.register (
		"Ag", "Agilent").asDataSource();
	public static final DataSource BIOGRID = DataSource.register (
		"Bg", "BioGrid").asDataSource();
	public static final DataSource CINT = DataSource.register (
		"C", "Cint").asDataSource();
	public static final DataSource CCDS = DataSource.register (
		"Cc", "CCDS").asDataSource();
	public static final DataSource CAS = DataSource.register (
		"Ca", "CAS").asDataSource();
	public static final DataSource CHEBI = DataSource.register (
		"Ce", "ChEBI").asDataSource();
	public static final DataSource HMDB = DataSource.register (
		"Ch", "HMDB").asDataSource();
	public static final DataSource KEGG_COMPOUND = DataSource.register (
		"Ck", "Kegg Compound").asDataSource();
	public static final DataSource PUBCHEM = DataSource.register (
		"Cp", "PubChem").asDataSource();
	public static final DataSource CHEMSPIDER = DataSource.register (
		"Cs", "Chemspider").asDataSource();
	public static final DataSource SGD = DataSource.register (
		"D", "SGD").asDataSource();
	public static final DataSource ENZYME_CODE = DataSource.register (
		"E", "EC Number").asDataSource();
	public static final DataSource ECOLI = DataSource.register (
		"Ec", "Ecoli").asDataSource();
	public static final DataSource EMBL = DataSource.register (
		"Em", "EMBL").asDataSource();
	/** @deprecated use one of the organism-specific system codes instead */ 
	public static final DataSource ENSEMBL = DataSource.register (
		"En", "Ensembl").asDataSource();
	public static final DataSource ENSEMBL_MOSQUITO = DataSource.register (
		"EnAg", "Ensembl Mosquito").asDataSource();
	public static final DataSource GRAMENE_ARABIDOPSIS = DataSource.register (
		"EnAt", "Gramene Arabidopsis").asDataSource();
	public static final DataSource ENSEMBL_BSUBTILIS = DataSource.register (
		"EnBs", "Ensembl B. subtilis").asDataSource();
	public static final DataSource ENSEMBL_COW = DataSource.register (
		"EnBt", "Ensembl Cow").asDataSource();
	public static final DataSource ENSEMBL_CELEGANS = DataSource.register (
		"EnCe", "Ensembl C. elegans").asDataSource();
	public static final DataSource ENSEMBL_DOG = DataSource.register (
		"EnCf", "Ensembl Dog").asDataSource();
	public static final DataSource ENSEMBL_FRUITFLY = DataSource.register (
		"EnDm", "Ensembl Fruitfly").asDataSource();
	public static final DataSource ENSEMBL_ZEBRAFISH = DataSource.register (
		"EnDr", "Ensembl Zebrafish").asDataSource();
	public static final DataSource ENSEMBL_ECOLI = DataSource.register (
		"EnEc", "Ensembl E. coli").asDataSource();
	public static final DataSource ENSEMBL_CHICKEN = DataSource.register (
		"EnGg", "Ensembl Chicken").asDataSource(); 
	public static final DataSource ENSEMBL_HUMAN = DataSource.register (
		"EnHs", "Ensembl Human").asDataSource();
	public static final DataSource ENSEMBL_MOUSE = DataSource.register (
		"EnMm", "Ensembl Mouse").asDataSource();
	public static final DataSource GRAMENE_RICE = DataSource.register (
		"EnOj", "Gramene Rice").asDataSource();
	public static final DataSource ENSEMBL_CHIMP = DataSource.register (
		"EnPt", "Ensembl Chimp").asDataSource();
	public static final DataSource ENSEMBL_HORSE = DataSource.register (
		"EnQc", "Ensembl Horse").asDataSource();
	public static final DataSource ENSEMBL_RAT = DataSource.register (
		"EnRn", "Ensembl Rat").asDataSource();
	public static final DataSource ENSEMBL_SCEREVISIAE = DataSource.register (
		"EnSc", "Ensembl Yeast").asDataSource();
	public static final DataSource ENSEMBL_XENOPUS = DataSource.register (
		"EnXt", "Ensembl Xenopus").asDataSource();
	public static final DataSource FLYBASE = DataSource.register (
		"F", "FlyBase").asDataSource();
	public static final DataSource GENBANK = DataSource.register (
		"G", "GenBank").asDataSource(); 
	public static final DataSource CODELINK = DataSource.register (
		"Ge", "CodeLink").asDataSource(); 
	public static final DataSource GRAMENE_GENES_DB = DataSource.register (
		"Gg", "Gramene Genes DB").asDataSource(); 
	public static final DataSource GRAMENE_LITERATURE = DataSource.register (
		"Gl", "Gramene Literature").asDataSource();
	public static final DataSource GRAMENE_PATHWAY = DataSource.register (
		"Gp", "Gramene Pathway").asDataSource();
	public static final DataSource GEN_PEPT = DataSource.register (
		"Gp", "GenPept").asDataSource(); 
	public static final DataSource HUGO = DataSource.register (
		"H", "HUGO").asDataSource();
	public static final DataSource HSGENE = DataSource.register (
		"Hs", "HsGene").asDataSource();
	public static final DataSource INTERPRO = DataSource.register (
		"I", "InterPro").asDataSource();
	public static final DataSource ILLUMINA = DataSource.register (
		"Il", "Illumina").asDataSource(); 
	public static final DataSource IPI = DataSource.register (
		"Ip", "IPI").asDataSource(); 
	public static final DataSource IRGSP_GENE = DataSource.register (
		"Ir", "IRGSP Gene").asDataSource();
	public static final DataSource ENTREZ_GENE = DataSource.register (
		"L", "Entrez Gene").asDataSource();
	public static final DataSource MGI = DataSource.register (
		"M", "MGI").asDataSource();
	public static final DataSource MIRBASE = DataSource.register (
		"Mb", "miRBase").asDataSource();
	public static final DataSource MAIZE_GDB = DataSource.register (
		"Mg", "MaizeGDB").asDataSource();
	public static final DataSource NASC_GENE = DataSource.register (
		"N", "NASC Gene").asDataSource(); 
	public static final DataSource NUGOWIKI = DataSource.register (
		"Nw", "NuGO wiki").asDataSource();
	public static final DataSource OTHER = DataSource.register (
		"O", "Other").asDataSource();
	public static final DataSource ORYZA_BASE = DataSource.register (
		"Ob", "Oryzabase").asDataSource();
	public static final DataSource OMIM = DataSource.register (
		"Om", "OMIM").asDataSource();
	public static final DataSource RICE_ENSEMBL_GENE = DataSource.register (
		"Os", "Rice Ensembl Gene").asDataSource();
	public static final DataSource PDB = DataSource.register (
		"Pd", "PDB").asDataSource();
	public static final DataSource PFAM = DataSource.register (
		"Pf", "Pfam").asDataSource();
	public static final DataSource PLANTGDB = DataSource.register (
		"Pl", "PlantGDB").asDataSource(); 
	public static final DataSource REFSEQ = DataSource.register (
		"Q", "RefSeq").asDataSource();
	public static final DataSource RGD = DataSource.register (
		"R", "RGD").asDataSource(); 
	public static final DataSource RFAM = DataSource.register (
		"Rf", "Rfam").asDataSource();
	public static final DataSource UNIPROT = DataSource.register (
		"S", "Uniprot/TrEMBL").asDataSource();
	public static final DataSource SNP = DataSource.register (
		"Sn", "dbSNP").asDataSource();
	public static final DataSource GENE_ONTOLOGY = DataSource.register (
		"T", "GeneOntology").asDataSource();
	public static final DataSource TIGR = DataSource.register (
		"Ti", "TIGR").asDataSource(); 
	public static final DataSource UNIGENE = DataSource.register (
		"U", "UniGene").asDataSource();
	public static final DataSource UCSC = DataSource.register (
		"Uc", "UCSC Genome Browser").asDataSource();
	public static final DataSource WORMBASE = DataSource.register (
		"W", "WormBase").asDataSource();
	public static final DataSource WIKIPEDIA = DataSource.register (
		"Wi", "Wikipedia").asDataSource();
	public static final DataSource WHEAT_GENE_CATALOG = DataSource.register (
		"Wc", "Wheat gene catalog").asDataSource(); 
	public static final DataSource WHEAT_GENE_NAMES = DataSource.register (
		"Wn", "Wheat gene names").asDataSource();
	public static final DataSource WHEAT_GENE_REFERENCES= DataSource.register (
		"Wr", "Wheat gene refs").asDataSource();
	public static final DataSource AFFY = DataSource.register (
		"X", "Affy").asDataSource();
	public static final DataSource ZFIN = DataSource.register (
		"Z", "ZFIN").asDataSource();

	/* 
	 * Make patterns of regular expressions for matching 
	 * the gene identifiers with specific gene databases.
	 * (see, 
	 * http://www.childrens-mercy.org/stats/model/arrayDataManagement.htm ) 
	 */	
	private static final Map<Organism, DataSource> ensemblBySpecies = new HashMap<Organism, DataSource>();

	static {
		DataSourcePatterns.registerPattern(
{'fraction_non_alphanumeric': 0.11839525413503595, 'fraction_numerical': 0.0012065758383188376, 'mean_word_length': 5.116851168511685, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3095752', 'n_tokens_mistral': 6245, 'n_tokens_neox': 5791, 'n_words': 1725}