Skip to content

Commit

Permalink
adding abpoa
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnguyen committed Aug 14, 2020
1 parent a7dc1bd commit 5658552
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>np</groupId>
<artifactId>assembly</artifactId>
<version>0.1.1-SNAPSHOT</version>
<version>0.2.1-beta</version>
<packaging>jar</packaging>

<name>assembly</name>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/japsa/bio/np/ErrorCorrection.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public static void runMultipleAlignment(String faiFile, String faoFile) throws I

}else if (msa.startsWith("spoa")){
cmd = new String[]{"spoa", faiFile};
}else if (msa.startsWith("abpoa")){
cmd = new String[]{"abpoa", faiFile, "-o", faoFile};
}else if (msa.startsWith("muscle")){
cmd = new String[]{"muscle", "-in", faiFile, "-out", faoFile, "-maxiters", "5", "-quiet"};
}else if (msa.startsWith("clustal")) {
Expand Down Expand Up @@ -311,6 +313,9 @@ public static Sequence consensusSequence(List<Sequence> readList, int max, Strin
consensus=readPOAOutput(faoFile, readList.get(0).length());
else if("spoa".equals(msa)){
consensus=readSPOAOutput(faoFile, readList.get(0).length());
}else if("abpoa".equals(msa)) {
SequenceReader reader = SequenceReader.getReader(faoFile);
consensus=reader.nextSequence(DNA.DNA());
}else{
//3.0 Read in multiple alignment
ArrayList<Sequence> seqList = readMultipleAlignment(faoFile);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/rtassembly/NPGraphCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public NPGraphCmd(){
addString("sb", "", "Name of the metaBAT file for binning information (experimental).");
addString("aligner","","Aligner tool that will be used, either minimap2 (default) or BWA-MEM");
addString("algOpt", "", "Settings used by aligner to align long reads to the contigs");
addString("msa","","MSA tools for consensus. Options include spoa, kalign3 (fast); kalign2, poa (slow).");
addString("msa","","MSA tools for consensus. Options include abpoa (recommended), spoa, kalign3 (fast); kalign2, poa (slow).");

addBoolean("overwrite", true, "Whether to overwrite or reuse the intermediate file");
addBoolean("sp", false, "Whether to use SPAdes contigs.paths for bridging.");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/rtassembly/gui/NPGraphFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ private GridPane addAlignmentOptionPane(Stage stage) {


ComboBox<String> consCombo=new ComboBox<String>();
consCombo.getItems().addAll("spoa","kalign","kalign3","poa","none");
consCombo.getItems().addAll("abpoa","spoa","kalign","kalign3","poa","none");
consCombo.valueProperty().bindBidirectional(myass.input.msaProperty());
GridPane.setConstraints(consCombo, 2, 4, 2, 1);
optionPane.getChildren().add(consCombo);
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/org/rtassembly/npgraph/ConsensusCaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ public void setConsensusMSA(String aligner){
aligner=aligner.toLowerCase().trim();
if(aligner.startsWith("spoa"))
msa="spoa";
else if(aligner.startsWith("poa"))
else if(aligner.startsWith("abpoa"))
msa="abpoa";
else if(aligner.startsWith("poa")) //slow but default to many Ubuntu distro
msa="poa";
else if(aligner.startsWith("kalign3"))
msa="kalign3";
else if(aligner.startsWith("kalign"))
else if(aligner.startsWith("kalign")) //slow but default to many Ubuntu distro
msa="kalign";
else
msa="none";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ private boolean checkDeadEdges(Edge e){
}

private void removeBadComponents() {
synchronized(hAss.simGraph) {
// synchronized(rtComponents) {
// synchronized(hAss.simGraph) {
synchronized(rtComponents) {
List<Node> removeNodes=new ArrayList<Node>();
for (Iterator<ConnectedComponent> compIter = rtComponents.iterator(); compIter.hasNext(); ) {
ConnectedComponent comp = compIter.next();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/npgraph/gui/GraphExploreDesktop.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static void main(String args[]) {
hbAss.input.setBinReadsInput(binFile);

hbAss.input.setAligner("minimap2");
hbAss.input.setMSA("kalign"); //spoa: out of memory with reads > 18kbp
hbAss.input.setMSA("abpoa"); //spoa: out of memory with reads > 18kbp
hbAss.prepareShortReadsProcess();
hbAss.input.setLongReadsInput(lInput);
hbAss.prepareLongReadsProcess();
Expand Down

0 comments on commit 5658552

Please sign in to comment.