Search in sources :

Example 1 with CanonicalTranscript

use of com.hartwig.hmftools.common.gene.CanonicalTranscript in project hmftools by hartwigmedical.

the class CanonicalTranscriptDAO method write.

void write(@NotNull List<CanonicalTranscript> transcripts) {
    Timestamp timestamp = new Timestamp(new Date().getTime());
    context.delete(CANONICALTRANSCRIPT).execute();
    for (List<CanonicalTranscript> split : Iterables.partition(transcripts, DB_BATCH_INSERT_SIZE)) {
        InsertValuesStep19 inserter = context.insertInto(CANONICALTRANSCRIPT, CANONICALTRANSCRIPT.GENE, CANONICALTRANSCRIPT.GENEID, CANONICALTRANSCRIPT.CHROMOSOMEBAND, CANONICALTRANSCRIPT.CHROMOSOME, CANONICALTRANSCRIPT.GENESTART, CANONICALTRANSCRIPT.GENEEND, CANONICALTRANSCRIPT.TRANSCRIPTID, CANONICALTRANSCRIPT.TRANSCRIPTVERSION, CANONICALTRANSCRIPT.TRANSCRIPTSTART, CANONICALTRANSCRIPT.TRANSCRIPTEND, CANONICALTRANSCRIPT.EXONS, CANONICALTRANSCRIPT.EXONSTART, CANONICALTRANSCRIPT.EXONEND, CANONICALTRANSCRIPT.EXONBASES, CANONICALTRANSCRIPT.CODINGSTART, CANONICALTRANSCRIPT.CODINGEND, CANONICALTRANSCRIPT.CODINGBASES, CANONICALTRANSCRIPT.STRAND, CANONICALTRANSCRIPT.MODIFIED);
        split.forEach(x -> addRecord(timestamp, inserter, x));
        inserter.execute();
    }
}
Also used : CanonicalTranscript(com.hartwig.hmftools.common.gene.CanonicalTranscript) Timestamp(java.sql.Timestamp) Date(java.util.Date) InsertValuesStep19(org.jooq.InsertValuesStep19)

Example 2 with CanonicalTranscript

use of com.hartwig.hmftools.common.gene.CanonicalTranscript in project hmftools by hartwigmedical.

the class LoadCanonicalTranscripts method main.

public static void main(@NotNull final String[] args) throws ParseException, SQLException {
    final Options options = createBasicOptions();
    final CommandLine cmd = createCommandLine(args, options);
    final DatabaseAccess dbAccess = databaseAccess(cmd);
    LOGGER.info("Reading gene panel");
    final List<CanonicalTranscript> transcripts = CanonicalTranscriptFactory.create(HmfGenePanelSupplier.allGeneList());
    LOGGER.info("Persisting transcripts to database");
    dbAccess.writeCanonicalTranscripts(transcripts);
    LOGGER.info("Complete");
}
Also used : Options(org.apache.commons.cli.Options) CommandLine(org.apache.commons.cli.CommandLine) CanonicalTranscript(com.hartwig.hmftools.common.gene.CanonicalTranscript) DatabaseAccess(com.hartwig.hmftools.patientdb.dao.DatabaseAccess)

Aggregations

CanonicalTranscript (com.hartwig.hmftools.common.gene.CanonicalTranscript)2 DatabaseAccess (com.hartwig.hmftools.patientdb.dao.DatabaseAccess)1 Timestamp (java.sql.Timestamp)1 Date (java.util.Date)1 CommandLine (org.apache.commons.cli.CommandLine)1 Options (org.apache.commons.cli.Options)1 InsertValuesStep19 (org.jooq.InsertValuesStep19)1