<commit_before>package function.external.knownvar;

import function.annotation.base.AnalysisBase4AnnotatedVar;
import function.annotation.base.AnnotatedVariant;
import utils.CommonCommand;
import utils.ErrorManager;
import java.io.BufferedWriter;
import java.io.FileWriter;

/**
 *
 * @author nick
 */
public class ListKnownVar extends AnalysisBase4AnnotatedVar {

    BufferedWriter bwKnownVar = null;
    final String knownVarFilePath = CommonCommand.outputPath + "knownvar.csv";

    @Override
    public void initOutput() {
        try {
            bwKnownVar = new BufferedWriter(new FileWriter(knownVarFilePath));
            bwKnownVar.write(KnownVarOutput.title);
            bwKnownVar.newLine();
        } catch (Exception ex) {
            ErrorManager.send(ex);
        }
    }

    @Override
    public void doOutput() {
    }

    @Override
    public void closeOutput() {
        try {
            bwKnownVar.flush();
            bwKnownVar.close();
        } catch (Exception ex) {
            ErrorManager.send(ex);
        }
    }

    @Override
    public void doAfterCloseOutput() {
    }

    @Override
    public void beforeProcessDatabaseData() {
    }

    @Override
    public void afterProcessDatabaseData() {
    }

    @Override
    public void processVariant(AnnotatedVariant annotatedVar) {
        try {
            KnownVarOutput knownVarOutput = new KnownVarOutput(annotatedVar);
            bwKnownVar.write(knownVarOutput.variantIdStr + ",");
            bwKnownVar.write(knownVarOutput.geneName + ",");
            bwKnownVar.write(knownVarOutput.toString());
            bwKnownVar.newLine();
        } catch (Exception e) {
            ErrorManager.send(e);
        }
    }

    @Override
    public String toString() {
        return "It is running a list KnownVar function... \n\n"
                + "clinvar table: " + KnownVarManager.clinvarTable + "\n\n"
                + "hgmd table: " + KnownVarManager.hgmdTable + "\n\n"
                + "omim table: " + KnownVarManager.omimTable;
    }
}<commit_msg>output all knownvar tables to log<commit_after>package function.external.knownvar;

import function.annotation.base.AnalysisBase4AnnotatedVar;
import function.annotation.base.AnnotatedVariant;
import utils.CommonCommand;
import utils.ErrorManager;
import java.io.BufferedWriter;
import java.io.FileWriter;

/**
 *
 * @author nick
 */
public class ListKnownVar extends AnalysisBase4AnnotatedVar {

    BufferedWriter bwKnownVar = null;
    final String knownVarFilePath = CommonCommand.outputPath + "knownvar.csv";

    @Override
    public void initOutput() {
        try {
            bwKnownVar = new BufferedWriter(new FileWriter(knownVarFilePath));
            bwKnownVar.write(KnownVarOutput.title);
            bwKnownVar.newLine();
        } catch (Exception ex) {
            ErrorManager.send(ex);
        }
    }

    @Override
    public void doOutput() {
    }

    @Override
    public void closeOutput() {
        try {
            bwKnownVar.flush();
            bwKnownVar.close();
        } catch (Exception ex) {
            ErrorManager.send(ex);
        }
    }

    @Override
    public void doAfterCloseOutput() {
    }

    @Override
    public void beforeProcessDatabaseData() {
    }

    @Override
    public void afterProcessDatabaseData() {
    }

    @Override
    public void processVariant(AnnotatedVariant annotatedVar) {
        try {
            KnownVarOutput knownVarOutput = new KnownVarOutput(annotatedVar);
            bwKnownVar.write(knownVarOutput.variantIdStr + ",");
            bwKnownVar.write(knownVarOutput.geneName + ",");
            bwKnownVar.write(knownVarOutput.toString());
            bwKnownVar.newLine();
        } catch (Exception e) {
            ErrorManager.send(e);
        }
    }

    @Override
    public String toString() {
        return "It is running a list KnownVar function... \n\n"
                + "KnownVar database tables: \n\n"
                + KnownVarManager.clinvarTable + "\n\n"
                + KnownVarManager.hgmdTable + "\n\n"
                + KnownVarManager.omimTable + "\n\n"
                + KnownVarManager.acmgTable + "\n\n"
                + KnownVarManager.adultOnsetTable + "\n\n"
                + KnownVarManager.clinGenTable + "\n\n"
                + KnownVarManager.pgxTable + "\n\n"
                + KnownVarManager.recessiveCarrierTable;
    }
}
{'fraction_non_alphanumeric': 0.09972739663789187, 'fraction_numerical': 0.0009086778736937755, 'mean_word_length': 2.2422680412371134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2401398', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1213, 'n_words': 239}