forked from richardmleggett/NanoOK
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
521b6c3
commit b509ed0
Showing
7 changed files
with
154 additions
and
50 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Program: NanoOK | ||
* Author: Richard M. Leggett | ||
* | ||
* Copyright 2015 The Genome Analysis Centre (TGAC) | ||
*/ | ||
|
||
package nanook; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* Parser for Minimap2 files | ||
* @author Richard Leggett | ||
*/ | ||
public class Minimap2Parser extends SAMParser implements AlignmentFileParser { | ||
private String alignmentParams = "-x map-ont"; | ||
private NanoOKOptions options; | ||
|
||
public Minimap2Parser(NanoOKOptions o, References r) { | ||
super(o, r); | ||
options = o; | ||
} | ||
|
||
public String getProgramID() { | ||
return "minimap2"; | ||
} | ||
|
||
public int getReadFormat() { | ||
int or = options.getReadFormat(); | ||
return or; | ||
|
||
//return NanoOKOptions.FASTA; | ||
} | ||
|
||
public void setAlignmentParams(String p) { | ||
alignmentParams = p; | ||
} | ||
|
||
public boolean outputsToStdout() { | ||
return true; | ||
} | ||
|
||
public String getRunCommand(String query, String output, String reference) { | ||
//reference = reference.replaceAll("\\.fasta$", ""); | ||
//reference = reference.replaceAll("\\.fa$", ""); | ||
|
||
if (alignmentParams == "") { | ||
return "minimap2 -a " + reference + ".mmi " + query; | ||
} else { | ||
return "minimap2 " + alignmentParams + " -a " + reference + ".mmi " + query; | ||
} | ||
} | ||
|
||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters