[med-svn] [Git][med-team/bbmap][upstream] New upstream version 38.90+dfsg

Nilesh Patra gitlab at salsa.debian.org
Fri Feb 5 10:37:29 GMT 2021



Nilesh Patra pushed to branch upstream at Debian Med / bbmap


Commits:
ca9d9345 by Nilesh Patra at 2021-02-05T15:48:14+05:30
New upstream version 38.90+dfsg
- - - - -


18 changed files:

- README.md
- current/assemble/BubblePopper.java
- current/clump/KmerReduce.java
- current/consensus/BaseGraph.java
- current/dna/AminoAcid.java
- current/dna/MotifProbsN.java
- current/jgi/AdjustHomopolymers.java
- current/jgi/RQCFilter2.java
- current/shared/Shared.java
- current/sketch/Sketch.java
- current/stream/FASTQ.java
- current/stream/Read.java
- current/structures/ByteBuilder.java
- current/structures/Quantizer.java
- docs/changelog.txt
- kmutate.sh
- rqcfilter2.sh
- tadpole.sh


Changes:

=====================================
README.md
=====================================
@@ -1,6 +1,6 @@
 # BBTools bioinformatics tools, including BBMap.
-# Author: Brian Bushnell, Jon Rood, Shijie Yao
+# Author: Brian Bushnell, Jon Rood, Shijie Yao, Jasper Toscani Field
 # Language: Java, Bash
 # Information about documentation is in /docs/readme.txt.
 
-# Version 38.89
+# Version 38.90


=====================================
current/assemble/BubblePopper.java
=====================================
@@ -636,9 +636,13 @@ public class BubblePopper {
 				}
 			}
 		}
-		if(verbose){System.err.println("Mid nodes concur.");}
-		assert(leftDest<0 || leftDest==center.id); //TODO: This triggered once nondeterministially
+		if(leftDest>=0 && leftDest!=center.id){return false;}//workaround for actual assertion failure
+		assert(leftDest<0 || leftDest==center.id) : 
+			leftDest+", "+center.id; //TODO: This triggered once nondeterministially; determine why
+		if(rightDest>=0 && rightDest!=center.id){return false;}//workaround for potential assertion failure
 		assert(rightDest<0 || rightDest==dest.id);
+		
+		if(verbose){System.err.println("Mid nodes concur.");}
 		return leftDest>=0 && rightDest>=0;
 	}
 	


=====================================
current/clump/KmerReduce.java
=====================================
@@ -12,6 +12,7 @@ import fileIO.FileFormat;
 import fileIO.ReadWrite;
 import jgi.BBMerge;
 import kmer.KmerTableSet;
+import shared.KillSwitch;
 import shared.Parse;
 import shared.Parser;
 import shared.PreParser;
