Search in sources :

Example 1 with Connection

use of org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Connection in project gatk by broadinstitute.

the class AlignedAssemblyOrExcuse method serialize.

private void serialize(final Kryo kryo, final Output output) {
    output.writeInt(assemblyId);
    output.writeString(errorMessage);
    if (errorMessage == null) {
        final int nContigs = assembly.getNContigs();
        final Map<Contig, Integer> contigMap = new HashMap<>();
        output.writeInt(nContigs);
        for (int idx = 0; idx != nContigs; ++idx) {
            final Contig contig = assembly.getContig(idx);
            writeContig(contig, output);
            contigMap.put(contig, idx);
        }
        for (final Contig contig : assembly.getContigs()) {
            final List<Connection> connections = contig.getConnections();
            output.writeInt(connections.size());
            for (final Connection connection : connections) {
                writeConnection(connection, contigMap, output);
            }
        }
        for (final List<BwaMemAlignment> alignments : contigAlignments) {
            output.writeInt(alignments.size());
            for (final BwaMemAlignment alignment : alignments) {
                writeAlignment(alignment, output);
            }
        }
    }
}
Also used : Contig(org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Contig) BwaMemAlignment(org.broadinstitute.hellbender.utils.bwa.BwaMemAlignment) Connection(org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Connection)

Example 2 with Connection

use of org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Connection in project gatk by broadinstitute.

the class AlignedAssemblyOrExcuse method readConnection.

private static Connection readConnection(final Input input, final List<Contig> contigs) {
    final Contig target = contigs.get(input.readInt());
    final int overlapLen = input.readInt();
    final boolean isRC = input.readBoolean();
    final boolean isTargetRC = input.readBoolean();
    return new Connection(target, overlapLen, isRC, isTargetRC);
}
Also used : Contig(org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Contig) Connection(org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Connection)

Aggregations

Connection (org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Connection)2 Contig (org.broadinstitute.hellbender.utils.fermi.FermiLiteAssembly.Contig)2 BwaMemAlignment (org.broadinstitute.hellbender.utils.bwa.BwaMemAlignment)1