<commit_before>package function.external.subrvis;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import utils.ErrorManager;

/**
 *
 * @author nick
 */
public class SubRvisManager {

    private static final String SUBRVIS_EXON_PATH = "data/subrvis/exon_021116.txt";

    private static HashMap<String, ArrayList<SubRvisGene>> geneDomainMap
            = new HashMap<String, ArrayList<SubRvisGene>>();
    private static HashMap<String, ArrayList<SubRvisGene>> geneExonMap
            = new HashMap<String, ArrayList<SubRvisGene>>();

    public static String getTitle() {
        if (SubRvisCommand.isIncludeSubRvis) {
            return "subRVIS Domain Name,"
                    + "subRVIS Domain Score,"
                    + "subRVIS Exon Name,"
                    + "subRVIS Exon Score,";
        } else {
            return "";
        }
    }

    public static void init() {
        if (SubRvisCommand.isIncludeSubRvis) {
            initGeneMap(geneDomainMap, SUBRVIS_DOMAIN_PATH);

            initGeneMap(geneExonMap, SUBRVIS_EXON_PATH);
        }
    }

    private static void initGeneMap(HashMap<String, ArrayList<SubRvisGene>> geneMap, String filePath) {
        try {
            File f = new File(filePath);
            FileInputStream fstream = new FileInputStream(f);
            DataInputStream in = new DataInputStream(fstream);<commit_msg>support new subrvis file<commit_after>package function.external.subrvis;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import utils.ErrorManager;

/**
 *
 * @author nick
 */
public class SubRvisManager {

    private static final String SUBRVIS_DOMAIN_PATH = "data/subrvis/domain_score_041916.txt";
    private static final String SUBRVIS_EXON_PATH = "data/subrvis/exon_score_041916.txt";

    private static HashMap<String, ArrayList<SubRvisGene>> geneDomainMap
            = new HashMap<String, ArrayList<SubRvisGene>>();
    private static HashMap<String, ArrayList<SubRvisGene>> geneExonMap
            = new HashMap<String, ArrayList<SubRvisGene>>();

    public static String getTitle() {
        if (SubRvisCommand.isIncludeSubRvis) {
            return "subRVIS Domain Name,"
                    + "subRVIS Domain Score,"
                    + "subRVIS Exon Name,"
                    + "subRVIS Exon Score,";
        } else {
            return "";
        }
    }

    public static void init() {
        if (SubRvisCommand.isIncludeSubRvis) {
            initGeneMap(geneDomainMap, SUBRVIS_DOMAIN_PATH);

            initGeneMap(geneExonMap, SUBRVIS_EXON_PATH);
        }
    }

    private static void initGeneMap(HashMap<String, ArrayList<SubRvisGene>> geneMap, String filePath) {
        try {
            File f = new File(filePath);
            FileInputStream fstream = new FileInputStream(f);
            DataInputStream in = new DataInputStream(fstream);
{'fraction_non_alphanumeric': 0.0922930542340628, 'fraction_numerical': 0.005708848715509039, 'mean_word_length': 2.8, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '2012376', 'n_tokens_mistral': 945, 'n_tokens_neox': 899, 'n_words': 202}