@@ -351,7 +352,7 @@ public class KmerReduce {
 	/*--------------------------------------------------------------*/
 	
 	public byte[] toBytes(final long kmer){
-		byte[] dest=new byte[k];
+		byte[] dest=KillSwitch.allocByte1D(k);
 		fill(kmer, dest, 0);
 		return dest;
 	}


=====================================
current/consensus/BaseGraph.java
=====================================
@@ -8,6 +8,7 @@ import aligner.AlignmentResult;
 import aligner.FlatAligner2;
 import dna.AminoAcid;
 import prok.GeneCaller;
+import shared.KillSwitch;
 import shared.Tools;
 import shared.TrimRead;
 import stream.FASTQ;
@@ -606,7 +607,7 @@ public class BaseGraph extends ConsensusObject implements Serializable {
 		insCount=0;
 		
 //		System.err.println("rpos\tdw\trw\tiw");
-		final byte[] temp=new byte[2];
+		final byte[] temp=KillSwitch.allocByte1D(2);
 		for(int i=0; i<ref.length; i++) {
 			
 			final BaseNode dnode=del[i];


=====================================
current/dna/AminoAcid.java
=====================================
@@ -3,6 +3,7 @@ import java.util.Arrays;
 import java.util.HashMap;
 
 import align2.QualityTools;
+import shared.KillSwitch;
 import shared.Tools;
 import structures.ByteBuilder;
 
@@ -433,7 +434,7 @@ public final class AminoAcid {
 	
 	public static final byte[] numberToBases(int code, int n){
 		
-		byte[] bytes=new byte[n];
+		byte[] bytes=KillSwitch.allocByte1D(n);
 		
 		for(int i=n-1; i>=0; i--){
 			int temp=code&3;
@@ -642,7 +643,7 @@ public final class AminoAcid {
 		final int stop=frame+blen;
 		final int alen=blen/3;
 		
-		byte[] out=new byte[alen];
+		byte[] out=KillSwitch.allocByte1D(alen);
 		for(int i=2+frame, j=0; i<stop; i+=3, j++){
 			byte a=toByte(bases[i-2], bases[i-1], bases[i]);
 			out[j]=a;
@@ -656,7 +657,7 @@ public final class AminoAcid {
 		final int blen=stop-start;
 		final int alen=blen/3;
 		
-		byte[] out=new byte[alen];
+		byte[] out=KillSwitch.allocByte1D(alen);
 		for(int i=2+start, j=0; i<stop; i+=3, j++){
 			byte a=toByte(bases[i-2], bases[i-1], bases[i]);
 			out[j]=a;
@@ -672,7 +673,7 @@ public final class AminoAcid {
 		final int stop=frame+blen;
 		final int alen=blen/3;
 		
-		byte[] out=new byte[alen];
+		byte[] out=KillSwitch.allocByte1D(alen);
 		for(int i=2+frame, j=0; i<stop; i+=3, j++){
 			byte qa=quals[i-2], qb=quals[i-1], qc=quals[i];
 			float pa=QualityTools.PROB_CORRECT[qa], pb=QualityTools.PROB_CORRECT[qb], pc=QualityTools.PROB_CORRECT[qc];
@@ -694,7 +695,7 @@ public final class AminoAcid {
 		final int alen=aminos.length;
 		final int blen=alen*3;
 		
-		final byte[] out=new byte[blen];
+		final byte[] out=KillSwitch.allocByte1D(blen);
 		for(int i=0, j=0; i<alen; i++, j+=3){
 			int code=aminoToCode[aminos[i]];
 			out[j+2]=numberToBase[(code&3)];


=====================================
current/dna/MotifProbsN.java
=====================================
@@ -2,6 +2,8 @@ package dna;
 
 import java.util.Locale;
 
+import shared.KillSwitch;
+
 public class MotifProbsN extends Motif {
 	
 	public static void main(String args[]){
@@ -65,7 +67,7 @@ public class MotifProbsN extends Motif {
 		super(name_, p.length, cen);
 		
 		N=n;
-		chunk=new byte[N];
+		chunk=KillSwitch.allocByte1D(N);
 		baseProb=Motif.baseProbN[N];
 		
 		probs=p;


=====================================
current/jgi/AdjustHomopolymers.java
=====================================
@@ -9,6 +9,7 @@ import dna.AminoAcid;
 import fileIO.ByteFile;
 import fileIO.FileFormat;
 import fileIO.ReadWrite;
+import shared.KillSwitch;
 import shared.Parse;
 import shared.Parser;
 import shared.PreParser;
@@ -440,7 +441,7 @@ public class AdjustHomopolymers {
 	
 	private byte[] fakeQuality(int minlen){
 		if(fakeQuality.length<minlen){
-			fakeQuality=new byte[minlen+10];
+			fakeQuality=KillSwitch.allocByte1D(minlen+10);
 			Arrays.fill(fakeQuality, Shared.FAKE_QUAL);
 		}
 		return fakeQuality;


=====================================
current/jgi/RQCFilter2.java
=====================================
@@ -2455,6 +2455,7 @@ public class RQCFilter2 {
 
 		final boolean useBBSplit=mouseCatDogHuman;
 		{
+			if(deterministic){argList.add("deterministic");}
 			argList.add("ordered="+(ordered && false)); //Ordered is too slow here
 			argList.add("k="+map_k);
 			argList.add("idtag=t");
@@ -2742,6 +2743,7 @@ public class RQCFilter2 {
 
 		ArrayList<String> argList=new ArrayList<String>();
 		{
+			if(deterministic){argList.add("deterministic");}
 			argList.add("k="+map_k);
 			argList.add("idtag=t");
 			argList.add("printunmappedcount");
@@ -2866,6 +2868,7 @@ public class RQCFilter2 {
 
 		ArrayList<String> argList=new ArrayList<String>();
 		{
+			if(deterministic){argList.add("deterministic");}
 			if(ordered){argList.add("ordered");}
 			argList.add("quickmatch");
 			argList.add("k="+map_k);
@@ -2999,6 +3002,7 @@ public class RQCFilter2 {
 		final String outPre=(outPrefix==null ? outDir : (tmpDir==null ? outDir : tmpDir)+outPrefix);
 		
 		{
+			if(deterministic){argList.add("deterministic");}
 			if(ordered){argList.add("ordered");}
 			argList.add("minratio=.9");
 			argList.add("maxindel=3");
@@ -3873,9 +3877,11 @@ public class RQCFilter2 {
 	private String out1=null;
 	/** Secondary output reads file */
 	private String out2=null;
-	
+
 	private boolean deleteTemp=true;
 	
+	private boolean deterministic=true;
+	
 	private boolean ordered=false;
 	
 	private boolean dryrun=false;


=====================================
current/shared/Shared.java
=====================================
@@ -124,8 +124,8 @@ public class Shared {
 	public static final int GAPCOST=Tools.max(1, GAPLEN/64);
 	public static final byte GAPC='-';
 	
-	public static String BBMAP_VERSION_STRING="38.89";
-	public static String BBMAP_VERSION_NAME="Kmer Sets";
+	public static String BBMAP_VERSION_STRING="38.90";
+	public static String BBMAP_VERSION_NAME="Byte Safety";
 	
 	public static boolean TRIM_READ_COMMENTS=false;
 	public static boolean TRIM_RNAME=false; //For mapped sam reads


=====================================
current/sketch/Sketch.java
=====================================
@@ -9,6 +9,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import dna.AminoAcid;
 import fileIO.ReadWrite;
+import shared.KillSwitch;
 import shared.Tools;
 import structures.AbstractBitSet;
 import structures.ByteBuilder;
@@ -699,7 +700,7 @@ public class Sketch extends SketchObject implements Comparable<Sketch>, Cloneabl
 		toHeader(bb);
 		bb.append("\n");
 		byte[] temp=null;
-		if(CODING==A48){temp=new byte[12];}
+		if(CODING==A48){temp=KillSwitch.allocByte1D(12);}
 		for(int i=0; i<keys.length; i++){
 			long key=keys[i];
 			int count=(keyCounts==null ? 1 : keyCounts[i]);
@@ -729,7 +730,7 @@ public class Sketch extends SketchObject implements Comparable<Sketch>, Cloneabl
 		long prev=0;
 		toHeader(bb);
 		bb.append("\n");
-		final byte[] temp=new byte[12];
+		final byte[] temp=KillSwitch.allocByte1D(12);
 
 		if(keyCounts==null){
 			for(int i=0; i<keys.length; i++){


=====================================
current/stream/FASTQ.java
=====================================
@@ -905,7 +905,7 @@ public class FASTQ {
 	}
 	
 	public static String qualToString(byte[] quals){
-		byte[] q2=new byte[quals.length];
+		byte[] q2=KillSwitch.allocByte1D(quals.length);
 		for(int i=0; i<quals.length; i++){
 			q2[i]=(byte)(quals[i]+ASCII_OFFSET);
 		}


=====================================
current/stream/Read.java
=====================================
@@ -3875,14 +3875,14 @@ public final class Read implements Comparable<Read>, Cloneable, Serializable{
 
 	public static byte[] getFakeQuality(int len){
 		if(len>=QUALCACHE.length){
-			byte[] r=new byte[len];
+			byte[] r=KillSwitch.allocByte1D(len);
 			Arrays.fill(r, (byte)30);
 			return r;
 		}
 		if(QUALCACHE[len]==null){
 			synchronized(QUALCACHE){
 				if(QUALCACHE[len]==null){
-					QUALCACHE[len]=new byte[len];
+					QUALCACHE[len]=KillSwitch.allocByte1D(len);
 					Arrays.fill(QUALCACHE[len], (byte)30);
 				}
 			}


=====================================
current/structures/ByteBuilder.java
=====================================
@@ -20,17 +20,17 @@ public final class ByteBuilder implements Serializable, CharSequence {
 	private static final long serialVersionUID = -4786450129730831665L;
 	
 	public ByteBuilder(){
-		array=new byte[32];
+		array=KillSwitch.allocByte1D(32);
 	}
 	
 	public ByteBuilder(int initial){
 		assert(initial>=1);
-		array=new byte[initial];
+		array=KillSwitch.allocByte1D(initial);
 	}
 	
 	public ByteBuilder(Object o){
 		String s=o.toString();
-		array=new byte[s.length()+1];
+		array=KillSwitch.allocByte1D(s.length()+1);
 		append(s);
 	}
 	
@@ -560,7 +560,7 @@ public final class ByteBuilder implements Serializable, CharSequence {
 		if(array.length<=maxLen){return;}
 //		assert(length<=maxLen) : length+", "+array.length+", "+maxLen;
 		if(length<1){
-			array=new byte[maxLen];
+			array=KillSwitch.allocByte1D(maxLen);
 		}else{
 			array=KillSwitch.copyOf(array, maxLen);
 			length=Tools.min(length, maxLen);
@@ -645,7 +645,7 @@ public final class ByteBuilder implements Serializable, CharSequence {
 	
 	public byte[] array;
 	public int length=0;
-	private final byte[] numbuffer=new byte[40];
+	private final byte[] numbuffer=KillSwitch.allocByte1D(40);
 
 	public static final byte[] numbers=new byte[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
 	public static final byte[] nullBytes="null".getBytes();


=====================================
current/structures/Quantizer.java
=====================================
@@ -1,5 +1,6 @@
 package structures;
 
+import shared.KillSwitch;
 import shared.Parse;
 import shared.Tools;
 import stream.Read;
@@ -64,7 +65,7 @@ public class Quantizer {
 	}
 	
 	private static final byte[] makeQualityRemapArray(byte[] quantizeArray) {
-		byte[] array=new byte[128];
+		byte[] array=KillSwitch.allocByte1D(128);
 		for(int i=0; i<array.length; i++){
 			byte q=0;
 			for(byte x : quantizeArray){


=====================================
docs/changelog.txt
=====================================
@@ -890,12 +890,16 @@ Wrote KExpand and kmutate.sh for creating sets of mutant kmers.
 Split Parse class off from Tools.
 38.89
 Added support for degenerate amino acid symbols B, J, Z.
+38.90
+Added workaround for BubblePopper 640 assertion failure.
+RQCFilter deterministic mode added for mapping phases.
+Wrapped instances of byte array instantiation in allocByte1D.
 
 
 TODO: Variant whitelist for callvariants
 TODO: filtervcf multiple position interval support.
 TODO: refnames flag in seal should clearly indicate it outputs on file per ref file.  Also kmers should be unified per reference.
-TODO: BubblePopper 640 assertion fired (shijie).
+TODO: Understand how BubblePopper 640 assertion can occur.
 TODO: ApplyVariants fails silently if the header mismatches in certain ways - e.g. "NC123" versus "NC123 virus".
 TODO: make universal flag document including e.g. cq (changequality).
 TODO: bzip2 fails on JGI cloud, though lbzip2 works.  Test bzip2 on Cori.


=====================================
kmutate.sh
=====================================
@@ -5,10 +5,10 @@ echo "
 Written by Brian Bushnell
 Last modified January 26, 2021
 
-Description:  Generates mutants of kmers in input data, allowing specified 
-numbers of substitutions, insertions, and deletions.  Intended for
-pattern-matching with BBDuk or Seal, analyzing barcodes and other short 
-synthetic oligos, and so forth. Input may be fasta or fastq, compressed or raw.
+Description:  Given a reference, generates a kmer spectrum including a 
+specified number of substitutions, insertions, and deletions.  The output is 
+useful for analyzing barcodes or other short oligos, and filtering using
+BBDuk or Seal. Input may be fasta or fastq, compressed or raw.
 See also kcompress, kmercountexact, and bbkmerset.
 
 Usage:  kmutate.sh in=<file> out=<file> k=<kmer length> edist=<edit distance>


=====================================
rqcfilter2.sh
=====================================
@@ -3,7 +3,7 @@
 usage(){
 echo "
 Written by Brian Bushnell
-Last modified January 26, 2021
+Last modified February 3, 2021
 
 Description:  RQCFilter2 is a revised version of RQCFilter that uses a common path for all dependencies.
 The dependencies are available at http://portal.nersc.gov/dna/microbial/assembly/bushnell/RQCFilterData.tar


=====================================
tadpole.sh
=====================================
@@ -3,7 +3,7 @@
 usage(){
 echo "
 Written by Brian Bushnell
-Last modified May 28, 2020
+Last modified February 3, 2021
 
 Description:  Uses kmer counts to assemble contigs, extend sequences, 
 or error-correct reads.  Tadpole has no upper bound for kmer length,



View it on GitLab: https://salsa.debian.org/med-team/bbmap/-/commit/ca9d9345ae63881d0a4aacd4774e9e9d0589ad28

-- 
View it on GitLab: https://salsa.debian.org/med-team/bbmap/-/commit/ca9d9345ae63881d0a4aacd4774e9e9d0589ad28
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20210205/0a7c8c39/attachment-0001.html>


More information about the debian-med-commit mailing list