Skip to content

Commit

Permalink
Added support for ngmlr
Browse files Browse the repository at this point in the history
  • Loading branch information
richardmleggett committed Jun 19, 2018
1 parent b509ed0 commit 0115106
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 2 deletions.
Binary file modified dist/NanoOK.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/nanook/NanoOK.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author Richard Leggett
*/
public class NanoOK {
public final static String VERSION_STRING = "v1.32";
public final static String VERSION_STRING = "v1.33";
public final static long SERIAL_VERSION = 3L;

/**
Expand Down
5 changes: 4 additions & 1 deletion src/nanook/NanoOKOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void parseArgs(String[] args) {
System.out.println(" -force to force NanoOK to ignore warnings");
System.out.println(" -timeout to set the number of seconds before giving up waiting for new reads (default 2)");
System.out.println("");
System.out.println("Valid aligners: last, bwa, blasr, marginalign, graphmap, minimap2");
System.out.println("Valid aligners: last, bwa, blasr, marginalign, graphmap, minimap2, ngmlr");
System.out.println("");
System.exit(0);
}
Expand Down Expand Up @@ -991,6 +991,9 @@ public AlignmentFileParser getParser() {
case "minimap2":
parser = new Minimap2Parser(this, references);
break;
case "ngmlr":
parser = new NgmlrParser(this, references);
break;
default:
System.out.println("Aligner unknown!");
System.out.println("");
Expand Down
66 changes: 66 additions & 0 deletions src/nanook/NgmlrParser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Program: NanoOK
* Author: Richard M. Leggett
*
* Copyright 2015 The Genome Analysis Centre (TGAC)
*/

package nanook;

import java.io.File;

/**
* Parser for Ngmlr files
* @author Richard Leggett
*/
public class NgmlrParser extends SAMParser implements AlignmentFileParser {
private String alignmentParams = "-x ont";
private NanoOKOptions options;

public NgmlrParser(NanoOKOptions o, References r) {
super(o, r);
options = o;
}

public String getProgramID() {
return "ngmlr";
}

public int getReadFormat() {
int or = options.getReadFormat();
return or;

//return NanoOKOptions.FASTA;
}

public void setAlignmentParams(String p) {
alignmentParams = p;
}

public boolean outputsToStdout() {
return false;
}

public String getRunCommand(String query, String output, String reference) {
//reference = reference.replaceAll("\\.fasta$", "");
//reference = reference.replaceAll("\\.fa$", "");

return "ngmlr -r " + reference + " -q " + query + " -o "+output;
}

public void checkForIndex(String referenceFile) {
//File f = new File(referenceFile + ".fasta.mmi");

//System.out.println("Checking!!!");

//if (!f.exists()) {
// System.out.println("");
// System.out.println("Error:");
// System.out.println("Can't find file " + f.getPath());
// System.out.println("Have you indexed the reference with minimap2 -d ref.fasta.mmi ref.fasta?");
// System.exit(1);
//}

return;
}
}

0 comments on commit 0115106

Please sign in to comment.