<commit_before>package org.opencb.cellbase.lib.mongodb;

import com.mongodb.DB;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.ServerAddress;

import org.bioinfo.commons.Config;
import org.opencb.cellbase.core.lib.DBAdaptorFactory;
import org.opencb.cellbase.core.lib.api.*;
import org.opencb.cellbase.core.lib.api.regulatory.RegulatoryRegionDBAdaptor;
import org.opencb.cellbase.core.lib.api.regulatory.TfbsDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.MutationDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.StructuralVariationDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.VariantEffectDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.VariationDBAdaptor;
import org.opencb.cellbase.lib.mongodb.regulatory.RegulatoryRegionMongoDBAdaptor;
import org.opencb.cellbase.lib.mongodb.regulatory.TfbsMongoDBAdaptor;

import java.io.IOException;
import java.net.UnknownHostException;
import java.util.*;

public class MongoDBAdaptorFactory extends DBAdaptorFactory {

	private static Map<String, DB> mongoDBFactory;
	// private static Config applicationProperties;
	private static ResourceBundle resourceBundle;
	protected static Config applicationProperties;

	protected static Map<String, String> speciesAlias;


	static {
		// mongoDBFactory = new HashMap<String, HibernateDBAdaptor>(20);
        speciesAlias = new HashMap<String, String>();
		mongoDBFactory = new HashMap<String, DB>(10);

		// reading application.properties file
		resourceBundle = ResourceBundle.getBundle("mongodb");
		try {
			applicationProperties = new Config(resourceBundle);

            String[] speciesArray = applicationProperties.getProperty("SPECIES").split(",");
            String[] alias = null;
            String version;
            for(String species: speciesArray) {
                species = species.toUpperCase();
                version = applicationProperties.getProperty(species+".DEFAULT.VERSION").toUpperCase();
                alias = applicationProperties.getProperty(species +"."+version+".ALIAS").split(",");

                System.out.println("");
                System.out.println(species);
                for(String al: alias) {
                    System.out.print(al+' ');
                    speciesAlias.put(al, species);
                }
                System.out.println("");
                // For to recognize the species code
                speciesAlias.put(species, species);
            }


		} catch (IOException e) {
			applicationProperties = new Config();<commit_msg>removed log lines<commit_after>package org.opencb.cellbase.lib.mongodb;

import com.mongodb.DB;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.ServerAddress;

import org.bioinfo.commons.Config;
import org.opencb.cellbase.core.lib.DBAdaptorFactory;
import org.opencb.cellbase.core.lib.api.*;
import org.opencb.cellbase.core.lib.api.regulatory.RegulatoryRegionDBAdaptor;
import org.opencb.cellbase.core.lib.api.regulatory.TfbsDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.MutationDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.StructuralVariationDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.VariantEffectDBAdaptor;
import org.opencb.cellbase.core.lib.api.variation.VariationDBAdaptor;
import org.opencb.cellbase.lib.mongodb.regulatory.RegulatoryRegionMongoDBAdaptor;
import org.opencb.cellbase.lib.mongodb.regulatory.TfbsMongoDBAdaptor;

import java.io.IOException;
import java.net.UnknownHostException;
import java.util.*;

public class MongoDBAdaptorFactory extends DBAdaptorFactory {

	private static Map<String, DB> mongoDBFactory;
	// private static Config applicationProperties;
	private static ResourceBundle resourceBundle;
	protected static Config applicationProperties;

	protected static Map<String, String> speciesAlias;


	static {
		// mongoDBFactory = new HashMap<String, HibernateDBAdaptor>(20);
        speciesAlias = new HashMap<String, String>();
		mongoDBFactory = new HashMap<String, DB>(10);

		// reading application.properties file
		resourceBundle = ResourceBundle.getBundle("mongodb");
		try {
			applicationProperties = new Config(resourceBundle);

            String[] speciesArray = applicationProperties.getProperty("SPECIES").split(",");
            String[] alias = null;
            String version;
            for(String species: speciesArray) {
                species = species.toUpperCase();
                version = applicationProperties.getProperty(species+".DEFAULT.VERSION").toUpperCase();
                alias = applicationProperties.getProperty(species +"."+version+".ALIAS").split(",");

//                System.out.println("");
//                System.out.println(species);
                for(String al: alias) {
                    System.out.print(al+' ');
                    speciesAlias.put(al, species);
                }
//                System.out.println("");
                // For to recognize the species code
                speciesAlias.put(species, species);
            }


		} catch (IOException e) {
			applicationProperties = new Config();
{'fraction_non_alphanumeric': 0.10849420849420849, 'fraction_numerical': 0.0015444015444015444, 'mean_word_length': 3.4779602420051856, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6350523', 'n_tokens_mistral': 1564, 'n_tokens_neox': 1499, 'n_words': 257}