Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use latest version of fermilite jni #4622

Merged
merged 1 commit into from
Apr 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ dependencies {
}

compile 'org.broadinstitute:gatk-bwamem-jni:1.0.4'
compile 'org.broadinstitute:gatk-fermilite-jni:1.1.0'
compile 'org.broadinstitute:gatk-fermilite-jni:1.2.0'

// Required for COSMIC Funcotator data source:
compile 'org.xerial:sqlite-jdbc:3.20.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public AlignedAssemblyOrExcuse apply( final Tuple2<Integer, List<SVFastqUtils.Fa
// record the assembly as a GFA, if requested
if ( fastqDir != null && writeGFAs ) {
final String gfaName = String.format("%s/%s.gfa", fastqDir, assemblyName);
try ( final OutputStream os = BucketUtils.createFile(gfaName) ) {
assembly.writeGFA(os);
try ( final Writer writer = new BufferedWriter(new OutputStreamWriter(BucketUtils.createFile(gfaName))) ) {
assembly.writeGFA(writer);
}
catch ( final IOException ioe ) {
throw new GATKException("Can't write "+gfaName, ioe);
Expand Down Expand Up @@ -137,7 +137,7 @@ static FermiLiteAssembly removeShadowedContigs( final FermiLiteAssembly assembly
}
});

/** Remove contigs that vary by a small number of SNVs from another contig. E.g.,
/* Remove contigs that vary by a small number of SNVs from another contig. E.g.,
* <-------contigA----------->
* ||x|||||x||||x|||
* <---contigB----->
Expand Down Expand Up @@ -241,15 +241,15 @@ static FermiLiteAssembly removeUnbranchedConnections( final FermiLiteAssembly as
if ( !examined.add(tig) ) return;
Connection conn;
Connection conn2;
while ( (conn = getSolePredecessor(tig)) != null &&
while ( (conn = tig.getSolePredecessor()) != null &&
!examined.contains(conn.getTarget()) &&
(conn2 = getSingletonConnection(conn.getTarget(), !conn.isTargetRC())) != null ) {
(conn2 = conn.getTarget().getSingletonConnection(!conn.isTargetRC())) != null ) {
examined.add(conn.getTarget());
tig = joinContigsWithConnections(tig, conn, conn2);
}
while ( (conn = getSoleSuccessor(tig)) != null &&
while ( (conn = tig.getSoleSuccessor()) != null &&
!examined.contains(conn.getTarget()) &&
(conn2 = getSingletonConnection(conn.getTarget(), !conn.isTargetRC())) != null ) {
(conn2 = conn.getTarget().getSingletonConnection(!conn.isTargetRC())) != null ) {
examined.add(conn.getTarget());
tig = joinContigsWithConnections(tig, conn, conn2);
}
Expand All @@ -258,25 +258,6 @@ static FermiLiteAssembly removeUnbranchedConnections( final FermiLiteAssembly as
return new FermiLiteAssembly(contigList);
}

private static Connection getSolePredecessor( final Contig contig ) {
return getSingletonConnection(contig, true);
}

private static Connection getSoleSuccessor( final Contig contig ) {
return getSingletonConnection(contig, false);
}

private static Connection getSingletonConnection( final Contig contig, final boolean isRC ) {
Connection singleton = null;
for ( Connection conn : contig.getConnections() ) {
if ( conn.isRC() == isRC ) {
if ( singleton != null ) return null; // found multiple connections, return null
singleton = conn;
}
}
return singleton;
}

// combine two connected contigs into one, preserving all their connections, except their connections to each other.
// (i.e., firstContig gets joined to connection.getTarget().) the connection argument is the pointer from
// firstContig to the 2nd contig, and rcConnection is the back-pointer from 2nd contig to firstContig.
Expand All @@ -292,8 +273,8 @@ private static Contig joinContigsWithConnections( final Contig firstContig,
final Connection newConnection =
new Connection(conn.getTarget(), conn.getOverlapLen(), true, conn.isTargetRC());
replaceConnection(conn.getTarget(),
rcConnection(firstContig, conn),
rcConnection(joinedContig, newConnection));
conn.rcConnection(firstContig),
newConnection.rcConnection(joinedContig));
connections.add(newConnection);
}
}
Expand All @@ -302,19 +283,15 @@ private static Contig joinContigsWithConnections( final Contig firstContig,
final Connection newConnection =
new Connection(conn.getTarget(), conn.getOverlapLen(), false, conn.isTargetRC());
replaceConnection(conn.getTarget(),
rcConnection(lastContig, conn),
rcConnection(joinedContig, newConnection));
conn.rcConnection(lastContig),
newConnection.rcConnection(joinedContig));
connections.add(newConnection);
}
}
joinedContig.setConnections(connections);
return joinedContig;
}

private static Connection rcConnection( final Contig contig, final Connection connection ) {
return new Connection(contig, connection.getOverlapLen(), !connection.isTargetRC(), !connection.isRC());
}

private static void replaceConnection( final Contig contig,
final Connection oldConnection,
final Connection newConnection ) {
Expand Down Expand Up @@ -486,6 +463,7 @@ private static final class ContigLocation {
private final Contig contig;
private final int offset;
private final boolean canonical;

public ContigLocation(final Contig contig, final int offset, final boolean canonical ) {
this.contig = contig;
this.offset = offset;
Expand Down