Skip to content

Commit

Permalink
Option dash (#8)
Browse files Browse the repository at this point in the history
* Added makefile to make my life easier

* Now getting onejar-maven-plugin from com.jolira

* Added -dash for a '-' rather than reference bases

* Inc version to 0.4
  • Loading branch information
armintoepfer authored May 14, 2018
1 parent a7438ae commit ce3e8dd
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<img src="https://github.com/armintoepfer/ConsensusFixer/blob/master/CF_logo.png?raw=true" alt="ConsensusFixer logo"/>
</p>
<h1 align="center"><b>C</b>onsensus<b>F</b>ixer <b>0.3</b></h1>
<h1 align="center"><b>C</b>onsensus<b>F</b>ixer <b>0.4</b></h1>

***

Expand All @@ -21,6 +21,7 @@ Please get the latest binary at [releases](https://github.com/cbg-ethz/Consensus
### FEATURES:
- Calls consensus sequence with a minimal coverage `-mcc INT`
- Integrates consensus sequence into given reference `-r ref.fasta`
- Optionally insert dashes '-' instead of bases from the reference.
- Include insertions with a minimal coverage of `-mic INT`
- Optionally, only include in-frame insertions `-f`
- Calls amibiguous bases (wobbles) if relative base abundance is above `-plurality DOUBLE`
Expand Down Expand Up @@ -57,6 +58,7 @@ Please open an issue on github
-m : Majority vote respecting pluralityN first, otherwise allow wobbles.
-f : Only allow in frame insertions.
-d : Remove gaps if they are >= pluralityN.
-dash : Use '-' instead of bases from the reference.
-s : Single core mode with low memory footprint.
```

Expand Down
7 changes: 7 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all:a
mvn clean package

a:
mvn -DartifactId=samtools -DgroupId=net.sf -Dversion=1.9.6 -Dpackaging=jar -Dfile=src/main/resources/jars/sam-1.96.jar -DgeneratePom=false install:install-file


4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>ch.ethz.bsse</groupId>
<artifactId>consensusfixer</artifactId>
<version>0.3</version>
<version>0.4</version>
<packaging>jar</packaging>
<name>ConsensusFixer</name>

Expand Down Expand Up @@ -52,7 +52,7 @@
</configuration>
</plugin>
<plugin>
<groupId>org.dstovall</groupId>
<groupId>com.jolira</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>1.4.4</version>
<executions>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ch/ethz/bsse/cf/Startup.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public static void main(String[] args) throws IOException {
private boolean progressiveInsertion;
@Option(name = "-pis")
private int progressiveInsertionSize = 300;
@Option(name = "-dash")
private boolean dashForReference = false;

private void setInputOutput() {
if (output == null) {
Expand Down Expand Up @@ -106,6 +108,7 @@ private void setMainParameters() {
Globals.MAXIMUM_INSERTION = this.maximumInsertion;
Globals.PROGRESSIVE_INSERTION = this.progressiveInsertion;
Globals.PROGRESSIVE_INSERTION_SIZE = this.progressiveInsertionSize;
Globals.INSERT_DASHES_FOR_REFERENCE = this.dashForReference;
StatusUpdate.SILENT = this.silent;
}

Expand Down Expand Up @@ -186,6 +189,7 @@ public void doMain(String[] args) throws IOException {
System.err.println(" -mi \t\t\t: Only the insertion with the maximum frequency greater than mic is incorporated.");
System.err.println(" -pi \t\t\t: Progressive insertion mode, respecting mic.");
System.err.println(" -pis INT\t\t: Window size for progressive insertion mode (default: 300).");
System.err.println(" -dash \t\t: Use '-' instead of bases from the reference.");
System.err.println(" -s \t\t\t: Single core mode with low memory footprint.");
System.err.println("");
System.err.println(" -------------------------");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class Globals {
public static int MIN_CONS_COV;
public static int MIN_INS_COV;
public static int PROGRESSIVE_INSERTION_SIZE;
public static boolean INSERT_DASHES_FOR_REFERENCE;
public static char[] GENOME;
public static final Map<Integer, Map<Integer, Integer>> DELETION_MAP_PASSES = new ConcurrentHashMap<>();
public static final Map<Integer, AtomicLongMap> DELETION_MAP = new ConcurrentHashMap<>();
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/ch/ethz/bsse/cf/utils/Alignment.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ public static void saveConsensus() {
if (Globals.CONSENSUS_MAP.containsKey(i)) {
consensusSequence.append(Globals.CONSENSUS_MAP.get(i));
} else {
consensusSequence.append(Globals.GENOME[i]);
if (Globals.INSERT_DASHES_FOR_REFERENCE){
consensusSequence.append('-');
} else {
consensusSequence.append(Globals.GENOME[i]);
}
}
if (insertionMap.containsKey(i) && !insertionMap.get(i).isEmpty()) {
if (Globals.MAXIMUM_INSERTION) {
Expand Down

0 comments on commit ce3e8dd

Please sign in to comment.